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. All

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[Char], 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 anyOf(first: Char, second: Char, rest: Char*): Regex
  7. val anything: Regex
  8. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  9. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  10. val digit: Regex
  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. def equals(arg0: Any): 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[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  15. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  16. def inRange(start: Char, end: Char): Regex
  17. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  18. def literal(str: String): Regex
  19. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. val nonAlphanumeric: Regex
  21. val nonDigit: Regex
  22. val nonWhitespace: Regex
  23. def notAnyOf(first: Char, second: Char, rest: Char*): Regex
  24. def notInRange(start: Char, end: Char): Regex
  25. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  26. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  27. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  28. def toString(): String
    Definition Classes
    AnyRef → Any
  29. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  32. val whitespace: Regex
  33. object AnyChar extends Regex with Product with Serializable
  34. object Anything extends Regex with Product with Serializable
  35. object End extends Regex with Product with Serializable
  36. object Start extends Regex with Product with Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped