andre-dietrich/elm-conditional/1.0.0

Conditional.Maybe

A collection of conditional functions that can be applied to Maybe types.

Common Helpers

mapIf : Bool -> (a -> a) -> Maybe a -> Maybe a

Apply the mapping function only if the first condition is met.

Chaining Maybes

andThenIf : Bool -> (a -> Maybe a) -> Maybe a -> Maybe a

Apply a "Then" - chaining function only if the first condition is met.