Fizz Buzz Through Monoids

Some decade ago I read a good implementation of fizzbuzz. What set it apart was its excellent modularity. The original article is no longer on the web, but this is my reconstruction:

In[1]:

The great thing about this implementation is that when we get the natural change in requirements – that we are supposed to print “zork” for multiples of seven – we can accommodate that change by simply adding the line that does so:

(Continue reading the full article on the web.)

添加评论
点赞收藏
点踩分享查看原文
评论
?
参与讨论