Version of
maybe with different argument ordering. Often, we
want to case on a
Maybe, do something interesting in the
Just case, but only a default action in the
Nothing
case. Then, the argument ordering of
caseMaybe is preferable.
caseMaybe m err f = flip (maybe err) m f