1 (* Copyright (C
) 1999-2006, 2008 Henry Cejtin
, Matthew Fluet
, Suresh
2 * Jagannathan
, and Stephen Weeks
.
4 * MLton is released under a BSD
-style license
.
5 * See the file MLton
-LICENSE for details
.
11 type 'a obj
= {rep
: 'a
, equal
: 'a
* 'a
-> bool}
15 | NonEmpty
of {elts
: 'a list
,
16 equal
: ('a
* 'a
-> bool)}
20 fun singleton
{rep
, equal
} = NonEmpty
{elts
= [rep
], equal
= equal
}
22 fun add(Empty
, re
) = singleton re
23 |
add(NonEmpty
{elts
, equal
}, {rep
, equal
})
26 how
do you make sure that it
's the same equality function??