Reputation: 8281
Is there an existing combinator in scalaz or a better way ?
def leftMapNel[E, EE, A](v: ValidationNel[E, A])(f: E => EE) : ValidationNel[EE, A] =
v.leftMap(_.map(f))
Upvotes: 1
Views: 381
Reputation: 53859
No.
ValidationNel[E, A]
is just a shorthand for Validation[NonEmptyList[E], A]
(as you can see in the code) and it does not provide any specific function to handle the NonEmptyList
.
Upvotes: 2