elixir-monad
elixir-monad copied to clipboard
A monadic system for the Elixir language
``` iex(1)> require Monad nil iex(2)> monad ErrorM do ...(2)> a b return a * b ...(2)> end ** (RuntimeError) undefined function: a/0 ```
I believe this is the correct usage? Or am I missing something?
The ErrorM.bind function relies on the assumption that all errors will be of the form {:error, "description"} but unfortunately there are many functions in all sorts of libraries as well...
There are some(many) functions like Elixirs `List.from_char_data` ``` from_char_data(char_data) :: {:ok, char_list} | {:error, [], binary} | {:incomplete, [], binary} ``` In such a case I only really care about...