[Haskell-cafe] How to check object's identity?

Evan Laforge qdunkan at gmail.com
Sun Jan 4 03:55:19 EST 2009

>> So it *looks* like there's only one list created in 'lvl1', but I
>> can't see where it's turning into a tuple, and I don't understand the
>> ' = : ' stuff,
> You're reading it wrong. : is a name.
> It's lvl5 = (:) @ Char a2 ([] @ Char) where @ is type application
> (instantiation).  Triming that, it's
> lvl5 = (:) a2 [] or just lvl5 = a2:[]

Ooohhhh, much clearer, thanks!  The lack of ()s threw me.  I'm still
confused about the apparently undefined 'a2' though.

However, it looks like there's only one [1], defined in lvl1, so I
guess this means ghc has merged the two conses into one variable, and
hence they really do have the same identity?

More information about the Haskell-Cafe mailing list