danielnarey/elm-toolkit/6.0.0

NOTE: this package is not compatible with Elm 0.19.1

Toolkit.Function

Apply multiple function to data

apply2 : ( a -> b, a -> c ) -> a -> ( b, c )

Given a tuple containing two functions and a value accepted by both functions, return a tuple containing the two results

apply3 : ( a -> b, a -> c, a -> d ) -> a -> ( b, c, d )

Given a tuple containing three functions and a value accepted by all three functions, return a tuple containing the three results

apply4 : ( a -> b, a -> c, a -> d, a -> e ) -> a -> ( b, c, d, e )

Given a tuple containing four functions and a value accepted by all four functions, return a tuple containing the four results

applyList : List (a -> b) -> a -> List b

Given a list containing any number of functions and a value accepted by every function in the list, return a list containing all of the results. Note that to use applyList, all of the results must be of the same type, which is not the case for the apply functions that return tuples.

Curry and uncurry with more than two arguments

curry3 : (( a, b, c ) -> d) -> a -> b -> c -> d

curry with 3 parameters

curry4 : (( a, b, c, d ) -> e) -> a -> b -> c -> d -> e

curry with 4 parameters

uncurry3 : (a -> b -> c -> d) -> ( a, b, c ) -> d

uncurry with 3 parameters

uncurry4 : (a -> b -> c -> d -> e) -> ( a, b, c, d ) -> e

uncurry with 4 parameters