protocol
Useful meta-predicates protocol.
Paulo Moura
3.4
2010/12/20
static, context_switching_calls
(no dependencies on other files)
True if the argument can be called as a goal.
static
callable(Term)
callable(@term) – zero_or_one
Returns a list of all list elements that satisfy a predicate.
static
include(Closure,List,Included)
include(1,*,*)
include(+callable,+list,-list) – one
Returns a list of all list elements that fail to satisfy a predicate.
static
exclude(Closure,List,Excluded)
exclude(1,*,*)
exclude(+callable,+list,-list) – one
Partition a list of elements in two lists using a predicate.
static
partition(Closure,List,Included,Excluded)
partition(1,*,*,*)
partition(+callable,+list,-list,-list) – one
Partitions a list in lists with values less, equal, and greater than a given value using a comparison predicate with the same argument order as compare/3.
static
partition(Closure,List,Value,Less,Equal,Greater)
partition(3,*,*,*,*,*)
partition(+callable,+list,@term,-list,-list,-list) – one
Calls Goal once but always succeeds, even if Goal fails.
static
ignore(Goal)
ignore(0)
ignore(@callable) – one
List folding (left associative).
static
fold_left(Closure,Accumulator,List,Result)
fold_left(3,*,*,*)
fold_left(+callable,?term,+list,?term) – zero_or_more
List scanning; similar to folding but returns the intermediate and final results (left associative).
static
scan_left(Closure,Accumulator,List,Results)
scan_left(3,*,*,*)
scan_left(+callable,?term,+list,?list) – zero_or_more
List folding (right associative).
static
fold_right(Closure,Accumulator,List,Result)
fold_right(3,*,*,*)
fold_right(+callable,?term,+list,?term) – zero_or_more
List scanning; similar to folding but returns the intermediate and final results (right associative).
static
scan_right(Closure,Accumulator,List,Results)
scan_right(3,*,*,*)
scan_right(+callable,?term,+list,?list) – zero_or_more
True if the predicate succeeds for each list element.
static
map(Closure,List)
map(1,*)
map(+callable,?list) – zero_or_more
List mapping predicate taken arguments from two lists of elements.
static
map(Closure,List1,List2)
map(2,*,*)
map(+callable,?list,?list) – zero_or_more
List mapping predicate taken arguments from three lists of elements.
static
map(Closure,List1,List2,List3)
map(3,*,*,*)
map(+callable,?list,?list,?list) – zero_or_more
List mapping predicate taken arguments from four lists of elements.
static
map(Closure,List1,List2,List3,List4)
map(4,*,*,*,*)
map(+callable,?list,?list,?list,?list) – zero_or_more
List mapping predicate taken arguments from five lists of elements.
static
map(Closure,List1,List2,List3,List4,List5)
map(5,*,*,*,*,*)
map(+callable,?list,?list,?list,?list,?list) – zero_or_more
List mapping predicate taken arguments from six lists of elements.
static
map(Closure,List1,List2,List3,List4,List5,List6)
map(6,*,*,*,*,*,*)
map(+callable,?list,?list,?list,?list,?list,?list) – zero_or_more
List mapping predicate taken arguments from seven lists of elements.
static
map(Closure,List1,List2,List3,List4,List5,List6,List7)
map(7,*,*,*,*,*,*,*)
map(+callable,?list,?list,?list,?list,?list,?list,?list) – zero_or_more
static
map_reduce(2,3,*,*,*)
map_reduce(+callable,+callable,+term,?list,?term) – zero_or_more
(none)
(none)