[Haskell-cafe] How is laziness defined?

Matthew Brecknell haskell at brecknell.org
Tue Feb 6 01:04:15 EST 2007


I said:
> Although it covers irrefutable (lazy) pattern matching in the second
> section, it does appear to miss the point that let bindings are always
> irrefutable.
>
> Thus, there is no difference between these two:
>
> let (x,y) = foo in ...
> let ~(x,y) = foo in ...

Andrew Bromage said:
> let (x,()) = (1,undefined) in x
> let (x,~()) = (1,undefined) in x

In other words, the irrefutability of a pattern match does not
distribute inside the top-level data constructor of the pattern. See
also the second rule in section 3.17.2 of the Revised Haskell 98 Report
(Informal Semantics of Pattern Matching).



More information about the Haskell-Cafe mailing list