Tag a type T
with Tag
.
Tag a type T
with Tag
. The resulting type is a subtype of T
.
The resulting type is used to discriminate between type class instances.
Abstract class to ease Bijection creation from Java.
For Java and avoiding trait bloat
Abstract class to ease Injection creation from Java (and reduce instance size in scala).
Injections may not be defined for their inverse conversion.
Injections may not be defined for their inverse conversion. This type represents the attempted conversion. A failure will result in a scala.util.Failure containing the InversionFailure. A success will result in a scala.util.Success containing the inverted value.
TODO: Remove in 0.6.0.
A Bijection[A, B] is a pair of functions that transform an element between types A and B isomorphically; that is, for all items,
A collection of utilities for encoding strings and byte arrays to and decoding from strings compressed from with gzip.
Bufferable[T] is a typeclass to work with java.
Bijection between Class objects and string.
Injection between Class objects and string.
Using Injections for serialization is a common pattern.
Using Injections for serialization is a common pattern. Currying the byte array parameter makes it easier to write code like this:
def getProducer[T: Codec] = ...
Convert allows the user to convert an instance of type A to type B given an implicit Conversion that goes between the two.
Type class for summoning the function that can check whether the instance can be tagged with Rep
An Injection[A, B] is a function from A to B, and from some B back to A.
A common injection on numbers: N -> (m = N mod K, (N-m)/K) The first element in result tuple is always [0, modulus)
When Injection inversion attempts are known to fail, the attempt will encode an InversionFailure to represent that failure
Use Java serialization to write/read bytes.
A common injection on numbers: N -> (m = N mod K, (N-m)/K) The first element in result tuple is always [0, modulus)
Pivot is useful in moving from a 1D space of K to a 2D mapping space of K1 x K2.
Type tag used to indicate that an instance of a type such as String contains a valid representation of another type, such as Int or URL.
When you have conversion between A and B where B is a subclass of A, which is often free, i.
Tagging infrastructure.
Injection to cast back and forth between two types.
Factory for applying inversion attempts
Factory for producing InversionFailures
Useful HasRep
Bijection for joining together iterables of strings into a single string and splitting them back out.
Bijection that flips the order of items in a Tuple2.
Bijection trait with numerous implementations.
A Bijection[A, B] is an invertible function from A -> B. Knowing that two types have this relationship can be very helpful for serialization (Bijection[T, Array[Byte]]]), communication between libraries (Bijection[MyTrait, YourTrait]) and many other purposes.