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

John Lato jwlato at gmail.com
Sun Oct 13 03:15:47 UTC 2013

This type is what I would like (and is the proper generalization of the
proposed function), but I don't know if it's feasible. It might fit into
Alternative, but it may need a separate class. I don't see how it could be
written as a standalone function without extra support.  So I suggested a
"next best thing. "

As to flooding, I thought this was germane to the proposal, and I do
apologize if others disagree. I just don't think ?. is useful or general
enough to deserve a place in base.
On Oct 12, 2013 4:20 PM, "Niklas Hambüchen" <mail at nh2.me> wrote:

> 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.
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20131012/e08cb6fd/attachment-0001.html>

More information about the Libraries mailing list