[Haskell-cafe] Existentials and type var escaping

David House dmhouse at gmail.com
Thu May 31 17:55:28 EDT 2007


On 31/05/07, Isaac Dupree <isaacdupree at charter.net> wrote:
> foo undefined = undefined

That's not true. When you evaluate foo undefined, it matches the first
(irrefutable) pattern immediately, without any deconstruction of the
undefined argument (which is the entire point of it being a lazy
pattern). So it becomes the right hand side, C <thunk>. Only when you
force that <thunk> would you have to force the undefined argument, so
foo undefined = C undefined:

*Main> foo undefined
C *** Exception: Prelude.undefined

-- 
-David House, dmhouse at gmail.com


More information about the Haskell-Cafe mailing list