A small collection of useful generic Golang collections. There are two helpful collection interfaces. Iterator[T]
is
an eager iteration primitive, while Seq[T]
is lazy. The full Seq[T]
comes with some helpful methods, which implies a
lot of extra burden to implement. The smallest possible sequence is defined by BasicSeq[T]
which is quite easy to
implement. You can use FullSeqFrom()
to turn any BasicSeq[T]
into a Seq[T]
.
The package implements a completely new data type, a Set[T]
. This is derived from the built in dictionaries in
Golang. On top of that, many helper types have been added to simplify working with different data types. For maps, the
most important are Keys[K, V]
and Values[K, V]
. For slices, Slice[T]
exists.
Finally, the package also supplies various function signatures to clarify what types are used in various places. These
are divided up in three categories - procedures, functions and predicates. A procedure is a function that doesn't return
a value. A function returns a value and a predicate is a function that returns a boolean. These types are Proc1
,
Proc2
, and Proc3
, FixedFunction
, Func1
, Func2
, Func3
and FuncN
, and Predicate
, Predicate2
and
Predicate3
.