<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2003/11/810f9d2fb53a5d64dcf1e65d5252ea26"
  from="Harrison, John R &lt;johnh@i...&gt;"
  author="Harrison, John R"
  date="2003-11-07T14:19:38"
  subject="RE: [Caml-list] Efficient and canonical set representation?"
  prev="2003/11/7ec5b0a474c6574105aed93a0b8e4678"
  next="2003/11/e93bd0cf7e76cd82bbe9874192ba5515"
  prev-thread="2003/11/8bac1133214edc5aaff0c5dae8053b9e"
  next-thread="2003/11/3609cc72597a8a20efdcae335433c69f"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="RE: [Caml-list] Efficient and canonical set representation?">
<msg 
  url="2003/11/810f9d2fb53a5d64dcf1e65d5252ea26"
  from="Harrison, John R &lt;johnh@i...&gt;"
  author="Harrison, John R"
  date="2003-11-07T14:19:38"
  subject="RE: [Caml-list] Efficient and canonical set representation?">
</msg>
</thread>

<contents>
| You basically want O(1) for set equality, I suppose.

Actually, no --- perhaps I should have made clearer what I *really* want.
The efficiency of comparison wasn't my motivation, but rather elegance
and aesthetics. And I meant "canonical" with respect to ordinary
structural equality, not necessarily pointer equality, so the problem is
potentially a bit easier than you might have thought.

I want to be able to treat an abstract type in a truly abstract way,
and not worry about special-purpose equality relations on certain types.
Otherwise it's an ugly mess dealing with complicated nestings like sets
of pairs of lists of sets.

Now, I think the right solution, conceptually speaking, is to allow
user-defined equality on abstract types. But as far as I know this cannot
be done in OCaml, and I've never met much enthusiasm for the idea among
the CAML or SML experts.

So a poor second best is to define abstract types in a canonical way, 
which was the starting-point of my question.

After your remarks and Brian's, I'm starting to wonder if it is possible
at all to do what I want. Maybe I should be looking for an impossibility
proof instead...

John.

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners

</contents>

</message>

