Elixir Witchcraft IO monad?

There has been quite a lengthy discussion in Elixir’s original forum. To summarize:

  • Using witchcraft I would have to create the monad myself, and then use it.
  • Because of the way said Monad would have to be implemented, Dialyzer would not play well.

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.

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.

1 Like