
7 Apr
2017
7 Apr
'17
8:41 a.m.
For another the same can be achieved with free monads in a more transparent and flexible manner:
import Control.Monad.Free.Class
data PromptF a b x = PromptF (b -> x) a deriving (Functor)
More accurately,
data PromptF' p x = forall a. PromptF (a -> x) (p a)
(with the obvious Functor instance).
Are we talking about the same PromptT here? I was assuming this one: https://hackage.haskell.org/package/prompt-0.1.1.2/docs/Control-Monad-Prompt.... Even if not, it seems to me that it should be an abstraction layer above free monads. It could be a very thin layer around F/FT. That would facilitate reuse. Greets ertes