Did you know ... Search Documentation:
Pack arithmetic_types -- prolog/type_list.pl
PublicShow source

This module implements a set of functions on lists which can be used in standard arithmetic expressions, including block indexing and slicing (using [] as a postfix operator), concatenation, flatten, fill from a range, etc. It also exports a couple of predicates to support indexing and slicing on other "sequence" types.

The set of list arithmetic functions defined by this module include:

:- arithmetic_function(new/2).        % create
:- arithmetic_function('[|]'/2).      % evaluate list items
:- arithmetic_function([]/1).         % block index
:- arithmetic_function([]/2).
:- arithmetic_function(: /2).         % slice (used with block indexing)
:- arithmetic_function(length/1).     % size or length
:- arithmetic_function(init/2).       % fill any vars
:- arithmetic_function(\\ /2).        % list concat
:- arithmetic_function(flatten/1).    % flattened list
:- arithmetic_function(arange/2).     % list from range(N)
:- arithmetic_function(arange/3).     % list from range(B,E)
:- arithmetic_function(arange/4).     % list from range(B,E,S)

See the ReadMe for this pack for more documentation and examples.

Undocumented predicates

The following predicates are exported, but not or incorrectly documented.

 slice_parameters(Arg1, Arg2, Arg3, Arg4)
 index_parameters(Arg1, Arg2, Arg3)