# README
As soon as go1.18beta1 was tagged, I realized Advent of Code 2021, which I was in the middle of working on, would be the perfect non-production playground for a lot of useful generics. Most of AOC is data structures and data parsing, which makes it a pretty ideal but noncritical place to mess around with a new language feature.
If you use this package, there is a small chance that minor versions (pre-1) will make breaking changes but I've tried to get things right/most-flexible the first time. Feel free to rip apart, ignore, or use to your heart's content. :-)
# Functions
GroupByFunc takes any slice of T and a func that returns a comparable and value.
IntSlicer takes a string and returns a function to slice input strings by that, and convert the results to integers.
IsInBounds returns for any 2d slice whether the given ints are in bounds.
Last returns the last item in the slice of any slice-like type.
Make2DSlice creates a 2d slice of type T and length ixj, and sets the i,jth elements of the 2d array to the result of f(i,j).
GroupByFunc takes any slice of T and a func that returns a comparable and value.
MaxOf returns the index and highest valued of the ordered input items based on the given func.
NonDiagSliceNeighbors is a utility function to get the elements surrounding a particular 2d index, not including diagonally adjacent elements.
Print2dGrid simply iterates each item and prints it out in a fmt.Print 2d grid.
ReadAOC takes any io.Reader (suggest using bufio.Reader to prevent loss of bytes in io.EOF cases) and calls the provided func on every space-trimmed input line, returning a slice of that item and any errors encountered.
SetFrom returns the items given added into a set.
SetFromFunc takes a slice and a func that returns something comparable, and returns a set of the unique comparable results.
SliceNeighbors is a utility function to get the elements surrounding a particular 2d index.
VisitCells calls a function for a Cell of each value in the given 2D array.
VisitNeighbors iterates over a 2d array, calling a func with each index and a list of neighbors.
VisitNonDiagNeighbors iterates over a 2d array, calling a func with each index and a list of neighbors, not including diagonal neighbors.
# Structs
Type Cell is used by many of the 2D slice methods to indicate both value and slice indices to the caller/callee.
# Type aliases
Queue is a naive, non-concurrent FIFO queue purely meant to reduce boilerplate of the most common pure-go "simple queue.".
Set is a naive, non-concurrent set implementation meant to reduce boilerplate of the most common pure-go "set" using map of T to empty struct.
Stack is a naive, non-concurrent Stack implementation purely meant to reduce boilerplate of the most common pure-go "simple stack".