RefinedSubtype

io.github.iltotore.iron.RefinedSubtype
opaque trait RefinedSubtype[A, C](using _rtc: RuntimeConstraint[A, C])

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Type members

Types

override opaque type T

Value members

Inherited methods

inline def apply[A1 <: A](inline value: A1)(using inline constraint: Constraint[A, C]): T

Implicitly refine at compile-time the given value.

Implicitly refine at compile-time the given value.

Value parameters

value

the value to refine.

Attributes

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.

Inherited from:
Refined (hidden)
inline def applyAllUnsafe[F[_]](wrapper: F[A])(using mapLogic: MapLogic[F]): F[T]

Refine the given value(s) at runtime.

Refine the given value(s) at runtime.

Attributes

Returns

the given values as T.

Throws
IllegalArgumentException

if the constraint is not satisfied.

See also

applyUnsafe.

Inherited from:
Refined (hidden)
inline def assume(value: A): T

Refine the given value, assuming the constraint holds.

Refine the given value, assuming the constraint holds.

Attributes

Returns

a constrained value, without performing constraint checks.

See also

assumeAll, apply, applyUnsafe.

Inherited from:
Refined (hidden)
inline def assumeAll[F[_]](wrapper: F[A]): F[T]

Refine the given value(s), assuming the constraint holds.

Refine the given value(s), assuming the constraint holds.

Attributes

Returns

a wrapper of constrained values, without performing constraint checks.

See also

assume.

Inherited from:
Refined (hidden)
def either(value: A): Either[String, T]

Refine the given value at runtime, resulting in an Either.

Refine the given value at runtime, resulting in an Either.

Attributes

Returns

a Right containing this value as T or a Left containing the constraint message.

See also

option, applyUnsafe.

Inherited from:
Refined (hidden)
inline def eitherAll[F[_]](wrapper: F[A])(using mapLogic: MapLogic[F]): Either[String, F[T]]

Refine the given value(s) at runtime, resulting in an Either.

Refine the given value(s) at runtime, resulting in an Either.

Attributes

Returns

a Right containing the given values as T or a Left containing the constraint message.

See also

either.

Inherited from:
Refined (hidden)
def option(value: A): Option[T]

Refine the given value at runtime, resulting in an Option.

Refine the given value at runtime, resulting in an Option.

Attributes

Returns

an Option containing this value as T or None.

See also

either, applyUnsafe.

Inherited from:
Refined (hidden)
inline def optionAll[F[_]](wrapper: F[A])(using mapLogic: MapLogic[F]): Option[F[T]]

Refine the given value at runtime, resulting in an Option.

Refine the given value at runtime, resulting in an Option.

Attributes

Returns

an Option containing the refined values as F[T] or None.

See also

option.

Inherited from:
Refined (hidden)
inline def rtc: RuntimeConstraint[A, C]

The runtime constraint of the underlying IronType. Can be used in non-inline methods and to improve runtime performances.

The runtime constraint of the underlying IronType. Can be used in non-inline methods and to improve runtime performances.

Attributes

Inherited from:
Refined (hidden)
def unapply(value: A): Option[T]

Attributes

Inherited from:
Refined (hidden)

Givens

Inherited givens

inline given given_Mirror_T: given_Mirror_T

Attributes

Inherited from:
Refined (hidden)
given given_TypeTest_L_T[L](using test: TypeTest[L, A]): given_TypeTest_L_T[L]

Attributes

Inherited from:
Refined (hidden)
inline given given_TypeTest_T_R[R]: TypeTest[T, R]

Attributes

Inherited from:
Refined (hidden)

Extensions

Inherited extensions

extension (wrapper: T)
inline def value: IronType[A, C]

Attributes

Inherited from:
Refined (hidden)