At 09:15 97-04-28, Simon L Peyton Jones wrote:
>A proposal
>~~~~~~~~~~~
>The proposal I want to make is simple:
>
> Instead of being a boolean expression,
> a guard is a list of qualifiers,
> exactly as in a list comprehension.
>
> That is, the only syntax change is to replace
> "exp" by "quals" in the syntax of guarded equations.
>
>Here is how I would write clunky:
>
> clunky env var1 var1 | Just val1 <- lookup env var1,
> Just val2 <- lookup env var2
> = val1 + val2
> ...other equations for clunky...
Are you not just asking for another equivalence relation, "patterns
match"? Call it, say, "==="; then you could write
clunky env var1 var1 | Just val1 === lookup env var1 &&
Just val2 === lookup env var2
= val1 + val2
...other equations for clunky...
but also combine with other Boolean expressions.
Hans Aberg
- Re: A new view of guards Brian Boutel
- Re: A new view of guards Frank Christoph
- Re: A new view of guards Tony Davie
- Re: A new view of guards Andrew Moran
- Re: A new view of guards D. tweed
- Re: A new view of guards Greg Michaelson
- Re: A new view of guards Stefan Kahrs
- Re: A new view of guards Simon Marlow
- Re: A new view of guards Tony Davie
- Re: A new view of guards Libor Skarvada
- Re: A new view of guards Hans Aberg
- Re: A new view of guards Alex Ferguson
- Re: A new view of guards Heribert Schuetz
- Re: A new view of guards Alex Ferguson
- Re: A new view of guards Heribert Schuetz
- Re: A new view of guards Philip Wadler
- Re: A new view of guards Alex Ferguson
- Re: A new view of guards Heribert Schuetz
- Re: A new view of guards Ralf Hinze
