We use Hoopl (http://hackage.haskell.org/package/hoopl) as a show case on how to use advanced language features such as generalized algebraic data types (http://en.wikibooks.org/wiki/Haskell/GADT), type families (http://www.haskell.org/haskellwiki/GHC/Type_families) and monad transformers (http://en.wikibooks.org/wiki/Haskell/Monad_transformers) to design good APIs.
Hoopl is a framework for data flow analysis and transformation of control flow graphs. It is used in the code generator back-end of GHC. The API manages to hide the complexity of Lerner-Groove-Chambers (http://dl.acm.org/citation.cfm?id=503298)' interleaved analysis and transformation while supporting used-defined AST (http://en.wikipedia.org/wiki/Abstract_syntax_tree) data types.
While we focus on Haskell language features as opposed to compiler construction, we will learn how to implement a liveness analysis (http://en.wikipedia.org/wiki/Liveness_analysis) as a running example.
Hoopl: A Modular, Reusable Library for Dataflow Analysis and Transformation (http://www.cs.tufts.edu/%7Enr/pubs/hoopl-abstract.html) (Ramsey, Dias, Peyton Jones) Hoopl guided tour (http://blog.ezyang.com/2011/04/hoopl-guided-tour-base-system/) (Edward Z. Yang)