Skip to content

Commit db7972f

Browse files
authored
Merge pull request #101 from matthewleon/squiggle-arrow
style: even more usage of ~>
2 parents ec91584 + 04de80b commit db7972f

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/Data/List.purs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,14 +220,14 @@ insertBy cmp x ys@(y : ys') =
220220
-- | Get the first element in a list, or `Nothing` if the list is empty.
221221
-- |
222222
-- | Running time: `O(1)`.
223-
head :: forall a. List a -> Maybe a
223+
head :: List ~> Maybe
224224
head Nil = Nothing
225225
head (x : _) = Just x
226226

227227
-- | Get the last element in a list, or `Nothing` if the list is empty.
228228
-- |
229229
-- | Running time: `O(n)`.
230-
last :: forall a. List a -> Maybe a
230+
last :: List ~> Maybe
231231
last (x : Nil) = Just x
232232
last (_ : xs) = last xs
233233
last _ = Nothing
@@ -355,7 +355,7 @@ alterAt _ _ _ = Nothing
355355
-- | Reverse a list.
356356
-- |
357357
-- | Running time: `O(n)`
358-
reverse :: forall a. List a -> List a
358+
reverse :: List ~> List
359359
reverse = go Nil
360360
where
361361
go acc Nil = acc
@@ -476,7 +476,7 @@ sortBy cmp = mergeAll <<< sequences
476476
--------------------------------------------------------------------------------
477477

478478
-- | 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
480480
slice start end xs = take (end - start) (drop start xs)
481481

482482
-- | Take the specified number of elements from the front of a list.

src/Data/List/Lazy.purs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,13 +224,13 @@ insertBy cmp x xs = List (go <$> unwrap xs)
224224
-- | Get the first element in a list, or `Nothing` if the list is empty.
225225
-- |
226226
-- | Running time: `O(1)`.
227-
head :: forall a. List a -> Maybe a
227+
head :: List ~> Maybe
228228
head xs = _.head <$> uncons xs
229229

230230
-- | Get the last element in a list, or `Nothing` if the list is empty.
231231
-- |
232232
-- | Running time: `O(n)`.
233-
last :: forall a. List a -> Maybe a
233+
last :: List ~> Maybe
234234
last = go <<< step
235235
where
236236
go (Cons x xs)
@@ -382,7 +382,7 @@ alterAt n f xs = List (go n <$> unwrap xs)
382382
-- | Reverse a list.
383383
-- |
384384
-- | Running time: `O(n)`
385-
reverse :: forall a. List a -> List a
385+
reverse :: List ~> List
386386
reverse xs = Z.defer \_ -> foldl (flip cons) nil xs
387387

388388
-- | Flatten a list of lists.
@@ -454,7 +454,7 @@ catMaybes = mapMaybe id
454454
--------------------------------------------------------------------------------
455455

456456
-- | 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
458458
slice start end xs = take (end - start) (drop start xs)
459459

460460
-- | Take the specified number of elements from the front of a list.

0 commit comments

Comments
 (0)