Names for Monadic Modalities

I don’t think that these newly defined types make a lot of sense, because it is an extra layer of indirection a newcomer has to get used to when encountering either(x, y) in the return type of a function.

I do think that it would make sense if we somehow standardize the naming for thesee things, however. There are a couple of libraries that work on structures of the shape {:ok, a} | {:error, b} (and the less common {:ok, a} | :error), but there is no real consensus on the naming of these structures.
I think that names like ‘Result Tuple’, ‘OK Tuple’, ‘Error Tuple’, ‘Success Tuple’ are frequently used (by e.g. ok_jose, if_ok, ok, fun_land) but they are not the only ones. I know that exceptional uses ‘tagged status’ to indicate these structures, and maybe there are even others.

For instance, I’m not sure if Witchcraft also defines Maybe/Result monads based on tuples of this specific format, or not.

2 Likes