{"id":13726166,"url":"https://github.com/reasonableconsulting/compare","last_synced_at":"2025-10-30T03:01:38.497Z","repository":{"id":143783731,"uuid":"142929060","full_name":"reasonableconsulting/compare","owner":"reasonableconsulting","description":"ReasonML helpers for generating cmp functions.","archived":false,"fork":false,"pushed_at":"2018-07-30T21:37:18.000Z","size":9,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-02T07:31:53.041Z","etag":null,"topics":["comparator","compare","ocaml","reason","reasonml","sort","sorting"],"latest_commit_sha":null,"homepage":null,"language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reasonableconsulting.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-07-30T21:16:42.000Z","updated_at":"2020-12-11T11:52:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"f8affb75-0ed6-4537-a32c-8bc54e230fb6","html_url":"https://github.com/reasonableconsulting/compare","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/reasonableconsulting%2Fcompare","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reasonableconsulting%2Fcompare/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reasonableconsulting%2Fcompare/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reasonableconsulting%2Fcompare/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reasonableconsulting","download_url":"https://codeload.github.com/reasonableconsulting/compare/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238950485,"owners_count":19557533,"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":["comparator","compare","ocaml","reason","reasonml","sort","sorting"],"created_at":"2024-08-03T01:02:54.513Z","updated_at":"2025-10-30T03:01:38.373Z","avatar_url":"https://github.com/reasonableconsulting.png","language":"OCaml","funding_links":[],"categories":["OCaml"],"sub_categories":[],"readme":"# compare\n\nReasonML helpers for generating cmp functions.\n\n## Usage\n\n```reason\nmodule Comparator =\n  Belt.Id.MakeComparable({\n    type t = string;\n\n    let cmp =\n      Compare.concat([\n        Compare.by(key =\u003e key),\n        Compare.by(key =\u003e String.length(key)),\n      ]);\n  });\n\ntype t = Belt.Map.t(Comparator.t, int, Comparator.identity);\n\nlet ourMap = Belt.Map.fromArray(~id=(module Comparator), [|\n  (\"a\", 1), (\"b\", 2), (\"ab\", 3)\n|]);\n\nBelt.Map.forEach(ourMap, Js.log2);\n```\n\n## License\n\nMPL-2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freasonableconsulting%2Fcompare","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freasonableconsulting%2Fcompare","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freasonableconsulting%2Fcompare/lists"}