andre-dietrich / elm-conditional / Conditional.Maybe

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

Common Helpers

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

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

Chaining Maybes

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

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