Version française
Home     About     Download     Resources     Contact us    
Browse thread
Equality of functional values
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Chris King <colanderman@g...>
Subject: Re: [Caml-list] Equality of functional values
Agreed.  Such a comparison is useful for libraries which must work
with arbitrary datatypes but want to compare as finely as possible.  I
once wrote a small pure-O'Caml module to do just that, you
can download it at
http://users.wpi.edu/~squirrel/repos/ocamlrt/fr/fr/genEq.ml.  Caveat
emptor: it does not work on cyclic structures, and uses Obj
extensively so I cannot guarantee it won't crash.  It tries first
physical equality, then structural equality, so it is semantically
different from Caml's = operator in the case of floats.

- Chris

On 1/30/07, Jacques Carette <carette@mcmaster.ca> wrote:
> Serious suggestion:  I personally would be quite happy with extensional
> equality on ground values and intensional equality on function values.
>
> Jacques
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>