[Haskell-cafe] Is this a GHC parser error? A test case compiles from one line but not another.

Alexis King lexi.lambda at gmail.com
Sun Sep 10 04:54:19 UTC 2017

> On Sep 9, 2017, at 18:14, David Feuer <david.feuer at gmail.com> wrote:
> Where clauses are not *always* attached to definitions. They can also
> be attached to case branches.

Ah, you’re right of course, I forgot about this.

> What I believe is true is that anywhere a set of guards could occur,
> they may be followed by a where clause, and vice versa.

This appears to be true in standard Haskell, but interestingly, it seems
that where clauses *cannot* be attached to a multi-way if expression.
Whether or not that counts as a “set of guards” is debatable, but I
usually think of them that way, so it’s potentially worth nothing.

More information about the Haskell-Cafe mailing list