{"id":18000160,"url":"https://github.com/cjen07/param_pipe","last_synced_at":"2025-03-26T07:32:04.049Z","repository":{"id":62430263,"uuid":"97606387","full_name":"cjen07/param_pipe","owner":"cjen07","description":"parameterized pipe in elixir: |n\u003e","archived":false,"fork":false,"pushed_at":"2018-10-15T07:49:45.000Z","size":13,"stargazers_count":15,"open_issues_count":0,"forks_count":3,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-21T11:11:13.463Z","etag":null,"topics":["elixir","metaprogramming","pipe","pipeline"],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cjen07.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-18T14:12:38.000Z","updated_at":"2023-09-01T10:53:16.000Z","dependencies_parsed_at":"2022-11-01T20:21:51.797Z","dependency_job_id":null,"html_url":"https://github.com/cjen07/param_pipe","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cjen07%2Fparam_pipe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cjen07%2Fparam_pipe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cjen07%2Fparam_pipe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cjen07%2Fparam_pipe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cjen07","download_url":"https://codeload.github.com/cjen07/param_pipe/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245611765,"owners_count":20643892,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elixir","metaprogramming","pipe","pipeline"],"created_at":"2024-10-29T23:09:56.333Z","updated_at":"2025-03-26T07:32:03.602Z","avatar_url":"https://github.com/cjen07.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ParamPipe\n\n## Prerequisite\n* Erlang v21.0\n* Elixir v1.7.3\n\n## Installation\n\n```elixir\ndef deps do\n  [\n    {:param_pipe, \"~\u003e 0.2.0\"}\n  ]\nend\n```\n\n## Tests\n\n```elixir\n  mix test\n```\n\n## parameterized pipe in elixir: |n\u003e\n\n```elixir\n  use ParamPipe\n\n  def foo(a, b, c) do\n    a*2 + b*3 + c*4\n  end\n\n  def bar0() do\n    100 |\u003e div(5) |\u003e div(2) # 10\n  end\n\n  # negative n in |n\u003e is supported\n\n  def bar1() do\n    1 |0\u003e foo(0, 0) |1\u003e foo(0, 0) |-1\u003e foo(0, 0) # 24\n  end\n\n  # mixed usage with |\u003e is supported\n\n  def bar2() do\n    1\n    |\u003e foo(0, 0) # 2\n    |1\u003e foo(0, 0) # 6\n    |\u003e div(2) # 3\n    |\u003e div(3) # 1\n    |2\u003e foo(0, 0) # 4\n    |\u003e (fn x -\u003e foo(0, 0, x) end).() # 16\n    |-1\u003e foo(0, 0) # 64\n  end\n\n  # assigning a variable within the pipe operator is supported\n\n  def bar3() do\n    h =\n      1\n      |-2\u003e foo(0, 0) = f # 3 = f\n      |-1\u003e foo(0, 0) # 12\n      |\u003e foo(0, 0) = g # 24 = g\n      |-1\u003e foo(0, 0) # 96\n      |\u003e foo(f, g) # 297\n    h\n  end\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcjen07%2Fparam_pipe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcjen07%2Fparam_pipe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcjen07%2Fparam_pipe/lists"}