Packages

  • package root
    Definition Classes
    root
  • package zio
    Definition Classes
    root
  • package prelude
    Definition Classes
    zio
  • object Assertion

    An Assertion[A] is essentially a composable predicate from A => Boolean.

    An Assertion[A] is essentially a composable predicate from A => Boolean. They can be composed with standard Boolean operators of &&, || and !. This is primarily intended to be used with Newtype and Subtype, enhancing them with compile-time time validation.

    For example, if you'd like to validate that a particular Int is precisely 4 digits long, you can create the following refined Newtype. (Note that the syntax is slightly difference between Scala 2 and Scala 3).

    type Pin = Pin.Type
    object Pin extends Newtype[Int] {
      // Scala 2 Syntax
      def assertion =
        assert(Assertion.between(1000, 9999))
    
      // Scala 3 Syntax
      override inline def assertion =
        Assertion.between(1000, 9999)
    }
    
    // PowerOfTwo(1000) compiles
    // PowerOfTwo(5412) compiles
    // PowerOfTwo(34567) fails with "34567 did not satisfy between(1000, 9999)"
    // PowerOfTwo(234) fails with "123 did not satisfy between(1000, 9999)"
    Definition Classes
    prelude
  • object Regex
    Definition Classes
    Assertion
  • Alphanumeric
  • AndThen
  • AnyChar
  • Anything
  • CharacterSet
  • Digit
  • End
  • Literal
  • OrElse
  • Range
  • Repeat
  • Start
  • Whitespace

case object Start extends Regex with Product with Serializable

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Start
  2. Serializable
  3. Product
  4. Equals
  5. Regex
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. def *: Regex
    Definition Classes
    Regex
  4. def +: Regex
    Definition Classes
    Regex
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. def ?: Regex
    Definition Classes
    Regex
  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def between(min: Int, max: Int): Regex
    Definition Classes
    Regex
  9. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  10. def compile: String
    Definition Classes
    StartRegex
  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  13. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  14. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  15. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  16. def max(n: Int): Regex
    Definition Classes
    Regex
  17. def min(n: Int): Regex
    Definition Classes
    Regex
  18. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  20. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  21. def productElementName(n: Int): String
    Definition Classes
    Product
  22. def productElementNames: Iterator[String]
    Definition Classes
    Product
  23. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  24. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  25. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  26. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  27. def |(that: Regex): Regex
    Definition Classes
    Regex
  28. def ~(that: Regex): Regex
    Definition Classes
    Regex

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Regex

Inherited from AnyRef

Inherited from Any

Ungrouped