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
I just discovered that I can't use and! in result { } and expect my errors to accumulate; I have to use the validation { }. However, I can't find a corresponding async variant. I have an asyncResult computation expression that uses and!, and I want the errors to accumulate. Is that possible, and if not, could you consider implementing it?
If it's at all possible, I think the best course of action would be to accumulate errors when using and! if the error type is 'a list. This includes result { } and other similar CEs. Currently, result { } supports and! (i.e., the code compiles and runs), but there seems to be no difference between and! and successive let!, so it seems rather pointless. If result { } should not support applicative error accumulation, it would be better if and! was not supported at all; that would make it clear to users that they can't rely on applicative behavior, unlike now, where that is easily assumed but is not the case.
The text was updated successfully, but these errors were encountered:
Yeah I considered adding an asyncValidation in the past but it wasn’t something I needed.
I’m not sure how adding it to result would work as it would making dealing with list and non list would be difficult. If there’s no real performance benefits of the and! in result then it makes sense to remove it. Additionally MergeSouces to asyncResult means does async actually run in parallel here too? Don thinks it should be its own CE for various reasons.
I’d accept a PR for an asyncValidation/taskValidation/jobValidation.
Thanks for approving this. Unfortunately I'm swamped both at work and at home right now, so I have no capacity to create a PR for this (which would require me to understand the internals of the validation and asyncResult CEs and "merge" them accordingly, write/adapt lots of tests, etc.)
taskValidation is quite useful and encompasses everything, http/db calls requests, etc.
If anyone wants to take upon this, you can use this as a starting point. This fulfills my current needs but I don't have the capacity to expand this further atm.
I just discovered that I can't use
and!
inresult { }
and expect my errors to accumulate; I have to use thevalidation { }
. However, I can't find a corresponding async variant. I have anasyncResult
computation expression that usesand!
, and I want the errors to accumulate. Is that possible, and if not, could you consider implementing it?If it's at all possible, I think the best course of action would be to accumulate errors when using
and!
if the error type is'a list
. This includesresult { }
and other similar CEs. Currently,result { }
supportsand!
(i.e., the code compiles and runs), but there seems to be no difference betweenand!
and successivelet!
, so it seems rather pointless. Ifresult { }
should not support applicative error accumulation, it would be better ifand!
was not supported at all; that would make it clear to users that they can't rely on applicative behavior, unlike now, where that is easily assumed but is not the case.The text was updated successfully, but these errors were encountered: