:- use_module(list_util, [take/3]). main :- take([hello, world, etc], 2, Words), writeln(Words).
Prolog code works with lots of lists. This is a collection of predicates that I've found useful from time to time across projects.
Some of these predicates are inspired by functions in Haskell's Data.List library. Prolog's reversible predicates allow us to get by with fewer definitions than Haskell needs.
list_util.pl documentation below for details about each exported
* Add some meta-predicate declarations
Using SWI-Prolog 6.3 or later:
This module uses semantic versioning.
Source code available and pull requests accepted at http://github.com/mndrix/list_util
@author Michael Hendricks firstname.lastname@example.org @license BSD