Documentation
¶
Index ¶
- func Bin[V, W any](op func(V, V) W) func(Gen[V], Gen[V]) Gen[W]
- func Head[V any](gen Gen[V], n int) func() iter.Seq[V]
- func ToSlice[V any](gen Gen[V]) []V
- func Uni[V, W any](op func(V) W) func(Gen[V]) Gen[W]
- type Gen
- func Add[V constraints.Ordered](xGen Gen[V], yGen Gen[V]) Gen[V]
- func All(gen Gen[bool]) Gen[bool]
- func And[V bool](xGen Gen[bool], yGen Gen[bool]) Gen[bool]
- func Any(gen Gen[bool]) Gen[bool]
- func Bind[V, W any](gen Gen[V], f func(V) Gen[W]) Gen[W]
- func Const[V any](v V) Gen[V]
- func Dec[V constraints.Integer](v V) Gen[V]
- func Div[V Number](xGen Gen[V], yGen Gen[V]) Gen[V]
- func Eq[V comparable](xGen Gen[V], yGen Gen[V]) Gen[bool]
- func FromSlice[V any](values []V) Gen[V]
- func Ge[V constraints.Ordered](xGen Gen[V], yGen Gen[V]) Gen[bool]
- func Gt[V constraints.Ordered](xGen Gen[V], yGen Gen[V]) Gen[bool]
- func If[V any](condGen Gen[bool], thenGen Gen[V], elseGen Gen[V]) Gen[V]
- func Inc[V constraints.Integer](v V) Gen[V]
- func Le[V constraints.Ordered](xGen Gen[V], yGen Gen[V]) Gen[bool]
- func Loop[V any](v V) Gen[V]
- func Lt[V constraints.Ordered](xGen Gen[V], yGen Gen[V]) Gen[bool]
- func Mod[V constraints.Integer](xGen Gen[V], yGen Gen[V]) Gen[V]
- func Mul[V Number](xGen Gen[V], yGen Gen[V]) Gen[V]
- func Neq[V comparable](xGen Gen[V], yGen Gen[V]) Gen[bool]
- func Not(gen Gen[bool]) Gen[bool]
- func Or[V bool](xGen Gen[bool], yGen Gen[bool]) Gen[bool]
- func Range[V constraints.Integer](start, stop, step V) Gen[V]
- func Sub[V Number](xGen Gen[V], yGen Gen[V]) Gen[V]
- func Where[V any](gen Gen[V], condGen Gen[bool]) Gen[V]
- type Number
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Gen ¶
Gen is a generator function that generates a new iterator
func Dec ¶
func Dec[V constraints.Integer](v V) Gen[V]
Dec returns a generator of integers decreasing by one from v.
func If ¶
If works as an if-expression for generators.
NOTE: regardless of cond, both then and else are always evaluated
func Inc ¶
func Inc[V constraints.Integer](v V) Gen[V]
Inc returns a generator of integers increasing by one from v.
func Range ¶
func Range[V constraints.Integer](start, stop, step V) Gen[V]
Range returns a generator of integer range.
type Number ¶
type Number interface {
constraints.Integer | constraints.Float
}
Click to show internal directories.
Click to hide internal directories.