File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ exports.popImpl = function (just) {
32
32
return function ( nothing ) {
33
33
return function ( xs ) {
34
34
return function ( ) {
35
- return xs . length ? just ( xs . pop ( ) ) : nothing ;
35
+ return xs . length > 0 ? just ( xs . pop ( ) ) : nothing ;
36
36
} ;
37
37
} ;
38
38
} ;
@@ -50,7 +50,7 @@ exports.shiftImpl = function (just) {
50
50
return function ( nothing ) {
51
51
return function ( xs ) {
52
52
return function ( ) {
53
- return xs . length ? just ( xs . shift ( ) ) : nothing ;
53
+ return xs . length > 0 ? just ( xs . shift ( ) ) : nothing ;
54
54
} ;
55
55
} ;
56
56
} ;
Original file line number Diff line number Diff line change @@ -91,7 +91,12 @@ sort = sortBy compare
91
91
shift :: forall h a . STArray h a -> ST h (Maybe a )
92
92
shift = shiftImpl Just Nothing
93
93
94
- foreign import shiftImpl :: forall h a . (a -> Maybe a ) -> Maybe a -> STArray h a -> ST h (Maybe a )
94
+ foreign import shiftImpl
95
+ :: forall h a
96
+ . (forall b . b -> Maybe b )
97
+ -> (forall b . Maybe b )
98
+ -> STArray h a
99
+ -> ST h (Maybe a )
95
100
96
101
-- | Sort a mutable array in place using a comparison function.
97
102
sortBy
@@ -150,7 +155,12 @@ foreign import poke :: forall h a. Int -> a -> STArray h a -> ST h Boolean
150
155
pop :: forall h a . STArray h a -> ST h (Maybe a )
151
156
pop = popImpl Just Nothing
152
157
153
- foreign import popImpl :: forall h a . (a -> Maybe a ) -> Maybe a -> STArray h a -> ST h (Maybe a )
158
+ foreign import popImpl
159
+ :: forall h a
160
+ . (forall b . b -> Maybe b )
161
+ -> (forall b . Maybe b )
162
+ -> STArray h a
163
+ -> ST h (Maybe a )
154
164
155
165
-- | Append an element to the end of a mutable array. Returns the new length of
156
166
-- | the array.
You can’t perform that action at this time.
0 commit comments