[Haskell-cafe] Re: instance Eq (a -> b)

Casey McCann syntaxglitch at gmail.com
Wed Apr 14 14:42:48 EDT 2010

On Wed, Apr 14, 2010 at 2:22 PM, Stefan Monnier
<monnier at iro.umontreal.ca> wrote:
> While we're here, I'd be more interested in a dirty&fast comparison
> operation which could look like:
>    eq :: a -> a -> IO Bool
> where the semantics is "if (eq x y) returns True, then x and y are the
> same object, else they may be different".  Placing it in IO is not great
> since its behavior really depends on the compiler rather than on the
> external world, but at least it would be available.

What about something like System.Mem.StableName? Various pointer types
from the FFI have Eq instances as well and could potentially be
(mis)used to that end.

- C.

More information about the Haskell-Cafe mailing list