{"id":23651474,"url":"https://github.com/athanclark/purescript-tuples-native","last_synced_at":"2025-11-15T17:30:16.160Z","repository":{"id":25676216,"uuid":"106061819","full_name":"athanclark/purescript-tuples-native","owner":"athanclark","description":"Implementation of tuples as a flat heterogeneous array, for FFI","archived":false,"fork":false,"pushed_at":"2024-04-15T17:53:24.000Z","size":19,"stargazers_count":15,"open_issues_count":3,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-28T17:09:22.156Z","etag":null,"topics":["arrays","heterogeneous-data","purescript","typelevel-programming"],"latest_commit_sha":null,"homepage":null,"language":"PureScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/athanclark.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-10-07T00:49:48.000Z","updated_at":"2024-12-21T20:39:14.000Z","dependencies_parsed_at":"2022-07-27T05:30:07.984Z","dependency_job_id":null,"html_url":"https://github.com/athanclark/purescript-tuples-native","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athanclark%2Fpurescript-tuples-native","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athanclark%2Fpurescript-tuples-native/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athanclark%2Fpurescript-tuples-native/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athanclark%2Fpurescript-tuples-native/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/athanclark","download_url":"https://codeload.github.com/athanclark/purescript-tuples-native/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239609683,"owners_count":19667993,"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":["arrays","heterogeneous-data","purescript","typelevel-programming"],"created_at":"2024-12-28T16:37:53.579Z","updated_at":"2025-11-15T17:30:16.107Z","avatar_url":"https://github.com/athanclark.png","language":"PureScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# purescript-tuples-native\n\nThis library defines tuple data types that are represented under-the-hood as heterogeneous arrays to JavaScript - useful for\nforeign interfaces. A set of `xt` functions are exposed to translate these native Tuples into Purescript pairs\nor Nested tuples. So for example:\n\n```purescript\n-- Main.purs\nimport Data.Tuple.Native (T2, xt)\nimport Data.Tuple (Tuple)\n\nforeign import lenTupleImpl :: String -\u003e T2 String Int\n\nlenTuple :: String -\u003e Tuple String Int\nlenTuple s = xt $ lenTupleImpl s\n```\n\nCould let you wrap this Javascript function\n```javascript\n\"use strict\";\nfunction lenTuple (string) {\n    return [string, string.length]\n}\nexports.lenTupleImpl = lenTuple\n```\n\nYou can also extract indidual elements directly from the Native tuple using `prj`.\n\n```purescript\nimport Data.Tuple.Native (T3, t3, prj)\nimport Data.TypeLevel.Num.Reps (d0, d1, d2)\n\nxs :: T3 String Int Boolean\nxs = t3 \"foo\" 13 false\n\nprj d0 xs == \"foo\" -- true\nprj d1 xs == 13 -- true\nprj d2 xs == false -- true\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fathanclark%2Fpurescript-tuples-native","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fathanclark%2Fpurescript-tuples-native","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fathanclark%2Fpurescript-tuples-native/lists"}