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
Converts this Normalization to a NormalizingEquivalence[A] whose normalized
method delegates to this Normalization[A] and whose afterNormalizationEquivalence field returns the
implicitly passed Equivalence[A].
Converts this Normalization to a NormalizingEquivalence[A] whose normalized
method delegates to this Normalization[A] and whose afterNormalizationEquivalence field returns the
implicitly passed Equivalence[A].
the Equivalence that the returned NormalizingEquivalence
will delegate to determine equality after normalizing both left and right (if appropriate) sides.
Defines a custom way to normalize instances of a type.
For example, to normalize
Doubles by truncating off any decimal part, you might write:Given this definition you could use it with the
ExplicitlyDSL like this:Note that to use a
Normalizationwith theExplicitlyDSL, you'll need to be using eitherTypeCheckedTripleEqualsorConversionCheckedTripleEquals. If you're just using plain-oldTripleEquals, you'll need aUniformity, aNormalizationsubclass.If you make the
truncatedvalimplicit and import or mix in the members ofNormMethods, you can access the behavior by invoking.normonDoubles.the type whose normalization is being defined