File tree 2 files changed +13
-20
lines changed
2 files changed +13
-20
lines changed Original file line number Diff line number Diff line change @@ -49,8 +49,7 @@ module MakeComparableU (M : sig
49
49
end ) =
50
50
struct
51
51
type identity
52
- type t = M .t
53
- let cmp = M. cmp
52
+ include M
54
53
end
55
54
56
55
module MakeComparable (M : sig
@@ -69,11 +68,11 @@ let comparableU
69
68
(type key )
70
69
~cmp
71
70
=
72
- let module N = MakeComparableU (struct
71
+ ( module MakeComparableU (struct
73
72
type t = key
74
73
let cmp = cmp
75
- end ) in
76
- ( module N : Comparable with type t = key )
74
+ end )
75
+ : Comparable with type t = key)
77
76
78
77
let comparable
79
78
(type key )
@@ -101,9 +100,7 @@ module MakeHashableU (M : sig
101
100
end ) =
102
101
struct
103
102
type identity
104
- type t = M .t
105
- let hash = M. hash
106
- let eq = M. eq
103
+ include M
107
104
end
108
105
109
106
module MakeHashable (M : sig
@@ -121,12 +118,11 @@ struct
121
118
end
122
119
123
120
let hashableU (type key ) ~hash ~eq =
124
- let module N = MakeHashableU (struct
125
- type t = key
126
- let hash = hash
127
- let eq = eq
128
- end ) in
129
- (module N : Hashable with type t = key )
121
+ (module MakeHashableU (struct
122
+ type t = key
123
+ let hash = hash
124
+ let eq = eq
125
+ end ) : Hashable with type t = key)
130
126
131
127
let hashable (type key ) ~hash ~eq =
132
128
let module N = MakeHashable (struct
Original file line number Diff line number Diff line change 3
3
var Curry = require ( "./curry.js" ) ;
4
4
5
5
function MakeComparableU ( M ) {
6
- var cmp = M [ /* cmp */ 0 ] ;
7
- return /* module */ [ /* cmp */ cmp ] ;
6
+ return /* module */ [ /* cmp */ M [ 0 ] ] ;
8
7
}
9
8
10
9
function MakeComparable ( M ) {
@@ -23,11 +22,9 @@ function comparable(cmp) {
23
22
}
24
23
25
24
function MakeHashableU ( M ) {
26
- var hash = M [ /* hash */ 0 ] ;
27
- var eq = M [ /* eq */ 1 ] ;
28
25
return /* module */ [
29
- /* hash */ hash ,
30
- /* eq */ eq
26
+ /* hash */ M [ 0 ] ,
27
+ /* eq */ M [ 1 ]
31
28
] ;
32
29
}
33
30
You can’t perform that action at this time.
0 commit comments