Changes
- Added
Predicate
instances for numeric predicates that take singleton
types as arguments. For examplerefineLit[Less[W.
-12.3.T]](-12.5)
checks at compile time that -12.5 is less than -12.3. refine
andrefineLit
are now regular functions and notobject
s
with anapply
method.- Updated to shapeless 2.2.0.
Bug fixes
refineLit
works now with predicates that contain singleton types.
For examplerefineLit[MatchesRegex[W.
"[0-9]+".T](<string literal>)
checks at compile-time if<string literal>
matches the regular
expression "[0-9]+". (#2)- Worked around a strange initialization bug in
refineLit
. (#3)
New predicates
Xor[A, B]
: exclusive disjunction of the predicatesA
andB
OneOf[PS]
: exclusive disjunction of all predicates inPS
LetterOrDigit
: checks if aChar
is a letter or digit
Contains[U]
: checks if aTraversableOnce
contains a value equal toU
Head[P]
: checks if the predicateP
holds for the first element of
aTraversable
Index[N, P]
: checks if the predicateP
holds for the element at
indexN
of a sequenceLast[P]
: checks if the predicateP
holds for the last element of
aTraversable
IsNull
: checks if a value isnull
NonNull
: checks if a value is notnull
Released on 2015-05-31