[Haskell-cafe] The where-clause and guards

Eitan Goldshtrom thesourceofx at gmail.com
Wed Jul 21 03:01:34 EDT 2010


I'm trying to fit a where clause to some guards I'm using. I have the 
following

f a b
   | c > 1      = ...
   | c < 1      = ...
   | otherwise  = ...
   where c = a+b

yet I'm getting a parsing error. Is this not the correct way to combine 
"where" with "guards"?

-Eitan


More information about the Haskell-Cafe mailing list