{"id":18376338,"url":"https://github.com/fmind/setop","last_synced_at":"2025-04-11T04:43:32.172Z","repository":{"id":56877746,"uuid":"175448418","full_name":"fmind/setop","owner":"fmind","description":" Perform set operations on files","archived":false,"fork":false,"pushed_at":"2019-03-13T16:12:42.000Z","size":3775,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T04:43:27.607Z","etag":null,"topics":["command-line","files","haskell","operations","set"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fmind.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-13T15:27:14.000Z","updated_at":"2019-11-28T15:32:30.000Z","dependencies_parsed_at":"2022-08-20T23:10:34.414Z","dependency_job_id":null,"html_url":"https://github.com/fmind/setop","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/fmind%2Fsetop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmind%2Fsetop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmind%2Fsetop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmind%2Fsetop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fmind","download_url":"https://codeload.github.com/fmind/setop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248345281,"owners_count":21088242,"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":["command-line","files","haskell","operations","set"],"created_at":"2024-11-06T00:22:55.783Z","updated_at":"2025-04-11T04:43:32.153Z","avatar_url":"https://github.com/fmind.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Setop: Perform set operations on files\n\n[![hackage](https://img.shields.io/hackage/v/setop.svg)](https://hackage.haskell.org/package/setop)\n\n## Rationale\n\n[Set operations](https://en.wikipedia.org/wiki/Set_(mathematics)#Basic_operations) are a convenient solution to common problems:\n\n- create a list of tasks without duplicates (set union)\n- filter tasks done out of tasks to do (set difference)\n- find common elements in a database (set intersection)\n- and remove theses elements (set symmetric difference)\n\nSetop helps you run these set operations on your files.\n\n## Usage\n\nLet's introduce two line-separated files: `A.txt` and `B.txt`.\n\n`A.txt` contains all numbers from 0 to 5 included\n```text\n0\n1\n2\n3\n4\n5\n```\n\n`B.txt` contains all even numbers from 0 to 8 included\n```text\n0\n2\n4\n6\n8\n```\n\n### Set Union (U/Union):\n\n```bash\n$ setop A.txt U B.txt\n0\n1\n2\n3\n4\n5\n6\n8\n```\n\n### Set Difference (D/Diff):\n\n```bash\n$ setop A.txt D B.txt\n1\n3\n5\n```\n\n### Set Intersection (I/Inter):\n\n```bash\n$ setop A.txt I B.txt\n0\n2\n4\n```\n\n### Set Symmetric Difference (J/Disj):\n\n```bash\n$ setop A.txt J B.txt\n1\n3\n5\n6\n8\n```\n\n### Reading A.txt from STDIN:\n\n```bash\n$ cat A.txt | setop STDIN Diff B.txt\n0\n2\n4\n```\n\n### Reading B.txt from STDIN:\n\n```bash\n$ cat B.txt | setop A.txt Disj STDIN\n1\n3\n5\n6\n8\n```\n\n## Notes\n\n- the resulting set is __sorted in ascending order__\n- some set operations are __not commutative__ (e.g. A Diff B /= B Diff A)\n- Setop is based on [optparse-applicative](https://github.com/pcapriotti/optparse-applicative) and supports [bash/fish/zsh completions](https://github.com/pcapriotti/optparse-applicative#bash-zsh-and-fish-completions)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffmind%2Fsetop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffmind%2Fsetop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffmind%2Fsetop/lists"}