File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -458,10 +458,10 @@ groupBy :: forall a. (a -> a -> Boolean) -> Array a -> Array (Array a)
458458groupBy op = go []
459459 where
460460 go :: Array (Array a ) -> Array a -> Array (Array a )
461- go acc [] = reverse acc
462461 go acc xs = case uncons xs of
463- Just o -> let sp = span (op o.head) o.tail
464- in go ((o.head : sp.init) : acc) sp.rest
462+ Just o -> let sp = span (op o.head) o.tail
463+ in go ((o.head : sp.init) : acc) sp.rest
464+ Nothing -> reverse acc
465465
466466-- ------------------------------------------------------------------------------
467467-- Set-like operations ---------------------------------------------------------
@@ -474,9 +474,9 @@ nub = nubBy eq
474474-- | Remove the duplicates from an array, where element equality is determined
475475-- | by the specified equivalence relation, creating a new array.
476476nubBy :: forall a . (a -> a -> Boolean ) -> Array a -> Array a
477- nubBy _ [] = []
478477nubBy eq xs = case uncons xs of
479478 Just o -> o.head : nubBy eq (filter (\y -> not (o.head `eq` y)) o.tail)
479+ Nothing -> []
480480
481481-- | Calculate the union of two lists.
482482-- |
You can’t perform that action at this time.
0 commit comments