File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -220,14 +220,14 @@ insertBy cmp x ys@(y : ys') =
220
220
-- | Get the first element in a list, or `Nothing` if the list is empty.
221
221
-- |
222
222
-- | Running time: `O(1)`.
223
- head :: forall a . List a - > Maybe a
223
+ head :: List ~ > Maybe
224
224
head Nil = Nothing
225
225
head (x : _) = Just x
226
226
227
227
-- | Get the last element in a list, or `Nothing` if the list is empty.
228
228
-- |
229
229
-- | Running time: `O(n)`.
230
- last :: forall a . List a - > Maybe a
230
+ last :: List ~ > Maybe
231
231
last (x : Nil ) = Just x
232
232
last (_ : xs) = last xs
233
233
last _ = Nothing
@@ -355,7 +355,7 @@ alterAt _ _ _ = Nothing
355
355
-- | Reverse a list.
356
356
-- |
357
357
-- | Running time: `O(n)`
358
- reverse :: forall a . List a - > List a
358
+ reverse :: List ~ > List
359
359
reverse = go Nil
360
360
where
361
361
go acc Nil = acc
@@ -476,7 +476,7 @@ sortBy cmp = mergeAll <<< sequences
476
476
-- ------------------------------------------------------------------------------
477
477
478
478
-- | Extract a sublist by a start and end index.
479
- slice :: forall a . Int -> Int -> List a - > List a
479
+ slice :: Int -> Int -> List ~ > List
480
480
slice start end xs = take (end - start) (drop start xs)
481
481
482
482
-- | Take the specified number of elements from the front of a list.
Original file line number Diff line number Diff line change @@ -224,13 +224,13 @@ insertBy cmp x xs = List (go <$> unwrap xs)
224
224
-- | Get the first element in a list, or `Nothing` if the list is empty.
225
225
-- |
226
226
-- | Running time: `O(1)`.
227
- head :: forall a . List a - > Maybe a
227
+ head :: List ~ > Maybe
228
228
head xs = _.head <$> uncons xs
229
229
230
230
-- | Get the last element in a list, or `Nothing` if the list is empty.
231
231
-- |
232
232
-- | Running time: `O(n)`.
233
- last :: forall a . List a - > Maybe a
233
+ last :: List ~ > Maybe
234
234
last = go <<< step
235
235
where
236
236
go (Cons x xs)
@@ -382,7 +382,7 @@ alterAt n f xs = List (go n <$> unwrap xs)
382
382
-- | Reverse a list.
383
383
-- |
384
384
-- | Running time: `O(n)`
385
- reverse :: forall a . List a - > List a
385
+ reverse :: List ~ > List
386
386
reverse xs = Z .defer \_ -> foldl (flip cons) nil xs
387
387
388
388
-- | Flatten a list of lists.
@@ -454,7 +454,7 @@ catMaybes = mapMaybe id
454
454
-- ------------------------------------------------------------------------------
455
455
456
456
-- | Extract a sublist by a start and end index.
457
- slice :: forall a . Int -> Int -> List a - > List a
457
+ slice :: Int -> Int -> List ~ > List
458
458
slice start end xs = take (end - start) (drop start xs)
459
459
460
460
-- | Take the specified number of elements from the front of a list.
You can’t perform that action at this time.
0 commit comments