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

Günther Schmidt redcom at fedoms.com
Sat Jan 3 10:34:59 EST 2009


Hi Jan,

in functional programming there is no such thing as "identity" as we  
understand the idea from OO.

There is only such as thing as "equality" though.

Günther


Am 03.01.2009, 16:28 Uhr, schrieb Xie Hanjian <jan.h.xie at gmail.com>:

> Hi,
>
> I tried this in ghci:
>> Prelude> 1:2:[] == 1:2:[]
> True
>
> Does this mean (:) return the same object on same input, or
> (==) is not for identity checking? If the later is true, how
> can I check two object is the *same* object?
>
> Thanks
> Jan
>



-- 
Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/mail/



More information about the Haskell-Cafe mailing list