towards a more elegant fizzbuzz

This morning I saw this tweet:

As Jan is learning Clojure, he was exploring the fizzbuzz code kata.

I have seen this kata being performed in a lot of languages, and the functional solutions I have seen always feel a bit imperative, so I tried to make a more elegant - functional - version in a language I am currently learning: Haskell; this is the result:

I like it; but what do you think? Please comment.


So, after tweeting about this post, I received this reply:

Which is apparently about this:

So I decided to sacrifice readability, and see how far I could get:

91 Characters! Not bad, but utterly unreadable… So, while it is a good exercise to try to reduce the code to an absolute minimum, this should only be for learning purposes…

comments powered by Disqus