[Haskell-cafe] pointer equality

Pedro Vasconcelos pbv at dcc.fc.up.pt
Thu Jul 21 10:30:21 CEST 2011


On Wed, 20 Jul 2011 12:48:48 -0300
Thiago Negri <evohunz at gmail.com> wrote:


> Is it possible to implement (==) that first check these thunks before
> evaluating it? (Considering both arguments has pure types).
> 
> 
> E.g.,
> 
> Equivalent thunks, evaluates to True, does not need to evaluate its
> arguments: [1..] == [1..]
> 
> 

Thunks are just expressions and equality of expressions is undecidable
in any Turing-complete language (like any general-purpose programming
language). Note that syntactical equality is not sufficient because
(==) should be referentially transparent.

Pedro



More information about the Haskell-Cafe mailing list