Skip to content

Commit 4a1e948

Browse files
Fix warnings revealed by v0.14.1 PS release (#198)
1 parent 2578dd8 commit 4a1e948

File tree

8 files changed

+13
-12
lines changed

8 files changed

+13
-12
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ New features:
1111
Bugfixes:
1212

1313
Other improvements:
14+
- Fix warnings revealed by v0.14.1 PS release (#198)
1415

1516
## [v6.0.0](https://github.com/purescript/purescript-lists/releases/tag/v6.0.0) - 2021-02-26
1617

src/Data/List.purs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ uncons (x : xs) = Just { head: x, tail: xs }
271271
unsnoc :: forall a. List a -> Maybe { init :: List a, last :: a }
272272
unsnoc lst = (\h -> { init: reverse h.revInit, last: h.last }) <$> go lst Nil
273273
where
274-
go Nil acc = Nothing
274+
go Nil _ = Nothing
275275
go (x : Nil) acc = Just { revInit: acc, last: x }
276276
go (x : xs) acc = go xs (x : acc)
277277

@@ -325,7 +325,7 @@ insertAt _ _ _ = Nothing
325325
-- |
326326
-- | Running time: `O(n)`
327327
deleteAt :: forall a. Int -> List a -> Maybe (List a)
328-
deleteAt 0 (y : ys) = Just ys
328+
deleteAt 0 (_ : ys) = Just ys
329329
deleteAt n (y : ys) = (y : _) <$> deleteAt (n - 1) ys
330330
deleteAt _ _ = Nothing
331331

@@ -547,7 +547,7 @@ takeWhile p = go Nil
547547
drop :: forall a. Int -> List a -> List a
548548
drop n xs | n < 1 = xs
549549
drop _ Nil = Nil
550-
drop n (x : xs) = drop (n - 1) xs
550+
drop n (_ : xs) = drop (n - 1) xs
551551

552552
-- | Drop the specified number of elements from the end of a list.
553553
-- |

src/Data/List/Lazy.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ deleteAt :: forall a. Int -> List a -> List a
348348
deleteAt n xs = List (go n <$> unwrap xs)
349349
where
350350
go _ Nil = Nil
351-
go 0 (Cons y ys) = step ys
351+
go 0 (Cons _ ys) = step ys
352352
go n' (Cons y ys) = Cons y (deleteAt (n' - 1) ys)
353353

354354
-- | Update the element at the specified index, returning a new list,
@@ -523,7 +523,7 @@ drop n = List <<< map (go n) <<< unwrap
523523
where
524524
go 0 xs = xs
525525
go _ Nil = Nil
526-
go n' (Cons x xs) = go (n' - 1) (step xs)
526+
go n' (Cons _ xs) = go (n' - 1) (step xs)
527527

528528
-- | Drop those elements from the front of a list which match a predicate.
529529
-- |

src/Data/List/Lazy/NonEmpty.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ uncons :: forall a. NonEmptyList a -> { head :: a, tail :: L.List a }
7373
uncons (NonEmptyList nel) = case force nel of x :| xs -> { head: x, tail: xs }
7474

7575
length :: forall a. NonEmptyList a -> Int
76-
length (NonEmptyList nel) = case force nel of x :| xs -> 1 + L.length xs
76+
length (NonEmptyList nel) = case force nel of _ :| xs -> 1 + L.length xs
7777

7878
concatMap :: forall a b. (a -> NonEmptyList b) -> NonEmptyList a -> NonEmptyList b
7979
concatMap = flip bind

src/Data/List/Lazy/Types.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ instance extendList :: Extend List where
199199
extend f l =
200200
case step l of
201201
Nil -> nil
202-
Cons a as ->
202+
Cons _ as ->
203203
f l : (foldr go { val: nil, acc: nil } as).val
204204
where
205205
go a { val, acc } =

src/Data/List/NonEmpty.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ unsnoc (NonEmptyList (x :| xs)) = case L.unsnoc xs of
167167
Just un -> { init: x : un.init, last: un.last }
168168

169169
length :: forall a. NonEmptyList a -> Int
170-
length (NonEmptyList (x :| xs)) = 1 + L.length xs
170+
length (NonEmptyList (_ :| xs)) = 1 + L.length xs
171171

172172
index :: forall a. NonEmptyList a -> Int -> Maybe a
173173
index (NonEmptyList (x :| xs)) i

src/Data/List/Partial.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ last (Cons _ xs) = last xs
2626
-- |
2727
-- | Running time: `O(n)`
2828
init :: forall a. Partial => List a -> List a
29-
init (Cons x Nil) = Nil
29+
init (Cons _ Nil) = Nil
3030
init (Cons x xs) = Cons x (init xs)

src/Data/List/Types.purs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ listMap :: forall a b. (a -> b) -> List a -> List b
8282
listMap f = chunkedRevMap Nil
8383
where
8484
chunkedRevMap :: List (List a) -> List a -> List b
85-
chunkedRevMap chunksAcc chunk@(x1 : x2 : x3 : xs) =
85+
chunkedRevMap chunksAcc chunk@(_ : _ : _ : xs) =
8686
chunkedRevMap (chunk : chunksAcc) xs
8787
chunkedRevMap chunksAcc xs =
8888
reverseUnrolledMap chunksAcc $ unrolledMap xs
@@ -181,8 +181,8 @@ instance monadZeroList :: MonadZero List
181181
instance monadPlusList :: MonadPlus List
182182

183183
instance extendList :: Extend List where
184-
extend f Nil = Nil
185-
extend f l@(a : as) =
184+
extend _ Nil = Nil
185+
extend f l@(_ : as) =
186186
f l : (foldr go { val: Nil, acc: Nil } as).val
187187
where
188188
go a' { val, acc } =

0 commit comments

Comments
 (0)