File tree 1 file changed +4
-4
lines changed
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)
458
458
groupBy op = go []
459
459
where
460
460
go :: Array (Array a ) -> Array a -> Array (Array a )
461
- go acc [] = reverse acc
462
461
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
465
465
466
466
-- ------------------------------------------------------------------------------
467
467
-- Set-like operations ---------------------------------------------------------
@@ -474,9 +474,9 @@ nub = nubBy eq
474
474
-- | Remove the duplicates from an array, where element equality is determined
475
475
-- | by the specified equivalence relation, creating a new array.
476
476
nubBy :: forall a . (a -> a -> Boolean ) -> Array a -> Array a
477
- nubBy _ [] = []
478
477
nubBy eq xs = case uncons xs of
479
478
Just o -> o.head : nubBy eq (filter (\y -> not (o.head `eq` y)) o.tail)
479
+ Nothing -> []
480
480
481
481
-- | Calculate the union of two lists.
482
482
-- |
You can’t perform that action at this time.
0 commit comments