"Elvis" operator (?:) as a reverse infix form of "fromMaybe"

Niklas Hambüchen mail at nh2.me
Sat Oct 12 21:19:59 UTC 2013


Yes, I understand

   |> :: Alternative f => f a -> a -> a

as what you are asking for, for an Alternative that can default to
something.

Back to your suggestion, I personally find a written-out `fromMaybe`
nicer syntax, especially because it fits well into the naming of the
other `from...` functions, and the fact that the value comes from a
maybe suggests to me that I have to give a defaul there.


More information about the Libraries mailing list