Categorygithub.com/DrJosh9000/exp
modulepackage
0.0.0-20240212032044-9687f6313245
Repository: https://github.com/drjosh9000/exp.git
Documentation: pkg.go.dev

# README

exp

Go Reference Build status

Experiments 🧑‍🔬

# Packages

Package algebra implements various generic algebra types.
Package algo implements a few generic algorithms.
Package emu provides a generalised virtual machine for executing toy programs that operate solely on integers.
No description provided by the author
Package para implements parallel versions of some things in algo.
Package parse contains string parsing helper functions.
Package stream provides a variety of context-aware generic functions that operate on channels.

# Functions

Fmatchf wraps fmt.Fscanf, reporting whether input was scanned successfully.
Must returns t if err is nil.
Must0 panics if err is not nil.
Must2 returns (t, u) if err is nil.
Must3 returns (t, u, v) if err is nil.
MustAtoi parses the string as an integer, or panics.
MustCut is a version of strings.Cut that panics if sep is not found within s.
MustForEachLineIn calls cb with each line in the file.
MustFunc converts a func (S -> (T, error)) into a func (S -> T) that instead panics on any error.
MustReadByteGrid reads the entire file into memory and returns the contents in the form of a dense byte grid.
MustReadDelimited reads the entire file into memory, splits the contents by a delimiter, trims leading and trailing spaces from each component, and returns the results as a slice.
MustReadInts reads the entire file into memory, splits the contents by the delimiter, parses each component as a decimal integer, and returns them as a slice.
MustReadLines reads the entire file into memory and returns a slice containing each line of text (essentially, strings.Split(contents, "\n"), but ignoring the final element if it is empty).
MustSscanf parses strings, or panics.
No description provided by the author
Ptr returns a pointer to a variable having the value t.
RangeCh ranges over a channel in a context-aware way.
Retry creates a channel on which the current time is sent up to count times.
Retry2 is like Retry, but returns a Go 1.22 "GOEXPERIMENT=rangefunc" style "iterator" and does not use an extra goroutine under the hood.
Smatchf wraps fmt.Sscanf, reporting whether input was scanned successfully.

# Variables

Break is used to exit the RangeCh loop early without error.

# Structs

No description provided by the author