Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type Va[A] = Validation[String, A]
- type VaNel[A] = ValidationNel[String, A]
- implicit val vaBind = new Bind[Va] {
- def map[A, B](fa: Va[A])(f: A => B): Va[B] = fa.map(f)
- def bind[A, B](fa: Va[A])(f: A => Va[B]): Va[B] =
- fa.flatMap(f)
- }
- implicit val vaNelBind = new Bind[VaNel] {
- def map[A, B](fa: VaNel[A])(f: A => B): VaNel[B] = fa.map(f)
- def bind[A, B](fa: VaNel[A])(f: A => VaNel[B]): VaNel[B] =
- fa.flatMap(f)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement