convert

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 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.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

func NotNil

func NotNil[From, To any](next func() (*From, bool), converter func(*From) To) loop.ConvertFitIter[*From, 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.ConvertCheckIter[From, *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