Skip to content

Commit d8ae376

Browse files
committed
Use ~>
1 parent eee2448 commit d8ae376

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

src/Data/List.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,13 @@ import Data.Traversable (scanl, scanr) as Exports
110110
-- | Convert a list into any unfoldable structure.
111111
-- |
112112
-- | Running time: `O(n)`
113-
toUnfoldable :: forall f a. Unfoldable f => List a -> f a
113+
toUnfoldable :: forall f. Unfoldable f => List ~> f
114114
toUnfoldable = unfoldr (\xs -> (\rec -> Tuple rec.head rec.tail) <$> uncons xs)
115115

116116
-- | Construct a list from a foldable structure.
117117
-- |
118118
-- | Running time: `O(n)`
119-
fromFoldable :: forall f a. Foldable f => f a -> List a
119+
fromFoldable :: forall f. Foldable f => f ~> List
120120
fromFoldable = foldr Cons Nil
121121

122122
--------------------------------------------------------------------------------

src/Data/List/Lazy.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,13 @@ import Data.Traversable (scanl, scanr) as Exports
110110
-- | Convert a list into any unfoldable structure.
111111
-- |
112112
-- | Running time: `O(n)`
113-
toUnfoldable :: forall f a. Unfoldable f => List a -> f a
113+
toUnfoldable :: forall f. Unfoldable f => List ~> f
114114
toUnfoldable = unfoldr (\xs -> (\rec -> Tuple rec.head rec.tail) <$> uncons xs)
115115

116116
-- | Construct a list from a foldable structure.
117117
-- |
118118
-- | Running time: `O(n)`
119-
fromFoldable :: forall f a. Foldable f => f a -> List a
119+
fromFoldable :: forall f. Foldable f => f ~> List
120120
fromFoldable = foldr cons nil
121121

122122
fromStep :: forall a. Step a -> List a

src/Data/List/Lazy/NonEmpty.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import Data.NonEmpty ((:|))
2525
import Data.Tuple (Tuple(..))
2626
import Data.Unfoldable (class Unfoldable, unfoldr)
2727

28-
toUnfoldable :: forall f a. Unfoldable f => NonEmptyList a -> f a
28+
toUnfoldable :: forall f. Unfoldable f => NonEmptyList ~> f
2929
toUnfoldable =
3030
unfoldr (\xs -> (\rec -> Tuple rec.head rec.tail) <$> L.uncons xs) <<< toList
3131

@@ -38,7 +38,7 @@ fromList l =
3838
L.Nil -> Nothing
3939
L.Cons x xs -> Just (NonEmptyList (defer \_ -> x :| xs))
4040

41-
toList :: forall a. NonEmptyList a -> L.List a
41+
toList :: NonEmptyList ~> L.List
4242
toList (NonEmptyList nel) = case force nel of x :| xs -> x : xs
4343

4444
singleton :: forall a. a -> NonEmptyList a

src/Data/List/Lazy/Types.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ instance extendList :: Extend List where
161161

162162
newtype NonEmptyList a = NonEmptyList (Lazy (NonEmpty List a))
163163

164-
toList :: forall a. NonEmptyList a -> List a
164+
toList :: NonEmptyList ~> List
165165
toList (NonEmptyList nel) = Z.defer \_ ->
166166
case force nel of x :| xs -> x : xs
167167

src/Data/List/NonEmpty.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import Data.NonEmpty as NE
2525
import Data.Tuple (Tuple(..))
2626
import Data.Unfoldable (class Unfoldable, unfoldr)
2727

28-
toUnfoldable :: forall f a. Unfoldable f => NonEmptyList a -> f a
28+
toUnfoldable :: forall f. Unfoldable f => NonEmptyList ~> f
2929
toUnfoldable =
3030
unfoldr (\xs -> (\rec -> Tuple rec.head rec.tail) <$> L.uncons xs) <<< toList
3131

@@ -36,7 +36,7 @@ fromList :: forall a. L.List a -> Maybe (NonEmptyList a)
3636
fromList L.Nil = Nothing
3737
fromList (x : xs) = Just (NonEmptyList (x :| xs))
3838

39-
toList :: forall a. NonEmptyList a -> L.List a
39+
toList :: NonEmptyList ~> L.List
4040
toList (NonEmptyList (x :| xs)) = x : xs
4141

4242
singleton :: forall a. a -> NonEmptyList a

src/Data/List/Types.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ instance extendList :: Extend List where
116116

117117
newtype NonEmptyList a = NonEmptyList (NonEmpty List a)
118118

119-
toList :: forall a. NonEmptyList a -> List a
119+
toList :: NonEmptyList ~> List
120120
toList (NonEmptyList (x :| xs)) = x : xs
121121

122122
derive instance newtypeNonEmptyList :: Newtype (NonEmptyList a) _

0 commit comments

Comments
 (0)