Add a function to create a Decoder from an Error value
Suggestion: Add a function (perhaps called error) that is like fail, except it receives an Error value instead of a String as its argument.
This would be useful in functions that have to call decodeValue inside an andThen continuation.
Here's an example of a case where such a function would be nice (I defined a sub-optimal version of error so it would compile):
https://ellie-app.com/bgcTCxqmSKWa1
Given that the Error type constructors are already exposed from this module, I don't see a good reason not to allow this sort of thing, but maybe there's a downside to this that I haven't considered.
I don't see the downside either. To me it seems it would simply allow nicer error propagation. However, even if this does not become part of the public API (I see no reason against it) there could be benefits even within the module.