andre-dietrich / elm-conditional / Conditional

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

Conditional application

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

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

apply2If : (a -> b -> b) -> Basics.Bool -> a -> b -> b

apply3If : (a -> b -> c -> c) -> Basics.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