h$       Safe-Inferredvalor An alias for  (<>).valor An alias for .valorAs an alternative to the  Alternative type class and the <|> operator  is provided. It will result in an error only if both arguments are 0, however, only the last error will be returned.valorAccumulating version of  where if both operands are  they will be ed.valorA validator that always -es the test. Essentially just an alias for . If you want to create a validator that always passes for a type that isn't a , then you can use , however you will have to provide it a "dummy" error value that you yourself will manage as "neutral".ExamplevalidateP pass 1Left (Valid 1)valorA validator that fails with e if the predicate returns .Example4validateP ( passIf "must be greater than 0" (>0) ) 1Left (Valid 1)4validateP ( passIf "must be greater than 0" (>0) ) 0Right "must be greater than 0" valorA monadic version of . valor=Constructs a validator that always fails with provided error e.Example,validateP ( fail "YOU SHALL NOT PASS!!!" ) 1Right "YOU SHALL NOT PASS!!!" valorA validator that fails with e if the predicate returns .Example=validateP ( failIf "must be less than or equal to 0" (>0) ) 1'Right "must be less than or equal to 0"validateP ( failIf "must be less than or equal to 0" (>0) ) (-20)Left (Valid (-20)) valorA monadic version of  . valorApply one or the other validator depending on the result of a test.Example8let exV = test pass (fail "I'm a failure") (pure . (>3))validateP exV 3Left (Valid 3)validateP exV 4Right "I'm a failure"valor,Construct a validator that checks the input i and  results in an error e.Examplelet exV = make $ \ i -> pure $ if i > 3 then Nothing else Just "I'm 3 or less failure"validateP exV 3Right "I'm 3 or less failure"validateP exV 4Left (Valid 4)valorConstruct a validator that applies another validator depending on the result from a test validator. If both the "test" and the "fail" validator fail, then only the error from the "fail" validator is returned.Example)let failV = failIf "I'm less than 3" (<3),let passV = failIf "I'm greater than 4" (>4)/let testV = failIf "I'm not divisible by 2" odd let exV = peek failV passV testVvalidateP exV 7Left (Valid 7)validateP exV 6Right "I'm greater than 4"validateP exV 2Left (Valid 2)validateP exV 1Right "I'm less than 3"valor Just like , except if both the "test" and the "fail" validators fail, their results are ed ( ).Example+let failV = failIf ["I'm less than 3"] (<3).let passV = failIf ["I'm greater than 4"] (>4)1let testV = failIf ["I'm not divisible by 2"] odd let exV = poke failV passV testVvalidateP exV 7Left (Valid 7)validateP exV 6Right ["I'm greater than 4"]validateP exV 2Left (Valid 2)validateP exV 12Right ["I'm not divisible by 2","I'm less than 3"]valor#If a validator fails with an error  will make that error  essentially making it pass.Use of this function is discouraged, however it might come in handy in combination with  within the !ic context when you want to check the result of a validation without failing the whole !ic computation.Be careful though,  nerf . peer is not the same as  peer . nerf; (which is essentially useless and will always result in ").Example?validateP (nerf $ fail "I'm an error that will never appear") 0Left (Valid 0)valorAllows you to  into the # contained within the ( (how poetic) and if there is nothing  it will return ".It might be useful in the !ic context to know if the validator has failed (in which case $ e% is returned) or if it has succeeded.Example)validateP (peer $ fail "I have failed") 0Right (Just "I have failed")validateP (peer pass) 0Left (Valid 0)let exV = peer (failIf "I'm less than 3" (<3)) >>= maybe (fail "I fail if previous validator succeeds") failvalidateP exV 3-Right "I fail if previous validator succeeds"validateP exV 2Right "I'm less than 3"valorIt can  a validator to the new input type given a conversion function, making it useful for working with records (think field selectors) or newtypes.This is essentially a  from Data.Functor.Contravariant6, however, due to the placement of arguments in the < type constructor it is not possible to write that instance.Example0newtype Age = Age { unAge :: Int } deriving Show check1 (unID . userID) (passIf ["invalid ID"] (>0)) <*> check1 userName (failIf ["username can't be empty"] null)+validateP userValidator $ User (ID (-1)) ""Right (UserError {ueID = Just ["invalid ID"], ueName = Just ["username can't be empty"]})0validateP userValidator $ User (ID 0) "username"Right (UserError {ueID = Just ["invalid ID"], ueName = Nothing})2validateP userValidator $ User (ID 11) "mastarija"Left (Valid (User {userID = ID {unID = 11}, userName = "mastarija"}))valor Similar to :, except it will apply a validator to each element of a %, e.g. a list. If every element of a list is valid, then we get ", otherwise we get a list of s for each validated value.This allows us to know in which exact element of a list an error has occurred (if you trust your %7 to maintain the original order after the traversal).Example(data ID = ID {unID :: Int} deriving Showdata User = User {userID :: ID, userName :: String} deriving Showdata UserError = UserError {ueID :: Maybe [String], ueName :: Maybe [String]} deriving ShowuserValidator = UserError <$> check1 (unID . userID) (passIf ["invalid ID"] (>0)) <*> check1 userName (failIf ["username can't be empty"] null)&validUser01 = User (ID 11) "mastarija"$validUser02 = User (ID 13) "reygoch"invalidUser01 = User (ID 0) ""'invalidUser02 = User (ID (-1)) "badboy"validateP (checkN id userValidator) [validUser01, invalidUser01, validUser02, invalidUser02]Right (Just [Nothing,Just (UserError {ueID = Just ["invalid ID"], ueName = Just ["username can't be empty"]}),Nothing,Just (UserError {ueID = Just ["invalid ID"], ueName = Nothing})])valorRuns a validator within the & !., essentially making it a "pure" validation.valor*Runs a validator within the user provided ! m allowing you to perform side effects during the validation, e.g. check with the application database if the username is already registered.Example/newtype Database = Database { someData :: Int }let check = \ i -> someData >>= \ d -> pure $ if d < i then Nothing else Just "'DB' data is greater than input"&validateM (make check) 5 (Database 14)'Right "'DB' data is greater than input"%validateM (make check) 5 (Database 3)Left (Valid 5) valorvalidator to use on valorvalidator to use on valor a predicate  '      !" !# !$ !% !&'()'(* +, !- !. +/ +0 12 345$valor-1.0.0.0-ED1x9hXIi8a7UOTszM9BIM Data.ValorWrongInertData.Functor.Contravariant contramap(valor-1.0.0.0-ED1x9hXIi8a7UOTszM9BIM-intData.Valor.InternalunValidValidValorconappaltaccpasspassIfpassIfMfailfailIffailIfMtestmakepeekpokenerfpeeradaptcheck1checkN validateP validateMbaseGHC.Basemappend<*>memptyMonoidpureghc-prim GHC.TypesFalseTrue GHC.MaybeMaybe<>MonadNothingJustData.Traversable TraversableData.Functor.IdentityIdentity