Last time I donned my mad Haskeller lab coat we ended up using arrows to pipe the output of two functions into a tuple. This time I’m going to look at piping a single input through a list of functions to get a list of output.
The motivation for this experiment was a small section of a code snippet I found in Chris Wilson’s From Ruby to Haskell, Part 2: Similarity, Refactoring, and Patterns post:
As far as I can tell there’s nothing at all wrong with this. It is creating a list of values by passing
e to several functions. It did get me thinking though – do we have to explicitly pass in that
e argument to every function? To the laboratory!