Changes
- Support Scala 2.10. Thanks to Alexandre Archambault! (#51)
- Change all predicates so they can hold values of their parameters,
e.g.trait Greater[N]
is nowcase class Greater[N](n: N)
. This
allows predicates to be represented as values. - Add an ADT
Result[A]
which is eitherPassed
orFailed
that
represents the result of a validation against a type-level predicate.
AResult[A]
contains some value of typeA
which allows to have
arbitrary nested results. - Replace the
Predicate
type class withapi.Validate
.Validate
's
main function isvalidate(t: T): Result[R]
which checks ift
conforms to some type-level predicate.R
is an abstract type member
ofValidate
that represents the detail of the validation result.
For plain predicatesR
is the same type as the predicateP
.
For example,Validate[Int, Greater[W.
0.T]].validate(1)
will
returnPassed(Greater(0))
. - Rename
InferenceRule
toInference
and moveInference
,Refined
,
andRefType
into the newapi
package. - Rename the
implicits
object toauto
since the purpose of the
implicit conversions there is to automatically convert base types to
refined types. (#61) - Add
coflatMapRefine
toRefType
which is similar tocoflatMap
on
aComonad
. (#68) - Add
util.time
module with date- and time-related refined types
(Month
,DayOfMonth
,Hour
,Minute
, andSecond
). (#64)
Released on 2015-10-12