Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
type of ==
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-04-18 (12:11)
From: Andreas Rossberg <AndreasRossberg@w...>
Subject: Re: [Caml-list] type of ==
Jon Harrop <>:
> If there were an "'a -> 'b -> bool" physical equality test, how could it
> return "true"?

Either when 'a and 'b happen to be instantiated to the same type, or when
the representation happens to be the same, e.g. 0 == false.

The latter also provides a good argument against making physical equality
too polymorphic. It would break abstraction, much worse than it does
already. In particular, a program's meaning could depend on implementation
details (like false being represented by 0) in very questionable ways.


  - Andreas