@@ -256,8 +256,8 @@ init :: forall a. List a -> Maybe (List a)
256256init Nil = Nothing
257257init lst = Just $ reverse $ go lst Nil
258258 where
259- go (Cons x Nil ) acc = acc
260- go (Cons x xs) acc = go xs $ Cons x acc
259+ go (Cons x Nil ) acc = acc
260+ go (Cons x xs) acc = go xs $ Cons x acc
261261
262262-- | Break a list into its first element, and the remaining elements,
263263-- | or `Nothing` if the list is empty.
@@ -570,7 +570,7 @@ groupBy eq (Cons x xs) = case span (eq x) xs of
570570-- |
571571-- | Running time: `O(n^2)`
572572nub :: forall a . (Eq a ) => List a -> List a
573- nub = nubBy (==)
573+ nub = nubBy eq
574574
575575-- | Remove duplicate elements from a list, using the specified
576576-- | function to determine equality of elements.
@@ -652,7 +652,7 @@ zipWith f xs ys = reverse $ go xs ys Nil
652652 where
653653 go Nil _ acc = acc
654654 go _ Nil acc = acc
655- go (Cons a as) (Cons b bs) acc = go as bs $ Cons (f a b) acc
655+ go (Cons a as) (Cons b bs) acc = go as bs $ Cons (f a b) acc
656656
657657-- | A generalization of `zipWith` which accumulates results in some `Applicative`
658658-- | functor.
@@ -690,10 +690,10 @@ instance showList :: (Show a) => Show (List a) where
690690instance eqList :: (Eq a ) => Eq (List a ) where
691691 eq xs ys = go xs ys true
692692 where
693- go _ _ false = false
693+ go _ _ false = false
694694 go Nil Nil acc = acc
695695 go (Cons x xs) (Cons y ys) acc = go xs ys $ acc && (y == x)
696- go _ _ _ = false
696+ go _ _ _ = false
697697
698698
699699instance ordList :: (Ord a ) => Ord (List a ) where
@@ -705,7 +705,7 @@ instance ordList :: (Ord a) => Ord (List a) where
705705 go (Cons x xs) (Cons y ys) =
706706 case compare x y of
707707 EQ -> go xs ys
708- other -> other
708+ other -> other
709709
710710instance semigroupList :: Semigroup (List a ) where
711711 append Nil ys = ys
@@ -718,7 +718,7 @@ instance functorList :: Functor List where
718718 map f lst = reverse $ go lst Nil
719719 where
720720 go Nil acc = acc
721- go (Cons x xs) acc = go xs $ Cons (f x) acc
721+ go (Cons x xs) acc = go xs $ Cons (f x) acc
722722
723723
724724instance foldableList :: Foldable List where
0 commit comments