Coder Social home page Coder Social logo

erl-pipes's Introduction

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
      "
    ).

erl-pipes's People

Contributors

vladdu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.