Is there a standard way to flatten the left sides into a single list?
thanks!
I'm not exactly sure what you're trying to do, but the Monoid instance should do the trick:
scala> List(
| println("test").successNel[String],
| "a".failNel[Unit],
| "b".failNel[Unit]
| ).suml == Failure(NonEmptyList("a", "b"))
test
res0: Boolean = true
Where suml is a method that's pimped onto any collection full of something with a Monoid instance.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With