[Haskell-cafe] bottom/unconditionally false in Haskell

Galaxy Being borgauf at gmail.com
Mon May 31 16:39:39 UTC 2021


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20210531/bc4df8e2/attachment.html>


More information about the Haskell-Cafe mailing list