This would be a good idea. It won’t force people to use messy nested case statements because helper functions can be used with pipes:
justIf : (() -> Bool) -> a -> Maybe a -> Maybe a
justIf condition value maybe =
case maybe of
Just a -> Just a
Nothing -> case condition () of
Just a -> Just a
Nothing -> Nothing
Nothing
|> justIf (\_ -> n > 0)
"positive"
|> justIf (\_ -> n < 0)
"negative"
|> Maybe.withDefault
"zero"