RosettaCodeData/Task/Catamorphism/Haskell/catamorphism-1.hs

9 lines
182 B
Haskell
Raw Permalink Normal View History

2017-09-23 10:01:46 +02:00
main :: IO ()
main =
putStrLn . unlines $
[ show . foldr (+) 0 -- sum
, show . foldr (*) 1 -- product
, foldr ((++) . show) "" -- concatenation
] <*>
[[1 .. 10]]