Open Blond11516 opened 1 year ago
Thinking more about this, monads probably aren't the best idea because Elixir developers aren't really used to the concept.
Errors are rather usually handled through pattern matching, with
and the like. Pattern matching isn't available in javascript, so some more thought will be required to find something that matches the Elixir experience as closely as possible.
You can take a look at the fp.ts
, I used it before, its awesome.
Errors are currently handled through the use of exceptions. Because Elixir is a functional language, I think it would make contributions easier if they were handled in a manner more similar to what elixir developers are used to.
I would suggest using a result monad, since pattern matching on tuples doesn't have great support in Javascript.
Will have to investigate whether to write this monad manually or import a functional programming dependency.