Skip to content

Commit a88aef8

Browse files
committed
Avoid unnecessary parens in Show instance
1 parent 4b5d194 commit a88aef8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Data/List.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ import Control.MonadPlus (class MonadPlus)
9393
import Control.MonadZero (class MonadZero)
9494
import Control.Plus (class Plus)
9595

96-
import Data.Foldable (class Foldable, foldl, foldr, any)
96+
import Data.Foldable (class Foldable, foldl, foldr, any, intercalate)
9797
import Data.Generic (class Generic)
9898
import Data.Maybe (Maybe(..))
9999
import Data.Monoid (class Monoid, mempty)
@@ -694,7 +694,7 @@ derive instance genericList :: Generic a => Generic (List a)
694694

695695
instance showList :: Show a => Show (List a) where
696696
show Nil = "Nil"
697-
show (x : xs) = "(" <> show x <> " : " <> show xs <> ")"
697+
show xs = "(" <> intercalate " : " (show <$> xs) <> " : Nil)"
698698

699699
instance eqList :: Eq a => Eq (List a) where
700700
eq xs ys = go xs ys true

0 commit comments

Comments
 (0)