On Tue, 12 Sep 1995, Lennart Augustsson wrote:

> The posted semantics for strict constructors, illustrated by this example
> from the Haskell 1.3 post, is to insert seq.
> 
> > data R = R !Int !Int
> > 
> > R x y = seq x (seq y (makeR x y)) -- just to show the semantics of R
> 
> So if we had
> 
>       data Age = Age !Int
>       foo (Age n) = (n, Age (n+1))
> 
> it would translate to
> 
>       foo (MakeAge n) = (n, seq MakeAge (n+1))
> 
> [makeAge is the "real" constructor of Age]

I had assumed (as Simon seems to) that the semantics of pattern matching 
against a strict constructor would accord with the following:

1.      matching a simple pattern involves evaluating the expression being 
        matched to the point that its outermost constructor is known

2.      for strict constructors this must result in the annotated
        constructor argument(s) being evaluated

>From what Lennart says, this is not the intended semantics. So what *is* 
the intended semantics?

Sebastian Hunt



Reply via email to