Ever wish you could do things like (+ 3 4 5) from LISP, but in Haskell? Wish no more with the beautiful FoldyList datatype! An example instance for Show is given but feel free to write your own, otherwise the code is next to useless.
Subscribe to:
Post Comments (Atom)
I wouldn't call it FoldyCons, as that appears to be confusing. You're not really Cons'ing, so much as applying.
ReplyDeleteMaybe, FoldyBuild?
Hmm... how is FoldyCons (+) [3,4,5] better than just writing foldr1 (+) [3,4,5] in the first place?
ReplyDelete