Returns a new Normalization
that composes this and the passed Normalization
.
Returns a new Normalization
that composes this and the passed Normalization
.
The normalized
method of the Normalization
returned by this method returns a normalized form of the passed
object obtained by forwarding the passed value first to this Normalization
's normalized
method,
then passing that result to the other Normalization
's normalized
method.
Essentially, the body of the composed normalized
method is:
normalizationPassedToAnd.normalized(normalizationOnWhichAndWasInvoked.normalized(a))
a Normalization
to 'and' with this one
a Normalization
representing the composition of this and the passed Normalization
Defines a custom way to normalize instances of a type.
For example, to normalize
Double
s by truncating off any decimal part, you might write:Given this definition you could use it with the
Explicitly
DSL like this:Note that to use a
Normalization
with theExplicitly
DSL, you'll need to be using eitherTypeCheckedTripleEquals
orConversionCheckedTripleEquals
. If you're just using plain-oldTripleEquals
, you'll need aUniformity
, aNormalization
subclass.If you make the
truncated
val
implicit and import or mix in the members ofNormMethods
, you can access the behavior by invoking.norm
onDouble
s.the type whose normalization is being defined