newtype/datatype (was efficiency)

Lennart Augustsson lennart@augustsson.net
Thu, 17 Jan 2002 21:08:00 +0100


Dylan Thurston wrote:

> If I understand it correctly, this makes
>   \x.undefined :: a -> b
> different from
>   undefined    :: a -> b
> For instance, in this setup, the CPO
>   [()->()]
> has four elements, in a totally ordered CPO; in increasing order, they
> are
>   undefined
>   const undefined
>   id
>   const ()
> Is it really clear the first two ('undefined' and 'const undefined') are
> different?  Ken says they are observationally equivalent.

The two first are different:
seq undefined 0      gives bottom
seq (\ x -> undefined) 0     gives 0
When seq was introduced as a polymorphic function the function space in Haskell
got lifted. :-(
Not that in lambda calculus they are the same; seq is not lambda definable.

    -- Lennart