object
either
Types and predicates for extended type-checking and handling of expected terms.
logtalk_load(expecteds(loader))static, context_switching_calls
Type-checking support: Defines a
either(ValueType, ErrorType)type for checking expected terms where the value and error terms must be of the given types.QuickCheck support: Defines clauses for the
type::arbitrary/1-2,arbitrary::shrinker/1,arbitrary::shrink/3, andarbitrary::edge_case/2predicates to allow generating random values for theeither(ValueType, ErrorType)type.
Public predicates
expecteds/2
Returns the values stored in the expected terms that hold a value.
staticexpecteds(Expecteds,Values)expecteds(+list(expected),-list) - oneunexpecteds/2
Returns the errors stored in the expected terms that hold an error.
staticunexpecteds(Expecteds,Errors)unexpecteds(+list(expected),-list) - onepartition/3
Retrieves and partitions the values and errors hold by the expected terms.
staticpartition(Expecteds,Values,Errors)partition(+list(expected),-list,-list) - onesequence/2
Returns an expected term with a list of all values when all expected terms hold values. Otherwise returns the first expected term holding an error.
staticsequence(Expecteds,Expected)sequence(+list(expected),--nonvar) - onetraverse/3
Applies a closure to each list element to generate expected terms and then sequences them into a single expected term holding all values or the first error.
statictraverse(Closure,Terms,Expected)traverse(2,*,*)traverse(+callable,+list,--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