elixir-monad
elixir-monad copied to clipboard
ErrorM bind error tuples of arbitrary length
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 as Elixir's and Erlang's standard library which do not stick to this pattern but return error tuples which contain more than one additional element.
This commit allows for the error tuple to be of arbitrary length which enables us to use the ErrorM in more places.