package alphabetsoup
- Alphabetic
- Public
- All
Type Members
- trait Atom[T] extends AnyRef
- trait AtomSelector[L, U] extends AnyRef
- trait Atomiser[T] extends Serializable
- trait LowLowPrioritySelectOrDefaultOrTransmute extends AnyRef
- trait LowPriorityAtomiserImplicits1 extends AnyRef
- trait LowPriorityMFAImplicits1 extends AnyRef
- trait LowPrioritySelectAndTransmute extends AnyRef
- trait LowPrioritySelectFromAtomised extends AnyRef
- trait LowPrioritySelectOrDefaultOrTransmute extends LowLowPrioritySelectOrDefaultOrTransmute
- trait Mixer[A, B] extends AnyRef
- trait MixerImpl[A, B] extends AnyRef
Mixes A into B, atomising them both as a first step
Mixes A into B, atomising them both as a first step
Allows you to inject an instance of B into an instance of A, replacing all values in A whose types have a corresponding value in B
MixerImplFromAtomised[A, B].inject(b, a) is the same as MixerImplFromAtomised[(B, A), A].mix(b -> a) but more efficient due to reusing the same internal structures
- trait MixerImplFromAtomised[A, B] extends AnyRef
Mixes A into B, assuming both A and B have been atomised
Mixes A into B, assuming both A and B have been atomised
Allows you to inject an instance of B into an instance of A, replacing all values in A whose types have a corresponding value in B
MixerImplFromAtomised[A, B].inject(b, a) is the same as MixerImplFromAtomised[(B, A), A].mix(b -> a) but more efficient due to reusing the same internal structures
- trait Molecule[M[_], A] extends AnyRef
- trait SelectFromAtomised[L, U] extends AnyRef
A trait that extracts or replaces a value U (atom or molecule) from a type L, provided the type L has been atomised first.
A trait that extracts or replaces a value U (atom or molecule) from a type L, provided the type L has been atomised first.
If no such value exists, it does not compile
## Molecules
### Selecting
You can select an M[B] from a structure as long as you can select an M[A], where a Mixer[B, A] exists.
The M[A] is simply mapped over with the mixer. In the case where B = A, the same functionality occurs without the mixer step
### Replacing
If you replace a List[A] with a List[A], the entire structure will be replaced by the new list. Ie, the length will be the length of the new list.
This is DIFFERENT behaviour to the selection case, where the original structure is preserved. Molecules act as atoms for replacing, as you would expect if you replaced a list with another list; you would expect the length to be the length of the new list.
You are unable to replace an M[B] with an M[A] if B != A, even if there is a Mixer[B, A] present. We simply ignore the replacement request.
This is equivalent to the bahviour you would expect of Mixer[(B, A), A], where a Miaxer[A, B] exists
- trait SelectOrDefaultOrTransmute[L, U] extends AnyRef
Tries to use SelectFromAtomised to produce a value U from L.
Tries to use SelectFromAtomised to produce a value U from L. If it fails, tries to find a default atom of type U. If this fails, it tries to transmute the value if there exists Transmute[T, U] from some type T in L.
This assumes L is atomised.
### Replace behaviour
If we can select U from L, replace acts as it does for SelectFromAtomised
If we can not select U from L and rely on an implicit default, we replace nothing and return our L unchanged
- trait SelectTransmuted[L, U] extends AnyRef
- sealed trait Transmute[A, B] extends AnyRef
Value Members
- object Atom
- object AtomSelector
- object Atomiser extends LowPriorityAtomiserImplicits1 with Serializable
- object Mixer
- object MixerImpl
- object MixerImplFromAtomised extends LowPriorityMFAImplicits1
- object Molecule
- object SelectFromAtomised extends LowPrioritySelectFromAtomised
- object SelectOrDefaultOrTransmute extends LowPrioritySelectOrDefaultOrTransmute
- object SelectTransmuted extends LowPrioritySelectAndTransmute
- object Transmute