Skip to content

Latest commit

 

History

History

generic

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Erules Generic

Sbt

  libraryDependencies += "com.github.geirolz" %% "erules-core" % "0.1.0"
  libraryDependencies += "com.github.geirolz" %% "erules-generic" % "0.1.0"

Usage

import cats.Id
import erules.Rule
import erules.PureRule
import erules.RuleVerdict
import erules.generic.implicits.*

case class Person(name: String, age: Int)

Rule.pure[Int]("Check age")
  .const(RuleVerdict.Allow.withoutReasons)
  .contramapTarget[Person](_.age)