On 9/19/07, Peter Verswyvelen <[EMAIL PROTECTED]> wrote:
>  Now why isn't pattern matching lazy by default?  This seems odd for a
> newbie since everything else is lazy by default.

AFAIK, pattern matches are desugared to cases, so

f (x:xs) = rhs
f []     = rhs'

is equivalent to

f y = case y of
    (x:xs) -> rhs
    []     -> rhs'

Case's have to be strict because that's how we look inside the values
in Haskell =). Of course I may be somehow mistaken here, as I am
learning Haskell, too.

-- 
Felipe.
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to