You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
Suggestion: Add a function (perhaps called
error
) that is likefail
, except it receives anError
value instead of aString
as its argument.This would be useful in functions that have to call
decodeValue
inside anandThen
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.
The text was updated successfully, but these errors were encountered: