[Haskell-cafe] generalized list comprehensions

Luke Palmer lrpalmer at gmail.com
Mon Nov 10 13:32:12 EST 2008


Because expressions are treated as guards in list comprehensions.  I.e.:

  [ foo | x <- a, b, y <- c, d ]

Is interpreted as:

  do x <- a
     guard b
     y <- c
     guard d
     return foo

Luke


More information about the Haskell-Cafe mailing list