I've looked at the pattern matching semantics as defined in the
Haskell 98 report and there is few things I don't understand.
1) In Figure 3 (Semantics of Case Expressions, Part 1) clause c reads:
case v of { p | g1 -> e1 ; ...
| gn -> en where { decls }
_ -> e' }
= case e' of
{ y -> -- (where y is a completely new variable)
case v of {
p -> let { decls } in
if g1 then e1 ... else if gn then en else y
_ -> y }}
My question is this: doesn't this mean that e' all of a sudden
becomes strict, ie. that
case v of { p | g1 -> e1 ; ...
| gn -> en where { decls }
_ -> _|_ }
= _|_
??? Why is it defined like this.
2) In the following clause (d) it is required that x1',...,xn' be
completely new variables. Why? It seems to me that reusing
x1,..,xn works just fine. Is there an alpha conversion requirement
that I missed?
Thanks,
Tommy