strictness question

Marcin 'Qrczak' Kowalczyk
2 Mar 2001 18:58:16 GMT

Thu, 1 Mar 2001 12:25:33 +0100, S. Doaitse Swierstra <> pisze:

> From the Haskell manual I understand that pattern matching in "let"'s 
> should be done lazily, so the addition of a collection of ~'s should 
> not make a difference.

Toplevel ~ in let doesn't change anything. But nested ~'s do make
a difference. When a variable of a pattern is evaluated, the whole
pattern is matched. When you protect a subpattern by ~ deferring its
matching and a variable from the subpattern is evaluated, again the
whole subpattern is matched, unless its subsubpatterns are protected
with their own ~'s etc.

 __("<  Marcin Kowalczyk *
  ^^                      SYGNATURA ZASTĘPCZA