All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sazabi.bijections.scalaz.Disjunction.scala Maven / Gradle / Ivy

The newest version!
package org.sazabi.bijections.scalaz

import scala.util.{ Failure, Success }

import com.twitter.bijection.Injection
import _root_.scalaz.\/

object Disjunction {
  def injection[A, B](to: A => B)(from: B => Throwable \/ A): Injection[A, B] =
    Injection.build[A, B](to)(from(_).fold(Failure.apply, Success.apply))
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy