1 (* Copyright Jeremy Yallop 2007.
2 This file is free software, distributed under the MIT license.
3 See the file COPYING for details.
9 val eq
: a
-> a
-> bool
12 module Defaults
(E
: Eq
) = E
14 module Eq_immutable
(S
: sig type a
end) :
15 Eq
with type a
= S.a
=
21 module Eq_mutable
(S
: sig type a
end) :
22 Eq
with type a
= S.a
=
28 module Eq_int
= Eq_immutable
(struct type a
= int end)
29 module Eq_bool
= Eq_immutable
(struct type a
= bool end)
30 module Eq_float
= Eq_immutable
(struct type a
= float end)
31 module Eq_unit
= Eq_immutable
(struct type a
= unit end)
32 module Eq_char
= Eq_immutable
(struct type a
= char
end)
33 module Eq_int32
= Eq_immutable
(struct type a
= int32
end)
34 module Eq_int64
= Eq_immutable
(struct type a
= int64
end)
35 module Eq_nativeint
= Eq_immutable
(struct type a
= nativeint
end)
37 module Eq_string
= Eq_mutable
(struct type a
= string end)
38 module Eq_ref
(E
: Eq
) = Eq_mutable
(struct type a
= E.a
ref end)
39 module Eq_array
(E
: Eq
) = Eq_mutable
(struct type a
= E.a array
end)
41 module Eq_option
(E
: Eq
)
42 : Eq
with type a
= E.a
option =
45 let eq l r
= match l
, r
with
47 | Some l
, Some r
-> E.eq l r
51 module Eq_map_s_t
(E
: Eq
) (M
: Map.S
)
52 : Eq
with type a
= E.a
M.t
=
55 let eq = M.equal
(E.eq)
58 module Eq_list
(E
: Eq
) :
59 Eq
with type a
= E.a list
=
62 let rec eq l r
= match l
, r
with
64 | (lfst
::lrst
), (rfst
::rrst
) when E.eq lfst rfst
-> eq lrst rrst
69 : Eq
with type a
= Num.num
=