io.github.iltotore.iron
Members list
Type members
Classlikes
A typeclass representing the implementation of a constraint of a certain type of value.
A typeclass representing the implementation of a constraint of a certain type of value.
Attributes
- A
the type of the value to test.
- C
the constraint associated with this implementation.
- Companion:
- object
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Known subtypes
Attributes
- Companion:
- trait
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Self type
- Constraint.type
An algebraic implication between two constraints (e.g transitivity for constraint.numeric.Greater).
An algebraic implication between two constraints (e.g transitivity for constraint.numeric.Greater).
Attributes
- C1
the assumed constraint.
- C2
the constraint implied by
C1
.- Companion:
- object
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
Attributes
- Companion:
- class
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Self type
- Implication.type
Methods and types to ease compile-time operations.
Methods and types to ease compile-time operations.
Attributes
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Self type
- compileTime.type
Types
Alias for Implication. Similar to the mathematical implication symbol, often represented by an arrow.
Alias for Implication. Similar to the mathematical implication symbol, often represented by an arrow.
Attributes
An Iron type (refined).
An Iron type (refined).
Attributes
- A
the underlying type.
- C
the predicate/constraint guarding this type.
Extensions
Extensions
Refine the given value at runtime.
Refine the given value at runtime.
Attributes
- constraint
the constraint to test with the value to refine.
- Returns:
this value as IronType.
- Throws:
- an
IllegalArgumentException if the constraint is not satisfied.
- See also:
Refine the given value at runtime, resulting in an Either.
Refine the given value at runtime, resulting in an Either.
Attributes
- constraint
the constraint to test with the value to refine.
- Returns:
a Right containing this value as IronType or a Left containing the constraint message.
- See also:
Refine the given value at runtime, resulting in an Option.
Refine the given value at runtime, resulting in an Option.
Attributes
- constraint
the constraint to test with the value to refine.
- Returns:
an Option containing this value as IronType or None.
- See also:
Implicits
Implicits
Implicitly cast a constrained value to another if verified.
Implicitly cast a constrained value to another if verified.
Attributes
- A
the refined type.
- C1
the original constraint.
- C2
the target constraint.
- `C1
==> C2
the evidence that the original constraint
C1implies
C2`.- value
the refined to value to cast.
- Returns:
the given value constrained by
C2
.
Implicitly cast an iterable constrained by ForAll[C1]
into an iterable of elements constrained by C2
if C1
implies C2
.
Implicitly cast an iterable constrained by ForAll[C1]
into an iterable of elements constrained by C2
if C1
implies C2
.
Attributes
- A
the refined type.
- C1
the original constraint.
- C2
the target constraint.
- I
the iterable type.
- `C1
==> C2
the evidence that
C1implies
C2`.- iterable
the iterable to factorize.
- Returns:
the given value as instance of
I[A :| C2]
.- See also:
Implicitly cast an iterable of elements constrained by C1
into an iterable constrained by ForAll[C2]
if C1
implies C2
.
Implicitly cast an iterable of elements constrained by C1
into an iterable constrained by ForAll[C2]
if C1
implies C2
.
Attributes
- A
the refined type.
- C1
the original constraint.
- C2
the target constraint.
- I
the iterable type.
- `C1
==> C2
the evidence that
C1implies
C2`.- iterable
the iterable to factorize.
- Returns:
the given value as instance of
I[A] :| ForAll[C2]
.- See also:
Implicitly refine at compile-time the given value.
Implicitly refine at compile-time the given value.
Attributes
- A
the refined type.
- C
the constraint applied to the type.
- constraint
the implementation of
C
to check.- value
the value to refine.
- Returns:
the given value typed as IronType
- Note:
This method ensures that the value satisfies the constraint. If it doesn't or isn't evaluable at compile-time, the compilation is aborted.