Yann Moisan
Yann Moisan

Reputation: 8281

leftMap on a ValidationNel

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

Answers (1)

Jean Logeart
Jean Logeart

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

Related Questions