"where" block local to a guard?

Dr Mark H Phillips mark@austrics.com.au
18 Sep 2002 11:48:00 +0930


Thanks for the explanation!

On Tue, 2002-09-17 at 19:07, Brian Boutel wrote:
> You can't do this because where clauses are not part of the expression 
> syntax. If they were, expressions like
> 
> 	let a=b in c where d=e
> or
> 	if a then b else c where d=e
> 
> whould be ambiguous, unless you adopt arbitrary rules about the 
> prededences, and such arbitrary rules are considered a bad thing.

I'm trying to see how ambiguity might arise.  Do you mean something
like:

    let a=1 in a+a where a=3

or have you something different in mind?

And I can't yet think of a situation where

    if a then b else c where d=e

would cause problems.

Cheers,

Mark.