Does anyone have an example on how to use <1.1.3> ...
# arrow
p
Does anyone have an example on how to use 1.1.3 context receivers to refactor out Validated and still being able to accumulate errors?
s
Hey @P A, The PR for 2.x.x proposing these changes is still open, we're probably merging it next week 😄 We're planning a release in the next two weeks, and pretty soon after we'll backport these 2.x.x changes to 1.x.x. (Might be early January due to holidays). However, to answer your question. This is the proposed API. https://github.com/arrow-kt/arrow/pull/2795/files#diff-47d18db48a86e0ca0b3da1ea9d184df8534c1dccfaf4736121e9ccaf6bf7f4cdR318 The doc is not complete yet but instead of
Copy code
listOf(1, 2, 3).traverse {
  it.validated()
}
You now write
Copy code
listOf(1, 2, 3).mapOrAccumulate {
  1.right().bind()
  raise("error")
}