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) {
3232 return function ( nothing ) {
3333 return function ( xs ) {
3434 return function ( ) {
35- return xs . length ? just ( xs . pop ( ) ) : nothing ;
35+ return xs . length > 0 ? just ( xs . pop ( ) ) : nothing ;
3636 } ;
3737 } ;
3838 } ;
@@ -50,7 +50,7 @@ exports.shiftImpl = function (just) {
5050 return function ( nothing ) {
5151 return function ( xs ) {
5252 return function ( ) {
53- return xs . length ? just ( xs . shift ( ) ) : nothing ;
53+ return xs . length > 0 ? just ( xs . shift ( ) ) : nothing ;
5454 } ;
5555 } ;
5656 } ;
Original file line number Diff line number Diff line change @@ -91,7 +91,12 @@ sort = sortBy compare
9191shift :: forall h a . STArray h a -> ST h (Maybe a )
9292shift = shiftImpl Just Nothing
9393
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 )
95100
96101-- | Sort a mutable array in place using a comparison function.
97102sortBy
@@ -150,7 +155,12 @@ foreign import poke :: forall h a. Int -> a -> STArray h a -> ST h Boolean
150155pop :: forall h a . STArray h a -> ST h (Maybe a )
151156pop = popImpl Just Nothing
152157
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 )
154164
155165-- | Append an element to the end of a mutable array. Returns the new length of
156166-- | the array.
You can’t perform that action at this time.
0 commit comments