andre-dietrich/elm-conditional/1.0.0

Conditional

Base collection for executing functions conditionally or for dealing with Maybe - Types.

Conditional application

applyIf : (a -> a) -> Bool -> a -> a

Apply the passed function only if the second parameter evalutes to True.

apply2If : (a -> b -> b) -> Bool -> a -> b -> b
apply3If : (a -> b -> c -> c) -> Bool -> a -> b -> c -> c

Maybe application

apply2When : (a -> b -> b) -> Maybe a -> b -> b

Apply the passed function only onto a value not equal to Nothing.

apply3When : (a -> b -> c -> c) -> Maybe a -> b -> c -> c