The monomorphism restriction and monomorphic pattern bindings

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


On Mon, Apr 28, 2008 at 9:42 AM, Simon Marlow <marlowsd at> 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

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


More information about the Haskell-prime mailing list