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
Members list
Type members
Classlikes
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 = DescribedAs[Greater[0], "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 Objecttrait Matchableclass Any
object DescribedAs
Attributes
- Companion
- class
- Source
- any.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
DescribedAs.type
object False
object Not
object StrictEqual
Attributes
- Companion
- class
- Source
- any.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
StrictEqual.type
object True
Types
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
In this article