Permalink
Fetching contributors…
Cannot retrieve contributors at this time
52 lines (39 sloc) 1.97 KB

New features

  • Add the validate method to companions of refined types to accumulate errors with cats.data.ValidatedNel. To use this method, syntax._ from the refined-cats module needs to be imported like this:
    scala> import eu.timepit.refined.types.numeric.PosInt
    scala> import eu.timepit.refined.cats.syntax._
    
    scala> PosInt.validate(1)
    res0: cats.data.ValidatedNel[String,PosInt] = Valid(1)
    Thanks to Howy Perrin! (#382, #384)
  • Add the validate method using scalaz.ValidationNel also to the refined-scalaz module. Thanks to kusamakura! (#385)

New predicates

string

  • ValidInt: checks if a String is a parsable Int
  • ValidLong: checks if a String is a parsable Long
  • ValidDouble: checks if a String is a parsable Double
  • ValidBigInt: checks if a String is a parsable BigInt
  • ValidBigDecimal: checks if a String is a parsable BigDecimal

Thanks to kusamakura! (#379)

Performance improvements

  • Apply the optimization done in #334 also to macro calls that use RefineMacro.implApplyRef. Before this change, compilation time of e.g. PosInt(1) was one order of magnitude slower than 1: PosInt. With this change there is no difference in compilation times between  these two calls. (#388)

Updates

  • Update refined-cats to Cats 1.0.0. (#390)

Released on 2017-12-27