[Haskell-cafe] Why isn't pattern matching lazy by default?

Neil Mitchell ndmitchell at gmail.com
Wed Sep 19 06:53:35 EDT 2007


Hi

> >  Now why isn't pattern matching lazy by default?  This seems odd for a
> > newbie since everything else is lazy by default.

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

Now guess what f [] does...

If you use a where binding then pattern matching is lazy.

Thanks

Neil


More information about the Haskell-Cafe mailing list