I have recently been delving into more functional code. My objective right now is to get something similar to the IO Monad (in Haskell, Scala, etc) but in Elixir.
To this extent, I understand Witchcraft should be in theory capable of doing it.
However, after reading through their documentation I have some questions:
Could someone help me answer these questions?
There has been quite a lengthy discussion in Elixir's original forum. To summarize:
However there is more to be said. The IO Monad (as we know and love) is more of a consequence of how Haskell works. Its main purpose is to get the correct sequence of actions to perform on a language that is lazily evaluated by default.
Elixir, on the other side, is eagerly evaluated by default. Because of this, algebraic effects could potentially make more sense and be more user friendly in comparison to IO Monads.
Last but not least, at the time of this writing, I waited almost 20 days for a human to reply in the Witchcraft's GitHub repository. Unfortunately, no one replied, which leads me to believe the project is in a limbo, receiving minimal support only.
https://github.com/witchcrafters/witchcraft/issues/121
Given the huge effort I would have to undergo to integrate Witchcraft into any of my projects, I personally feel like this would not be a wise decision. It's not a matter of "if I will eventually need help using the library", it is a matter of "when".
The questions are answered, and I hope the additional insight provided can be of use to someone.