Comment
Comment by drostie
I'm probably guilty of this, as a guy who is learning Haskell. FizzBuzz can be just
but I think the first time I tried to solve it in Haskell I had something more like:
This is basically thinking about an imperative problem the "wrong way around": starting with the logical distinction between "we're in a special case" and "we're in the normal case" and building everything else around it. (Also, who is ever going to use that Monoid instance? Replace `id` with `concat` and you can just remove `Data.Monoid` altogether -- and if you really wanted it generic, taking an explicit `y -> y -> y` and using `foldl1` would be more flexible anyway.)