Gabriel Gonzalez in his blog post describes a way to purify code using free monads. Let's say we have FreeMonadIO a
, then we can write different interpreters, for example, one for testing purposes and one for actual IO.
I wonder if something similar could be done for Arrows
. Something like FreeArrowIO a b
, which would be a pure representation of a computation with side effects and with an explicit input, which then could be interpreted in different ways (one of them is IO).
I know that I can write something like FreeArrowIO = Kleisli FreeMonadIO
, but is there a way to skip monad step and define FreeArrowIO directly?