[Haskell-cafe] Why isn't pattern matching lazy by default?
Miguel Mitrofanov
miguelimo38 at yandex.ru
Wed Sep 19 11:33:50 EDT 2007
>> Now why isn't pattern matching lazy by default? This seems odd
>> for a newbie since everything else is lazy by default.
>
> It's even more confusing that pattern matching in 'let' _is_ lazy.
No, it's not.
See, in let or where constructs you don't have a choice; you can't do
different things depending on whether some value is Just x or
Nothing. Therefore, there is no need to perform pattern matching
strictly.
More information about the Haskell-Cafe
mailing list