object
maybeï
Types and predicates for type-checking and handling optional terms. Inspired by Haskell.
logtalk_load(optionals(loader))static, context_switching_calls
Type-checking support: Defines type
maybe(Type)for checking optional terms where the value hold by the optional term must be of the given type.QuickCheck support: Defines clauses for the
arbitrary::arbitrary/1-2,arbitrary::shrinker/1,arbitrary::shrink/3, andarbitrary::edge_case/2predicates to allow generating random values for themaybe(Type)type.
Public predicatesï
cat/2ï
Returns the values stored in the non-empty optional terms.
staticcat(Optionals,Values)cat(+list(optional),-list) - onesequence/2ï
Returns an optional term with a list of all values when all optional terms are not empty. Otherwise returns an empty optional term.
staticsequence(Optionals,Optional)sequence(+list(optional),--nonvar) - onetraverse/3ï
Applies a closure to each list element to generate optional terms and then sequences them into a single optional term holding all values or an empty optional term.
statictraverse(Closure,Terms,Optional)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