{"id":40703520,"url":"https://github.com/sourcevault/flip","last_synced_at":"2026-01-21T12:08:01.042Z","repository":{"id":57135203,"uuid":"62912475","full_name":"sourcevault/flip","owner":"sourcevault","description":"flip all arguments for a function","archived":false,"fork":false,"pushed_at":"2016-07-10T20:29:25.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-18T14:19:19.881Z","etag":null,"topics":["curry","ramda"],"latest_commit_sha":null,"homepage":null,"language":"LiveScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sourcevault.png","metadata":{"files":{"readme":"readMe.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-08T19:29:49.000Z","updated_at":"2016-07-08T20:39:50.000Z","dependencies_parsed_at":"2022-09-03T15:01:09.435Z","dependency_job_id":null,"html_url":"https://github.com/sourcevault/flip","commit_stats":null,"previous_names":["partially-applied/flip"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sourcevault/flip","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcevault%2Fflip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcevault%2Fflip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcevault%2Fflip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcevault%2Fflip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sourcevault","download_url":"https://codeload.github.com/sourcevault/flip/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcevault%2Fflip/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28632781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T04:47:28.174Z","status":"ssl_error","status_checked_at":"2026-01-21T04:47:22.943Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["curry","ramda"],"created_at":"2026-01-21T12:08:00.366Z","updated_at":"2026-01-21T12:08:01.033Z","avatar_url":"https://github.com/sourcevault.png","language":"LiveScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n```haskell\nflip :: (a -\u003e b -\u003e c ...... x -\u003e y -\u003e z) -\u003e (z -\u003e y -\u003e x ...... c -\u003e b -\u003e a)\n```\n###Install\n\n```npm install @partially-applied/flip```\n\n\n###Usage\n```livescript\n\nflip = require '@partially-applied/flip'\n\nf = (a,b,c) -\u003e (a + b)*c # generic functions\n\nopposite = flip f\n\nf 1,2,3 # (1 + 2)*3 = 9\n\nopposite 1,2,3 # (3 + 2)*1 = 5\n\n# curried by default \n\nflip f,1,2,3 # (3 + 2)*1 = 5\n\nonly-a = opposite 1 # [Function]\n\nonly-a-b = only-a 2 # [Function]\n\nonly-a-b 3 # (3 + 2)*1 = 5\n```\n\n\n### Why\n\n1. Ramda [`flip`](http://ramdajs.com/docs/#flip) only flips the first two arguments.\n\n2. flip was written to bring another API change to Ramda. Ramda [`compose`](http://ramdajs.com/docs/#compose) composes a function from right to left. \n\n```livescript\n\n_ = require 'ramda'\n\nf = _.curry (x,y) -\u003e x + y\n\ng = _.curry (x,y) -\u003e x*y\n\nh = _.compose (f 1),(g 2) # h = (x) -\u003e 2*x + 1\n\nh 5 # 11\n\nflip = require '@partially-applied/flip'\n\n\nj = (flip _.compose) (f 1),(g 2) # j = (x) -\u003e (1 + x)*2 \n\nj 5  # 12\n\n```\n\n**why would we need to shift the order of compose ?**\n\ngood question, it is to assist in using `livescript` do syntax:\n\n\n```livescript\n\n_ = require 'ramda'\n\nflip = requre '@partially-applied/flip'\n\ncompose = flip _.compose\n\nadd = _.curry (x,y) -\u003e x + y\n\nmultiply = _.curry (x,y) -\u003e x*y\n\nh = compose do\n    add 1\n    multiply 2\n    add 2\n    multiply 4\n    add 3\n\n\nh # h = (x) -\u003e ((1 + x)*2 + 2)*4 + 3\n\n```\n\n\n\nFor more information about why use `compose` or `ramda` I suggest reading \n[Chapter 5:Coding by Compose](https://github.com/MostlyAdequate/mostly-adequate-guide/blob/master/ch5.md)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourcevault%2Fflip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsourcevault%2Fflip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourcevault%2Fflip/lists"}