This library provides a stack-safe implementation of a freer monad, implemented on to of an efficient type aligned sequence of monadic bind operations. It is based on reflection without remorse, and was inspired by the purescript-free library.
While this library's implementation of a free monad allows
us to build arbitrary monadic computations in a stack
safe manner, we also need the ability to run them in
such a way. For this, we need a base monad with an
implementation of MonadRec
from the
tailrec
library, which is based on the article
Stack Safety for Free
and adapted to a language with a totality checker.
Since Idris2 releases are happening rather infrequently at the moment, it is suggested to use a package manager like pack to install and maintain matching versions of the Idris compiler and this library. Pack will also automatically install all required dependencies.