{"id":20177820,"url":"https://github.com/tfc/purescript-ziprecord","last_synced_at":"2025-03-03T05:24:12.480Z","repository":{"id":137344956,"uuid":"593125804","full_name":"tfc/purescript-ziprecord","owner":"tfc","description":"Purescript Example: How to map a binary function generically over (nested) records","archived":false,"fork":false,"pushed_at":"2023-02-07T08:01:52.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-13T16:47:47.065Z","etag":null,"topics":["meta-programming","purescript","row-types"],"latest_commit_sha":null,"homepage":"","language":"Nix","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/tfc.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-25T09:51:39.000Z","updated_at":"2023-01-25T13:19:14.000Z","dependencies_parsed_at":"2023-03-14T13:15:25.360Z","dependency_job_id":null,"html_url":"https://github.com/tfc/purescript-ziprecord","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/tfc%2Fpurescript-ziprecord","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tfc%2Fpurescript-ziprecord/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tfc%2Fpurescript-ziprecord/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tfc%2Fpurescript-ziprecord/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tfc","download_url":"https://codeload.github.com/tfc/purescript-ziprecord/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241612749,"owners_count":19990874,"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":["meta-programming","purescript","row-types"],"created_at":"2024-11-14T02:17:32.734Z","updated_at":"2025-03-03T05:24:12.475Z","avatar_url":"https://github.com/tfc.png","language":"Nix","readme":"# Purescript example: How to Zip Records with a Binary Function\n\nGiven an example typeclass `Foo` that provides a function `foo :: a -\u003e a -\u003e a`\nfor all members of the type class, how to make all possible records part of\nthis type class (Assuming all record members are themselves part of `Foo`)?\n\nThis is the target functionality:\n\n```purescript\n\u003e import ZipRecord\n\n-- simple merging of type class members Int, Number, and String:\n\n\u003e foo 1 2\n3\n\u003e foo 1.0 2.0\n3.0\n\u003e foo \"foo\" \"bar\"\n\"foobar\"\n\n-- Now let's merge records that have Int, Number, and String values:\n\n\u003e r1 = { a: 1, b: 1.0, c: { d: \"foo\", e: 10.0 } }\n\u003e r2 = { a: 2, b: 2.0, c: { d: \"bar\", e: 20.0 } }\n\n\u003e zipRecord r1 r2\n{ a: 3, b: 3.0, c: { d: \"foobar\", e: 30.0 } }\n```\n\n## How to build and test\n\nEither install `node`, `spago`, and `purescript` yourself, or just run a\n[nix shell](https://nixos.org/download.html):\n\n```sh\n$ nix-shell\n\n# build the product and run the unit tests\n$ spago test\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftfc%2Fpurescript-ziprecord","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftfc%2Fpurescript-ziprecord","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftfc%2Fpurescript-ziprecord/lists"}