Documentation ¶
Overview ¶
Package convert provides loop converation helpers
Index ¶
- func AndConvert[From, I, To any](next func() (From, bool), firsConverter func(From) I, ...) loop.ConvertIter[From, To]
- func AndFilter[From, To any](next func() (From, bool), converter func(From) To, filter func(To) bool) loop.ConvertFitIter[From, To]
- func AndReduce[From, To any](next func() (From, bool), converter func(From) To, merge func(To, To) To) (out To)
- func Check[From, To any](next func() (From, bool), converter func(from From) (To, bool)) loop.ConvertCheckIter[From, To]
- func FromIndexed[From, To any](len int, next func(int) From, converter func(from From) To) loop.ConvertIter[From, To]
- func NilSafe[From, To any](next func() (*From, bool), converter func(*From) *To) loop.ConvertCheckIter[*From, *To]
- func NotNil[From, To any](next func() (*From, bool), converter func(*From) To) loop.ConvertFitIter[*From, To]
- func ToNotNil[From, To any](next func() (From, bool), converter func(From) *To) loop.ConvertCheckIter[From, *To]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AndConvert ¶
func AndConvert[From, I, To any](next func() (From, bool), firsConverter func(From) I, secondConverter func(I) To) loop.ConvertIter[From, To]
AndConvert - convert.AndConvert makes double converts From->Intermediate->To of the elements
func AndFilter ¶
func AndFilter[From, To any](next func() (From, bool), converter func(From) To, filter func(To) bool) loop.ConvertFitIter[From, To]
AndFilter - convert.AndFilter converts only filtered elements and returns them
func AndReduce ¶ added in v0.0.8
func AndReduce[From, To any](next func() (From, bool), converter func(From) To, merge func(To, To) To) (out To)
AndReduce - convert.AndReduce converts elements and merge them into one
func Check ¶
func Check[From, To any](next func() (From, bool), converter func(from From) (To, bool)) loop.ConvertCheckIter[From, To]
Check - convert.Check is a short alias of loop.ConvertCheck
func FromIndexed ¶ added in v0.0.8
func FromIndexed[From, To any](len int, next func(int) From, converter func(from From) To) loop.ConvertIter[From, To]
FromIndexed - convert.FromIndexed retrieves elements from a indexed source and converts them
func NilSafe ¶
func NilSafe[From, To any](next func() (*From, bool), converter func(*From) *To) loop.ConvertCheckIter[*From, *To]
NilSafe - convert.NilSafe filters not nil next, converts that ones, filters not nils after converting and returns them
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.