
12 Feb
2007
12 Feb
'07
11:12 a.m.
On 2/12/07, phiroc@free.fr
Hello,
the "Advanced Monads" page in the Haskell Wikibook (http://en.wikibooks.org/wiki/Haskell/Advanced_monads) contains the following example of a List Monad
pythags = do x <- [1..] y <- [x..] z <- [y..] guard (x^2 + y^2 == z^2) return (x, y, z)
However, whenever you load that function definition into Hugs or GHCi, you get a message saying that "guard" is an undefined variable.
Does anyone know why?
Thanks.
phiroc
In the context of the tutorial, guard isn't defined until the next section: additive monads.