convert

package
v0.0.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2024 License: MIT Imports: 2 Imported by: 2

Documentation

Overview

Package convert provides loop converation helpers

Index

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.Loop[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.Loop[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.Loop[To]

Check - convert.Check is a short alias of loop.ConvertOK

func FromIndexed added in v0.0.8

func FromIndexed[From, To any](len int, next func(int) From, converter func(from From) To) loop.Loop[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.Loop[*To]

NilSafe - convert.NilSafe filters not nil next, converts that ones, filters not nils after converting and returns them

func NotNil

func NotNil[From, To any](next func() (*From, bool), converter func(*From) To) loop.Loop[To]

NotNil - convert.NotNil converts only not nil elements and returns them

func ToNotNil

func ToNotNil[From, To any](next func() (From, bool), converter func(From) *To) loop.Loop[*To]

ToNotNil - convert.ToNotNil converts elements and returns only not nil converted elements

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL