File tree Expand file tree Collapse file tree 6 files changed +10
-10
lines changed
Expand file tree Collapse file tree 6 files changed +10
-10
lines changed Original file line number Diff line number Diff 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
114114toUnfoldable = 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
120120fromFoldable = foldr Cons Nil
121121
122122-- ------------------------------------------------------------------------------
Original file line number Diff line number Diff 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
114114toUnfoldable = 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
120120fromFoldable = foldr cons nil
121121
122122fromStep :: forall a . Step a -> List a
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ import Data.NonEmpty ((:|))
2525import Data.Tuple (Tuple (..))
2626import 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
2929toUnfoldable =
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
4242toList (NonEmptyList nel) = case force nel of x :| xs -> x : xs
4343
4444singleton :: forall a . a -> NonEmptyList a
Original file line number Diff line number Diff line change @@ -161,7 +161,7 @@ instance extendList :: Extend List where
161161
162162newtype NonEmptyList a = NonEmptyList (Lazy (NonEmpty List a ))
163163
164- toList :: forall a . NonEmptyList a - > List a
164+ toList :: NonEmptyList ~ > List
165165toList (NonEmptyList nel) = Z .defer \_ ->
166166 case force nel of x :| xs -> x : xs
167167
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ import Data.NonEmpty as NE
2525import Data.Tuple (Tuple (..))
2626import 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
2929toUnfoldable =
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)
3636fromList L.Nil = Nothing
3737fromList (x : xs) = Just (NonEmptyList (x :| xs))
3838
39- toList :: forall a . NonEmptyList a - > L.List a
39+ toList :: NonEmptyList ~ > L.List
4040toList (NonEmptyList (x :| xs)) = x : xs
4141
4242singleton :: forall a . a -> NonEmptyList a
Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ instance extendList :: Extend List where
116116
117117newtype NonEmptyList a = NonEmptyList (NonEmpty List a )
118118
119- toList :: forall a . NonEmptyList a - > List a
119+ toList :: NonEmptyList ~ > List
120120toList (NonEmptyList (x :| xs)) = x : xs
121121
122122derive instance newtypeNonEmptyList :: Newtype (NonEmptyList a ) _
You can’t perform that action at this time.
0 commit comments