Giter VIP home page Giter VIP logo

Comments (2)

pouriya avatar pouriya commented on May 30, 2024

In my experiences in some code reviews in some big or small projects like OTP, Ejabberd, ... . Erlang developers often don't like to use -- operator in produnction env. (at least in main parts of code which should be run for many times). so when you include this lib's header file, Only you can use -- operator in tuples, lists or maps for seeing difference of two lists.
example:

...
-include_lib("pipeline/include/pipeline).

test() ->
    {Diff} = {[1,2,3] -- [1]}. % Diff = [2,3]

technically in compile time, it does not search in tuples, lists, maps for pipelining.

from pipeline.

pouriya avatar pouriya commented on May 30, 2024

I'm still working on new library which supports pipeline and other function compositions.
For example writing:

?bool_exec( a() -- b() -- c() )

will equal to writing

case a() of
    true ->
        case b() of
            true ->
                c();
            false ->
                false
        end;
    false ->
        false
end.

or writing:

?ok_pipeline( a() -- b() -- c() )

will equal to writing:

case a() of
    {ok, Result1} ->
        case b(Result1) of
            {ok, Result2} ->
                c(Result2);
            {error, _}=Err ->
                Err
        end;
    {error, _}=Err ->
        Err
end.

If you need just pipelining, use this and you cant use -- operator with its default usage in every place. In next library which supports pipeline too, i will push it in a macro like ?pipeline, then you can use -- operator outside that macro with its default usage.

from pipeline.

Related Issues (3)

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.