I know this part has been left incomplete when Stephen got a real job, but I have a question.
In http://dev.stephendiehl.com/fun/007_path.html, compiler steps are piped together using the Kleisli (>=>) operator, presumably the one from Control.Monad.

they also return some flavour of AST (typically Syn.Module or Core.Module). Assuming that the >=> is the one from Control.Monad, what is the purpose of this returned value (all the steps are in a compilerMonad and presumably would have to update the state w/ the new AST anyhow)?

Or is the intention to have a special >=> that also updates the state (but I wouldn't know how to deal w/ Syn.Core vs Core.Module)

I would understand some form of phantom type to ensure that compilation steps are in the right order, but as it is I'm puzzled.

Anybody has some insight?

Thanks,

  Maurizio