[Haskell-cafe] The where-clause and guards
nicolas.wu at gmail.com
Wed Jul 21 03:13:25 EDT 2010
There's nothing wrong with the use of your example, I'm guessing it's
something in your ... that's leading to the parse error. This compiles
f a b
| c > 1 = 1
| c < 1 = 2
| otherwise = 3
where c = a+b
On Wed, Jul 21, 2010 at 8:01 AM, Eitan Goldshtrom
<thesourceofx at gmail.com> wrote:
> I'm trying to fit a where clause to some guards I'm using. I have the
> 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"?
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
More information about the Haskell-Cafe