Journal entry for


More on the “rewriting definitions” idea. I checked out Template Haskell support for this but unfortunately getting the definition of a function is not currently supported. Implementing this idea would in Haskell require me to implement my own AST for a simpler language.

Otherwise I could implement it as a GHC extension.

It seems to be important to understand the different methods of rewriting expressions into monadic form because they result in call-by-value/call-by-name/call-by-need strategies for effect evaluation. This all seems too low-level for the things I worry about, so maybe I require more constraints on my monads? Commutativity? I’ll have to read the papers to discover more.