
eu.timepit.refined.scalacheck.char.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of refined-scalacheck_sjs0.6_2.12.0-M4 Show documentation
Show all versions of refined-scalacheck_sjs0.6_2.12.0-M4 Show documentation
Simple refinement types for Scala
The newest version!
package eu.timepit.refined
package scalacheck
import eu.timepit.refined.api.RefType
import eu.timepit.refined.char._
import org.scalacheck.{ Arbitrary, Gen }
object char {
implicit def digitArbitrary[F[_, _]: RefType]: Arbitrary[F[Char, Digit]] =
arbitraryRefType(Gen.numChar)
implicit def letterArbitrary[F[_, _]: RefType]: Arbitrary[F[Char, Letter]] =
arbitraryRefType(Gen.alphaChar)
implicit def lowerCaseArbitrary[F[_, _]: RefType]: Arbitrary[F[Char, LowerCase]] =
arbitraryRefType(Gen.alphaLowerChar)
implicit def upperCaseArbitrary[F[_, _]: RefType]: Arbitrary[F[Char, UpperCase]] =
arbitraryRefType(Gen.alphaUpperChar)
implicit def whitespaceArbitrary[F[_, _]: RefType]: Arbitrary[F[Char, Whitespace]] =
arbitraryRefType(Gen.oneOf(whitespaceChars))
private val whitespaceChars: Seq[Char] =
(Char.MinValue to Char.MaxValue).filter(_.isWhitespace)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy