Re:FizzBuzz in Too Much Detail
by jacquesm on Sunday April 26, 2015 @10:59AM
(#9441964)
I'm sure that Haskell can do better than that in the readability department.
[ Parent
| on HN ]
It can, I was just trying to be clever :P
For one, I don't need to drag monads into function composition:
fizzbuzz i triggers = map (\x -> fromMaybe (show x) $
mconcat $ triggers x)
[i..]
fizzbuzz 1 $ \i -> [["Fizz" | i `rem` 3 == 0]
,["Buzz" | i `rem` 5 == 0]
]