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