newtype WithNewlines t a = WithNewlines { unNewLines :: t a } instance (Show a, Foldable t) => Show (WithNewlines t a) where show = unlines . concatMap (pure . show) . unNewLines main = putStrLn $ show $ WithNewlines [1 ,2 ,3 ,4 ,5]