Skip to content

Latest commit

 

History

History
24 lines (13 loc) · 1.91 KB

README.md

File metadata and controls

24 lines (13 loc) · 1.91 KB

fizz-buzz

Dissecting the most difficult trivial programming puzzle

The FizzBuzz problem is said to be notoriously trivial, but it is not. Read the following (in the given order) to understand why:

  • FizzBuzz in Haskell by Embedding a Domain-Specific Language (fizzbuzz.pdf) - Originally published in the Monad.Reader magazine 💔. It describes why the problem is actually an instance of a difficult programming pattern that seems to require either code duplication, information-flow vs. control-flow mismatch, or higher-order functions. Of course, we choose the latter.

  • fizzbuzz.c - A C implementation of the solution proposed in the paper above. (Yes, if you look from the right angle, C is a dependently-typed functional language.)

  • fizzbuzz-semigroup.md - If your inner pedant is still not satisfied, let's ditch the empty list.

Ports

The solution from the Monad.Reader paper has been translated to many different languages by a number of programming languages enthusiasts. For example: