Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Hartmann pipes in Erlang
Erlang
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
docs
include
src
.codepath
.project
LICENSE.TXT
README.textile

README.textile

An implementation of Hartmann pipelines in Erlang. In short, they are extensions of the usual Unix pipes that allow building graphs of programs and thus one can implement a full data-flow environment.

Read more in the wiki.

Examples

Code example with current API, counting the number of lines in a file containing “=” and the number of lines that don’t contain it:

    P1 = pipes:pipe(cat, [FileName]),
    P2 = pipes:pipe(lines),
    P4 = pipes:pipe(grep, ["="]),
    P3 = pipes:pipe(count),
    P5 = pipes:pipe(count),
    
    pipes:connect([P1, P2, P4, P3]),
    pipes:connect({P4, nomatch}, P5),
    
    {WithEquals, WithoutEquals} = {pipes:get_result(P3), pipes:get_result(P5)}.

This will look in the future similar to the Unix-ish

    {WithEquals, WithoutEquals} = pipes:build(
      " cat $FileName | 
        lines | 
        g: grep \"=\" |
        count > $1
      ",
      " :g/nomatch |
        count > $2
      "
    ).
Something went wrong with that request. Please try again.