Two implementations of an old homework assignment in Haskell. The goal was to take a text file (input.txt) by default and output an alphabetized list of every word the appears and the line numbers it appears on.
makeIndex is overly complicated on purpose to practice some of the slightly more advanced type features of Haskell.
makeIndex2 is much simpler, and somewhat faster, as well as more throughly commented.