[Haskell-cafe] bottom/unconditionally false in Haskell
Brandon Allbery
allbery.b at gmail.com
Mon May 31 16:42:46 UTC 2021
The way it was written (infix), or wrap the operator in parentheses.
On Mon, May 31, 2021 at 12:40 PM Galaxy Being <borgauf at gmail.com> wrote:
> I just ran into this formula
>
> head = foldr (<<) ⊥ where x << y = x
>
> in Bird and Gibbons' *Algorithm Design with Haskell* and I understand
> it's a sort of pseudo-code. Intuitively, I understand that foldr will
> take "bottom" as its "starter seed", but I don't know how to convert the <<
> into Haskell code. This works
>
> myHead = foldr choose1st undefined where choose1st x y = x
>
> but I can't get
>
> myHead2 = foldr (<<) undefined where << x y = x
>
> to work. How do you create a non-alphanumeric operator like <<?
>
> --
> ⨽
> Lawrence Bottorff
> Grand Marais, MN, USA
> borgauf at gmail.com
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.
--
brandon s allbery kf8nh
allbery.b at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20210531/bb6ad3f7/attachment.html>
More information about the Haskell-Cafe
mailing list