
15 Oct
2015
15 Oct
'15
12:55 p.m.
Ian Bloom wrote: I've been hoping to design a domain specific embedded language in Haskell that would let me pipe a commutative monad throughout an expression written in the language. Special terms within the language will eventually have access to this monad.
Is there a reason tagless-final approach does not work for you? You can easily thread any monad, even if you don't make any provision for it initially. For example, http://okmij.org/ftp/tagless-final/index.html#call-by-any http://okmij.org/ftp/tagless-final/course/CBAny.hs uses monad to print out traces of the expression and then later to implement lazy evaluation for EDLS (which needs mutable cells).