3 (* Copyright Jeremy Yallop 2007.
4 This file is free software, distributed under the MIT license.
5 See the file COPYING for details.
11 val eq
: a
-> a
-> bool
14 module Defaults
(E
: Eq
) = E
16 module Eq_immutable
(S
: sig type a
end) :
17 Eq
with type a
= S.a
=
23 module Eq_mutable
(S
: sig type a
end) :
24 Eq
with type a
= S.a
=
30 module Eq_int
= Eq_immutable
(struct type a
= int end)
31 module Eq_bool
= Eq_immutable
(struct type a
= bool end)
32 module Eq_float
= Eq_immutable
(struct type a
= float end)
33 module Eq_unit
= Eq_immutable
(struct type a
= unit end)
34 module Eq_char
= Eq_immutable
(struct type a
= char
end)
36 module Eq_string
= Eq_mutable
(struct type a
= string end)
37 module Eq_ref
(E
: Eq
) = Eq_mutable
(struct type a
= E.a
ref end)
38 module Eq_array
(E
: Eq
) = Eq_mutable
(struct type a
= E.a array
end)
40 module Eq_option
(E
: Eq
)
41 : Eq
with type a
= E.a
option =
44 let eq l r
= match l
, r
with
46 | Some l
, Some r
-> E.eq l r
50 module Eq_map_s_t
(E
: Eq
) (M
: Map.S
)
51 : Eq
with type a
= E.a
M.t
=
54 let eq = M.equal
(E.eq)
57 module Eq_list
(E
: Eq
) :
58 Eq
with type a
= E.a list
=
61 let rec eq l r
= match l
, r
with
63 | (lfst
::lrst
), (rfst
::rrst
) when E.eq lfst rfst
-> eq lrst rrst
68 : Eq
with type a
= Num.num
=