Some basic utilities that don't belong anywhere else.
ifNothing : Maybe a -> b -> Maybe b
Look for Nothing
, using some other value to show you found it.
This comes in handy when you want to e.g. react to an absent field by raising an error, but don't need to do anything when the field is present.
nothingAs : b -> Maybe a -> Maybe b
Same as ifNothing
, but with the argument order reversed.