object
validation
Constructors for validation terms. A validation term is either valid(Value) or invalid(Errors) where Errors is a list of errors. Validation terms allow applicative-style error accumulation.
logtalk_load(validations(loader))static, context_switching_calls
Type-checking support: Defines a
validationtype for use with thetypelibrary object.
Public predicates
of_valid/2
Constructs a validation term holding a valid value.
staticof_valid(Value,Validation)of_valid(@term,--nonvar) - oneof_invalid/2
Constructs a validation term holding a single error.
staticof_invalid(Error,Validation)of_invalid(@term,--nonvar) - oneof_invalids/2
Constructs a validation term holding a list of errors.
staticof_invalids(Errors,Validation)of_invalids(@list,--nonvar) - onefrom_goal/4
Constructs a validation term holding a value bound by calling the given goal. Otherwise returns a validation term with a single error represented by the Error argument.
staticfrom_goal(Goal,Value,Error,Validation)from_goal(0,*,*,*)from_goal(+callable,--term,@term,--nonvar) - onefrom_goal/3
Constructs a validation term holding a value bound by calling the given goal. Otherwise returns a validation term with a single error being the goal error or the atom fail representing goal failure.
staticfrom_goal(Goal,Value,Validation)from_goal(0,*,*)from_goal(+callable,--term,--nonvar) - onefrom_goal/2
Constructs a validation term holding a value bound by calling the given closure. Otherwise returns a validation term with a single error being the closure error or the atom fail representing closure failure.
staticfrom_goal(Closure,Validation)from_goal(1,*)from_goal(+callable,--nonvar) - onefrom_generator/4
Constructs validation terms with the values generated by calling the given goal. On goal error or failure, returns a validation term with a single error represented by the Error argument.
staticfrom_generator(Goal,Value,Error,Validation)from_generator(0,*,*,*)from_generator(+callable,--term,@term,--nonvar) - one_or_morefrom_generator/3
Constructs validation terms with the values generated by calling the given goal. On goal error or failure, returns a validation term with, respectively, a single error being the goal error or the atom fail representing goal failure.
staticfrom_generator(Goal,Value,Validation)from_generator(0,*,*)from_generator(+callable,--term,--nonvar) - one_or_morefrom_generator/2
Constructs validation terms with the values generated by calling the given closure. On closure error or failure, returns a validation term with, respectively, a single error being the closure error or the atom fail representing closure failure.
staticfrom_generator(Closure,Validation)from_generator(1,*)from_generator(+callable,--nonvar) - one_or_morefrom_optional/3
Converts an optional term to a validation term. Returns a valid term holding the value if the optional term is not empty. Returns an invalid term with the given error otherwise.
staticfrom_optional(Optional,Error,Validation)from_optional(+nonvar,@term,--nonvar) - onefrom_expected/2
Converts an expected term to a validation term. Returns a valid term holding the value if the expected term holds a value. Returns an invalid term with the expected term error otherwise.
staticfrom_expected(Expected,Validation)from_expected(+nonvar,--nonvar) - oneProtected predicates
(no local declarations; see entity ancestors if any)
Private predicates
(no local declarations; see entity ancestors if any)
Operators
(none)
See also