Is there a sequence function for Try objects in scalaz?

Scalaz has a sequencing function that converts List [Option [A]] to Option [List [A]]. Is there something similar for Try that converts List [Try [A]] to Try [List [A]]?

+3
scala scalaz


source to share


1 answer


You can use the same function sequence

if you have Try monad from scalaz-outlaws in scope.



(As explained in the comments, this code violates the linking laws of the functor and therefore may lead to unexpected behavior when used with some functions. It should be fine for your use case though)

+6


source to share







All Articles
Loading...
X
Show
Funny
Dev
Pics