diff options
-rw-r--r-- | libraries/base/Data/List/NonEmpty.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libraries/base/Data/List/NonEmpty.hs b/libraries/base/Data/List/NonEmpty.hs index b4da532b1d..c5f6169024 100644 --- a/libraries/base/Data/List/NonEmpty.hs +++ b/libraries/base/Data/List/NonEmpty.hs @@ -228,6 +228,8 @@ instance Foldable NonEmpty where foldl1 f ~(a :| as) = foldl f a as foldMap f ~(a :| as) = f a `mappend` foldMap f as fold ~(m :| ms) = m `mappend` fold ms + length = length + toList = toList -- | Extract the first element of the stream. head :: NonEmpty a -> a @@ -507,8 +509,8 @@ nubBy eq (a :| as) = a :| List.nubBy eq (List.filter (\b -> not (eq a b)) as) -- > transpose . transpose /= id transpose :: NonEmpty (NonEmpty a) -> NonEmpty (NonEmpty a) transpose = fmap fromList - . fromList . List.transpose . Foldable.toList - . fmap Foldable.toList + . fromList . List.transpose . toList + . fmap toList -- | 'sortBy' for 'NonEmpty', behaves the same as 'Data.List.sortBy' sortBy :: (a -> a -> Ordering) -> NonEmpty a -> NonEmpty a |