Did you know ... Search Documentation:
Packs (add-ons) for SWI-Prolog

Package "swipe"

Title:Shell pipeline construction with type checking
Rating:Not rated. Create the first rating!
Latest version:0.2.6
SHA1 sum:7df0df09a85377a698abd5e03bbd83bb6c2f6677
Author:Samer Abdallah <s.abdallah@ucl.ac.uk>
Download URL:https://raw.githubusercontent.com/samer--/prolog/master/swipe/release/swipe-0.2.6.tgz
Requires:dcgutils
fileutils

Reviews

No reviews. Create the first review!.

Details by download location

VersionSHA1#DownloadsURL
0.0.16370cf5772a36f010d3401244cfe6bcbba10e1c61https://github.com/samer--/prolog/raw/master/swipe/release/swipe-0.0.1.tgz
0.0.2b6d258c89af043e04aad61e8534d25c062ae32911https://github.com/samer--/prolog/raw/master/swipe/release/swipe-0.0.2.tgz
0.0.3cb197af27d6ac1aad8c89aeeabecfd9f4bebbcfa1https://github.com/samer--/prolog/raw/master/swipe/release/swipe-0.0.3.tgz
0.0.42bc8790b3282fc6fab77cc1d70832d83b4b543b41https://github.com/samer--/prolog/raw/master/swipe/release/swipe-0.0.4.tgz
0.0.5d2e2ac43a01a85e2f027a0cdcf456cd18f4a62d51https://github.com/samer--/prolog/raw/master/swipe/release/swipe-0.0.5.tgz
0.1.0b9ee874e6db242d24552b88f2515f235e024b3801https://github.com/samer--/prolog/raw/master/swipe/release/swipe-0.1.0.tgz
0.1.1acc3bf2ec6801e37e6fee86d637590556d58a32a2https://github.com/samer--/prolog/raw/master/swipe/release/swipe-0.1.1.tgz
0.1.21c48ebbeb8bb9561aef4a11fff01480d9d0ec8502https://github.com/samer--/prolog/raw/master/swipe/release/swipe-0.1.2.tgz
0.2.09e619b2e418fffcf1bf02b1c6f467b33b3aa2b6e4https://github.com/samer--/prolog/raw/master/swipe/release/swipe-0.2.0.tgz
0.2.266e37d3f1f2fcd50e0643984327a8f46529eef762https://github.com/samer--/prolog/raw/master/swipe/release/swipe-0.2.2.tgz
0.2.48c8a051bdd554be8626dc5dde3ebdd51ed097d8712https://github.com/samer--/prolog/raw/master/swipe/release/swipe-0.2.4.tgz
0.2.67df0df09a85377a698abd5e03bbd83bb6c2f667711https://raw.githubusercontent.com/samer--/prolog/master/swipe/release/swipe-0.2.6.tgz

This package provides a mechanism for construction Unix shell pipelines by the composition of terms representing primitive Unix processes. Each process is given a type and the compositon mechanism checks that the types of processes combined in to a pipeline match correctly

Simple usage

:- use_module(library(swipe)).

% define grep as a command taking a stream of T to a stream of T.
% Argument specified with @/1, so will be escaped properly for bash.
swipe:def(grep(Pattern), sh($T >> $T,"grep ~s",[@Pattern])).

% define sort with type stream of T to stream of T
swipe:def(sort, sh($T >> $T,"sort")).

% pipe contents from file spec =|library('swipe.pl')|= (ie using
% file search path mechanism) as type =|pl|= into grep and sort,
% with output to stdout.
:- run(library('swipe.pl')^pl :> grep(module) >> sort).

Change history

Version 0.1.0

Version 0.2.0

Contents of pack "swipe"

Pack contains 5 files holding a total of 56.6K bytes.