Created
March 5, 2015 22:37
-
-
Save gszeliga/6694b21b7b39f5599bfb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object SmartBuilderOps | |
{ | |
implicit val applicative = applicativeBuilder[String] | |
implicit def toSmartBuilderOps[E,A,B](s: BuildStep[E,A => B])=new SmartBuilderOps(s) | |
implicit def smartify[E,A,B,C](target: Curryable[A,B,C])(implicit applicative: Applicative[({type f[x] = BuildStep[E, x]})#f]) = toSmartBuilderOps(applicative.unit(target.curried)) | |
implicit def toValidationOps[T](v: T) = new ValidationOps(v) | |
} | |
class ValidationOps[T](v: T){ | |
def failure = Failure(List(v)) | |
def success = Continue(v) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment