fork download
  1. newtype WithNewlines t a = WithNewlines { unNewLines :: t a }
  2.  
  3. instance (Show a, Foldable t) => Show (WithNewlines t a) where
  4. show = unlines . concatMap (pure . show) . unNewLines
  5.  
  6. main = putStrLn $ show $ WithNewlines
  7. [1
  8. ,2
  9. ,3
  10. ,4
  11. ,5]
Success #stdin #stdout 0s 4364KB
stdin
Standard input is empty
stdout
1
2
3
4
5