In Scheme, the primitive eq?
tests whether its arguments are the same object. For example, in the following list
(define lst
(let (x (list \'a
It is not possible in Haskell, the pure language.
But in its implementation in GHC, there are loopholes, such as
In any case, using this in regular code would be very unidiomatic; at most I could imagine that building a highly specialized library for something (memoizatoin, hash tables, whatever) that then provides a sane, pure API, might be acceptable.