robots
package robots
- Alphabetic
- By Inheritance
- robots
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
final
case class
PValidator[F[_], E, A, B](validate: (A) ⇒ F[E], f: (A) ⇒ B)(implicit FF: Traverse[F], M: MonoidK[F]) extends Product with Serializable
PValidatorwraps up a validation functionvalidate: A => F[E]which validates the inputAand returns a structure of error messagesF[E].PValidatorwraps up a validation functionvalidate: A => F[E]which validates the inputAand returns a structure of error messagesF[E].The
PinPValidatordenotes the fact that this validation is polymorphic, in the sense that its input does not have to be of the same type as its output.This may be useful when a successful validation provides some knowledge about the value that is being validated that can be used to refine its type.
For example, a
requiredvalidator makes use of the fact that it has ensured that anOption[A]is not empty to safely unwrap the option's inner value. -
type
Validator[F[_], E, A] = PValidator[F, E, A, A]
A
Validator[F[_], E, A]wraps a validation functionA => F[E]and provides functions to accumulate the results of this validation into different structures and to combine validations together so that validations for properties of an object can be combined together to form a validator for the entire object.
Value Members
-
object
PValidator extends PValidatorInstances with Serializable
The companion object for
PValidatorprovides various type class instances forPValidator. -
object
Validator
The companion object for
Validatorprovides a number of functions for constructing simple validators.The companion object for
Validatorprovides a number of functions for constructing simple validators.Validators for comparisons and equality checking can be constructed for types with
OrderandEqinstances, respectively.There are also functions provided for constructing validators which always pass and which always fail.