Changes
- Deprecate
refine
andrefineLit
in favor of the newrefineT
and
refineMT
(whereT
stands for tag/@@
andM
for macro). In addition,
there are two other variants of these functions,refineV
andrefineMV
,
that use the newly addedRefined
value class instead of@@
. The advantages
ofRefined
is that it can be used in combination with
type aliases. - Add string utility functions to create statically checked regular expressions,
URIs, URLs, and UUIDs. A detailed description of these functions can be found
here. (#35, #38) - Lift the restriction to refine only literal values at compile-time if a
Predicate
is constant (i.e. it ignores its argument when callingisValid
).
Some examples of constant predicates areTrue
orFalse
or the newly added
ConstructorNames
andFieldNames
predicates. Some examples of the last two
predicates can be found here. (#26) - Enable tests in the Scala.js build. (#29)
- Remove
refine
fromPredicate
since the purpose ofPredicate
is
to check whether a value conforms to a type-level predicate. Refining
the type of such value is a different concern. (#31) - Add inference rules for numeric singleton types to
shapeless.Nat
.
New predicates
ConstructorNames[P]
: checks if the constructor names of a sum type satisfyP
FieldNames[P]
: checks if the field names of a product type satisfyP
Uuid
: checks if aString
is a valid UUID
Released on 2015-07-27