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
  • Regex

object Regex

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Regex
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. final case class Alphanumeric(reversed: Boolean) extends Regex with Product with Serializable
  2. final case class AndThen(first: Regex, second: Regex) extends Regex with Product with Serializable
  3. final case class CharacterSet(set: Set[Regex], reversed: Boolean) extends Regex with Product with Serializable
  4. final case class Digit(reversed: Boolean) extends Regex with Product with Serializable
  5. final case class Literal(char: Char) extends Regex with Product with Serializable
  6. final case class OrElse(first: Regex, second: Regex) extends Regex with Product with Serializable
  7. final case class Range(start: Char, end: Char, reversed: Boolean) extends Regex with Product with Serializable
  8. final case class Repeat(regex: Regex, min: Option[Int], max: Option[Int]) extends Regex with Product with Serializable
  9. final case class Whitespace(reversed: Boolean) extends Regex with Product with Serializable

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. val alphanumeric: Regex
  5. val anyChar: Regex
  6. def anyCharOf(first: Char, second: Char, rest: Char*): Regex
  7. def anyRegexOf(first: Regex, second: Regex, rest: Regex*): Regex
  8. val anything: Regex
  9. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  10. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  11. val digit: Regex
  12. val end: Regex
  13. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  15. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  16. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  18. def inRange(start: Char, end: Char): Regex
  19. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  20. def literal(str: String): Regex
  21. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  22. val nonAlphanumeric: Regex
  23. val nonDigit: Regex
  24. val nonWhitespace: Regex
  25. def notAnyCharOf(first: Char, second: Char, rest: Char*): Regex
  26. def notAnyRegexOf(first: Regex, second: Regex, rest: Regex*): Regex
  27. def notInRange(start: Char, end: Char): Regex
  28. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  29. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  30. val start: Regex
  31. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  32. def toString(): String
    Definition Classes
    AnyRef → Any
  33. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  34. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  35. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  36. val whitespace: Regex
  37. case object AnyChar extends Regex with Product with Serializable
  38. case object Anything extends Regex with Product with Serializable
  39. case object End extends Regex with Product with Serializable
  40. case object Start extends Regex with Product with Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped