any

io.github.iltotore.iron.constraint.any
object any

Constraints working for any type (e.g any.StrictEqual) and constraint operators (e.g any.Not...).

Attributes

Source
any.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
any.type

Members list

Type members

Classlikes

final class DescribedAs[C, V <: String]

A constraint decorator with a custom description.

A constraint decorator with a custom description.

Type parameters

C

the decorated constraint.

V

the description to attach.

Attributes

Example
//Literal
type PosInt = Greater[0] DescribedAs "Should be positive"
//Using type-level String concatenation (example taken from `numeric`)
import io.github.iltotore.iron.ops.*
type GreaterEqual[V] = (Greater[V] || StrictEqual[V]) DescribedAs ("Should be greater than or equal to " + V)
Companion
object
Source
any.scala
Supertypes
class Object
trait Matchable
class Any
object DescribedAs

Attributes

Companion
class
Source
any.scala
Supertypes
class Object
trait Matchable
class Any
Self type
final class False

An always-invalid constraint.

An always-invalid constraint.

Attributes

Companion
object
Source
any.scala
Supertypes
class Object
trait Matchable
class Any
object False

Attributes

Companion
class
Source
any.scala
Supertypes
class Object
trait Matchable
class Any
Self type
False.type
final class Not[C]

A constraint decorator acting like a boolean "not".

A constraint decorator acting like a boolean "not".

Type parameters

C

the decorated constraint.

Attributes

Companion
object
Source
any.scala
Supertypes
class Object
trait Matchable
class Any
object Not

Attributes

Companion
class
Source
any.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Not.type
final class StrictEqual[V]

Tests strict equality with the given value.

Tests strict equality with the given value.

Type parameters

V

the value the input must be equal to.

Attributes

Companion
object
Source
any.scala
Supertypes
class Object
trait Matchable
class Any
object StrictEqual

Attributes

Companion
class
Source
any.scala
Supertypes
class Object
trait Matchable
class Any
Self type
final class True

An always-valid constraint.

An always-valid constraint.

Attributes

Companion
object
Source
any.scala
Supertypes
class Object
trait Matchable
class Any
object True

Attributes

Companion
class
Source
any.scala
Supertypes
class Object
trait Matchable
class Any
Self type
True.type
final class Xor[C1, C2]

A constraint operator acting like a boolean "xor".

A constraint operator acting like a boolean "xor".

Type parameters

C1

the left constraint.

C2

the right constraint.

Attributes

Companion
object
Source
any.scala
Supertypes
class Object
trait Matchable
class Any
object Xor

Attributes

Companion
class
Source
any.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Xor.type

Types

type ![C] = C match { case Boolean => ![C] case Any => Not[C] }

Alias for Not.

Alias for Not.

Attributes

Source
any.scala
type In[V <: NonEmptyTuple] = V match { case h *: EmptyTuple => StrictEqual[h] case h *: t => StrictEqual[h] | In[t] }

Tests strict equality with any one of the given values.

Tests strict equality with any one of the given values.

Type parameters

V

the values the input must be in.

Attributes

Example
type Digit = In[(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)]
Source
any.scala
type Pure = True

Alias for True. Usually used for new types with no constraint.

Alias for True. Usually used for new types with no constraint.

Attributes

See also

"Creating new types" reference.

Source
any.scala