krisajenkins/elm-exts/12.8.0

NOTE: this package is not compatible with Elm 0.19.1

Exts.Tuple

Extensions for tuples.

indexedPair : (a -> b) -> a -> ( b, a )

Turn a items into a key-value pair.

See also Exts.Dict.indexBy and Exts.Dict.groupBy.

first : (a -> a_) -> ( a, b ) -> ( a_, b )

Update the first component of a pair.

second : (b -> b_) -> ( a, b ) -> ( a, b_ )

Update the second component of a pair.

both : (a -> b) -> ( a, a ) -> ( b, b )

Update both components of a pair.

(***) : (a -> a_) -> (b -> b_) -> ( a, b ) -> ( a_, b_ )

Update the both components of a pair.

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

Generate a pair from a single value and a left & right function.