Foldable for non-Haskellers: Haskell's controversial FTP proposal

In the Haskell world, there is currently a big fuss about the “Foldable/Traversable in Prelude”-proposal. Edit: For the record: it was a proposal, and has been implemented in the current version of Haskell (GHC) As a non-Haskeller, you probably wonder what all the fuss is about. First things first: some context In most languages, you have functions to iterate over a sequence / array / iterable / list, for example in C# (assuming we have an array called values) int[] values = new int[] {1, 2, 3}; foreach(var v in values) { Console.WriteLine(v); } In Haskell, we usually refer to an sequence with a list, and the example code would look like this: values = [1,2,3] mapM_ print values Let’s say we need a function that concatenates several sequences of the type a.

Hangman in Haskell

As I noticed a question for a more idiomatic Haskell version of the game Hangman on codereview.stackoverflow.com, I decided to give it a go; this is the result: Note This article has been posted on Reddit’s Haskell channel, and gradual improvements were made on this article based on tips in the threads, so feel free to check these. Tips Most idiomatic Haskell code I see has a very high signal to noise ratio.