FizzBuzzをArrowで
元ネタ:
とにかく書いてみた。もう何番煎じ?
import Control.Arrow fizzbuzz = mapM_ (putStrLn . ((fizz &&& buzz >>> chain) &&& nofb >>> chain)) where fizz x | x `mod` 3 == 0 = "Fizz" | otherwise = "" buzz x | x `mod` 5 == 0 = "Buzz" | otherwise = "" nofb x | x `mod` 3 == 0 = "" | x `mod` 5 == 0 = "" | otherwise = show x chain = uncurry(++)