!-M      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLSafe {data-validation1A type that holds aggregated validation failures.data-validation$A value that is assumed to be valid.data-validation;A value that has failures but can continue to be validated.data-validation:A value that has failures and cannot be validated further.data-validationHTakes the failures from the second parameter and adds them to the first.data-validationYTakes the failures from the right-hand-side, if any, and adds them to the left-hand-side.  Safe>@ACt.data-validation;A type class that represents a value that can be validated.+The parameters represent the following: * f&: the type of validation failures. * a): the unvalidated type or view model. * b: the validated type.data-validationGA type for storing a value to validate and, optionally, its field name.data-validationThe . constructor represents a value that is named.data-validationThe 2 constructor represents a value that is not named.data-validationBA type that holds either validation failures or a validated value.data-validationA validated value.data-validation%Global and field validation failures.data-validation Converts a  to a ."Internally, this library uses the ) type to track validation failures. This is because a validation failure can be partial. For instance, checking that a password has a special character can happen even if the check for a numeric character has already failed. This allows validation to discover as many failures as possible.However, once validation is complete, the result becomes binary. The validation has either succeeded or failed. In order to convert from a  to a  , use the  function.data-validationAccessor for a  ValueCtx's value.data-validationTReplaces the existing value with a new one without changing the name, if one exists.data-validation'Performs some given validation using a  with a given name and value.data-validation'Performs some given validation using a  with a given value.data-validation=Runs the validations for a given value and returns the proof.data-validation<Adds a validation failure to the result and ends validation. data-validation;Adds validation failures to the result and ends validation.!data-validationAAdds a validation failure to the result and continues validation."data-validation@Adds validation failures to the result and continues validation.#data-validationPerforms a validation using a given function and handles the result. If the result is `Just f`, a validation failure is added to the result and validation continues. If the result is M', validation continues with no failure.$data-validation Similar to #L except that the given failure is added if the given function returns False.%data-validationPerforms a validation using a given function and handles the result. If the result is `Left f`, a validation failure is added to the result and validation ends. If the result is `Right b`, validation continues with the new value.&data-validationWPerforms a validation using a given function and handles the result. If the result is , the validation failures are added to the result and validation ends. If the result is `Valid b`, validation continues with the new value.'data-validationChecks that a N value is a OF. If not, it adds the given failure to the result and validation end.(data-validationChecks that a P value is a QF. If not, it adds the given failure to the result and validation end.)data-validationChecks that a P value is a RF. If not, it adds the given failure to the result and validation end.*data-validationChecks that the ST is empty. If so, it adds the given failure to the result and validation continues.+data-validationChecks that the SY is not empty. If not, it adds the given failure to the result and validation continues.,data-validationChecks that a IsString has a length equal to or grater than the given value. If not, it adds the given failure to the result and validation continues.-data-validationChecks that a IsString has a length equal to or less than the given value. If not, it adds the given failure to the result and validation continues..data-validationChecks that a IsStringo has a length equal the given value. If not, it adds the given failure to the result and validation continues./data-validationsChecks that a value is equal to another. If not, it adds the given failure to the result and validation continues.0data-validationwChecks that a value is not equal to another. If not, it adds the given failure to the result and validation continues.1data-validationwChecks that a value is less than to another. If not, it adds the given failure to the result and validation continues.2data-validationzChecks that a value is greater than to another. If not, it adds the given failure to the result and validation continues.3data-validationChecks that a value is less than or equal to another. If not, it adds the given failure to the result and validation continues.4data-validationChecks that a value is greater than or equal to another. If not, it adds the given failure to the result and validation continues.5data-validationChecks that a S` has a given element. If not, it adds the given failure to the result and validation continues.6data-validationChecks that a Sj does not have a given element. If not, it adds the given failure to the result and validation continues.7data-validation3If any element is valid, the entire value is valid.8data-validationEvery element must be valid.9data-validation,Validate each element with a given function.:data-validation,Validate each element with a given function.;data-validationlChecks that two fields are equal. If not, it adds the given failure to the result and validation continues.<data-validation"Validates a value that implements 2 and includes any failures under the parent field.Consider the following example: # data ContactVM = ContactVM { phoneNumber :: String } data Contact = ... instance Validatable MyFailureType ContactVM Contact where ... data UserCreatableVM = UserCreatableVM { userCreatableVMEmailAddress :: String , userCreatableVMConfirmEmailAddress :: String , userCreatableVMPassword :: String , userCreatableVMConfirmPassword :: String , userCreatableVMContact :: ContactVM } data UserCreatable = ... instance Validatable MyFailureType UserCreatableVM UserCreatable where validation u = let vc = withField 'userCreatableVMContact (userCreatableVMContact u) $ validateField -- (1) ... in pure UserCreatable <*> ve <*> vp <*> vc <! vce <! vcp In line (1), the < function uses the  instance on  ContactVM to validate the type. All field specific validation failures are stored in a map where the key is the name of the field. However, in this case, there are the fields in the  ContactVM and the parent field in UserCreatableVMt. These names need to be combined so that the consumer can see if any errors came from nested fields. Using the <0 function, any validation failures found in the  ContactVM; value have field names that include the parent field. A  ContactVM with an invalid phone number might have a result like this: `Invalid [] [(['phoneNumber], [InvalidPhoneNumber])]` where `['phoneNumber]` is the key to the map. The validationField merges this with the  UserCreatable result to create something like this: `Invalid [] [(['contact, 'phoneNumber], [InvalidPhoneNumber])]`. This allows the consumer to determine exactly what field caused the failure.=data-validation[Allows for validation of an optional value. See `Validating Complex Types` for an example.>data-validation tests if a  is valid.?data-validation tests if a  is invalid.5 !"#$%&'()*+,-./0123456789:;<=>?5 %&!"#$'()*+,-./0132456789:;<=>?SafeHVJdata-validationsA type that represents a validation transformaion. The unvalidated type is the first parameter which is used when KN is passed in. The second parameter is the validated type which is used when L is passed in.Examples Basic usage: data ThingV v = Thing { emailAddress :: VT v String EmailAddress , confirmEmailAddress :: VT v String () } type ThingVM = ThingV VM -- A Thing5 view model. type Thing = ThingV V -- A validated Thing. Kdata-validationFA type that represents an unvalidated type, often called a View Model.Ldata-validation(A type that represents a validated type.JKLLKJT      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUSTVSTWSXYSXZSX[S\]^data-validation-0.1.0.0-inplaceData.ValidationData.Validation.InternalData.Validation.Transformstemplate-haskellLanguage.Haskell.TH.SyntaxmkNameNamenameBaseVCtxValidCtx DisputedCtx RefutedCtxaggregateFailures