nutcracker.util
Type members
Classlikes
Represents the kind of function that one passes to foldLeft
, as a typeclass.
Represents the kind of function that one passes to foldLeft
, as a typeclass.
- Companion:
- object
Comparing of (potentially cyclic) object graphs for equality. Features:
Comparing of (potentially cyclic) object graphs for equality. Features:
- abstracted over pointers;
- termination and correctness in presence of cycles;
- stack safety.
XXX: Relies on meaningful hashCode and equals for Ptr1
- Companion:
- object
Universally quantified equality, isomorphic to ∀A. Equal[F[A]]
.
Universally quantified equality, isomorphic to ∀A. Equal[F[A]]
.
Note that equality on A
is not required to compare values of F[A]
.
- Companion:
- object
Free monad for type constructors of kind F[_[_], _]
,
where F
's first type parameter is recursively set to FreeK[F, ?].
If we pretend that recursive type aliases are legal, then FreeK
is
equivalent to
Free monad for type constructors of kind F[_[_], _]
,
where F
's first type parameter is recursively set to FreeK[F, ?].
If we pretend that recursive type aliases are legal, then FreeK
is
equivalent to
type FreeK[F[_[_], _], A] = Free[F[FreeK[F, ?], ?], A]
This is useful for instruction sets (a.k.a. algebras, DSLs, ...) that need to refer to the type of the free program that they are embedded in.
- Companion:
- object
Heterogeneous equality, i.e. able to compare values of two disparate types.
Heterogeneous equality, i.e. able to compare values of two disparate types.
- Companion:
- object
Universally quantified heterogeneous equality, isomorphic to ∀A,B. HEqual[F[A], F[B]]
.
Universally quantified heterogeneous equality, isomorphic to ∀A,B. HEqual[F[A], F[B]]
.
Note that (heterogeneous) equality between A
and B
is not required to compare F[A]
to F[B]
.
- Companion:
- object
Similar to scalaz.Inject
, except:
Similar to scalaz.Inject
, except:
- not sealed, thus not restricted to injections into
scalaz.Coproduct
; - doesn't require to implement projection, so more instances are possible.
- Companion:
- object
- Companion:
- object
- Companion:
- object
KMap where values are parameterized by 2 additional type parameters,
uniquely determined by a typeclass instance. Type safety relies on
TC[A, B, C]
being functional in A
, i.e. for each A
there are
globally unique B
, C
such that there is an instance of TC[A, B, C]
.
KMap where values are parameterized by 2 additional type parameters,
uniquely determined by a typeclass instance. Type safety relies on
TC[A, B, C]
being functional in A
, i.e. for each A
there are
globally unique B
, C
such that there is an instance of TC[A, B, C]
.
- Companion:
- object
KMap with an upper bound on the type parameter accepted by K[_], V[_].
KMap with an upper bound on the type parameter accepted by K[_], V[_].
- Companion:
- object
Linked list with O(1) cons, snoc and concatenation and amortized O(1) uncons.
Linked list with O(1) cons, snoc and concatenation and amortized O(1) uncons.
- Companion:
- object
Computation of C
with a missing link between A
and B
.
Encapsulates effectful computations () ~~~> A
and B ~~~> C
.
By plugging in A ~~~> B
one can obtain () ~~~> C
.
The purpose of this class is to prevent using just one of the two
encapsulated computations: either both, or none. This is useful when
the effects of the two computations are somehow paired and this pairing
can't be broken. This is only safe when M
is a lazy monad with benign
effects.
Computation of C
with a missing link between A
and B
.
Encapsulates effectful computations () ~~~> A
and B ~~~> C
.
By plugging in A ~~~> B
one can obtain () ~~~> C
.
The purpose of this class is to prevent using just one of the two
encapsulated computations: either both, or none. This is useful when
the effects of the two computations are somehow paired and this pairing
can't be broken. This is only safe when M
is a lazy monad with benign
effects.
- Companion:
- object
- Type parameters:
- O
represents output. Examples:
String
,java.io.OutputStream
, ...- Ptr
abstraction of pointers.
- R
represents type of data to be written to the output. Examples:
String
, bit string, ...
- Companion:
- object
Serialization of (potentially cyclic) object graphs. Features:
Serialization of (potentially cyclic) object graphs. Features:
- abstracted over pointers;
- termination and correctness in presence of cycles;
- stack safety.
- Type parameters:
- A
type of objects that this serializer can serialize.
- Ptr
abstraction of pointers.
- S
type of data this serializer writes when serializing
A
, e.g.String
, byte array, etc.
- Companion:
- object
Used to implicitly summon an HList by implicitly summoning its elements.
Used to implicitly summon an HList by implicitly summoning its elements.
- Companion:
- object
Universally quantified value:
∀ K[_], A. F[K, A]
Universally quantified value:
∀ K[_], A. F[K, A]
Universally quantified value:
∀ K[_]. F[K]
Universally quantified value:
∀ K[_]. F[K]
Universally quantified value:
∀ A. F[A]
Universally quantified value:
∀ A. F[A]
Universally quantified function:
∀ K[_], A. F[K, A] => G[K, A]
Universally quantified function:
∀ K[_], A. F[K, A] => G[K, A]
- Companion:
- object
Universally quantified function:
∀ K[_]. F[K] => G[K]
Universally quantified function:
∀ K[_]. F[K] => G[K]