The monomorphism restriction and monomorphic pattern bindings

Iavor Diatchki iavor.diatchki at gmail.com
Mon Apr 28 13:27:54 EDT 2008


Hi,


On Mon, Apr 28, 2008 at 9:42 AM, Simon Marlow <marlowsd at gmail.com> wrote:
>  Ok.  So I counter-propose that we deal with pattern bindings like this:
>
>   The static semantics of a pattern binding are given by the following
>   translation.  A binding 'p = e' has the same meaning as the set of
>   bindings
>
>     z = e
>     x1 = case z of { p -> x1 }
>     ...
>     xn = case z of { p -> xn }
>
>   where z is fresh, and x1..xn are the variables of the pattern p.
>
>  For bang patterns, I think it suffices to say that a bang at the top level
> of p is carried to the binding for z, and then separately define what banged
> variable bindings mean (i.e. add appropriate seqs).
>
>  Does anyone see any problems with this?

Seems good to me.

>  Oh, and I also propose to use the terminology "variable binding" instead of
> "simple pattern binding", which is currently used inconsistently in the
> report (see section 4.4.3.2).

This also makes sense.  Perhaps, we should use "strict variable
binding" instead of "banged variable binding" as well?

-Iavor


More information about the Haskell-prime mailing list