[Haskell-cafe] Yet another implementation of cond

Jon Cast jcast at ou.edu
Wed Jun 27 18:07:54 EDT 2007


I discovered this trick the other day, and didn't remember seeing it anywhere 
as a cond implementation:

head $
  [ e1 | cond1 ] ++
  [ e2 | cond2 ] ++
  [ e3 | cond3 ]

etc.

You can even use full pattern guards (more powerful than GHC's) in your 
conditions!

Jonathan Cast
http://sourceforge.net/projects/fid-core
http://sourceforge.net/projects/fid-emacs


More information about the Haskell-Cafe mailing list