Comparison of prompt and free monads.
Summary
The prompt monad is a free monad but with a more convenient programming interface in the context of designing EDSLs. It also predates free monads as far as the Haskell community is concerned.
Context
Type names refer to the MonadPrompt
and free
packages on Hackage.
Usage
For Prompt
, one defines an API GADT API r
where each constructor takes the parameters of an API function as arguments, and specifies its result type in r
.