Skip to content

Commit a19f127

Browse files
committed
Merge pull request #48 from purescript/fix-warnings
Fix warnings about partial functions
2 parents 467b7d8 + 6ef25c9 commit a19f127

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Data/Array.purs

+4-4
Original file line numberDiff line numberDiff line change
@@ -458,10 +458,10 @@ groupBy :: forall a. (a -> a -> Boolean) -> Array a -> Array (Array a)
458458
groupBy 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.
476476
nubBy :: forall a. (a -> a -> Boolean) -> Array a -> Array a
477-
nubBy _ [] = []
478477
nubBy 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
-- |

0 commit comments

Comments
 (0)