Library code usually differs from application code: it is often highly
structured, and documented with haddock,
and can be rather optimised. Some instructive examples (syntax
highlighting by hscolour):

An example that illustrates different ways to define recursive data structures. The example defines a simple language (illustrating how to define some recursive structures) and an interpreter for the language (illustrating how to work with the recursive structures).