The old non-monadic typeOf could not access types defined by the user via typedef since these are only available inside MonadModuleBuilder. The new monadic typeOf works correctly with user defined types, for example, the typeOf a NamedTypeReference is the referent type, not just the name. However, this means that llvm-hs-pretty needs an update to thread the monadic context through the pretty-printing code.