{"id":19796754,"url":"https://github.com/retrodev256/instinct","last_synced_at":"2025-07-16T14:34:51.193Z","repository":{"id":261658095,"uuid":"884965055","full_name":"RetroDev256/instinct","owner":"RetroDev256","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-07T18:03:44.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-28T16:12:45.565Z","etag":null,"topics":["zig-package"],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RetroDev256.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-07T17:49:29.000Z","updated_at":"2024-11-07T18:03:47.000Z","dependencies_parsed_at":"2024-11-07T18:49:02.038Z","dependency_job_id":null,"html_url":"https://github.com/RetroDev256/instinct","commit_stats":null,"previous_names":["retrodev256/instinct"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/RetroDev256/instinct","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RetroDev256%2Finstinct","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RetroDev256%2Finstinct/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RetroDev256%2Finstinct/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RetroDev256%2Finstinct/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RetroDev256","download_url":"https://codeload.github.com/RetroDev256/instinct/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RetroDev256%2Finstinct/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265518475,"owners_count":23780967,"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":["zig-package"],"created_at":"2024-11-12T07:21:48.246Z","updated_at":"2025-07-16T14:34:51.088Z","avatar_url":"https://github.com/RetroDev256.png","language":"Zig","readme":"# Instinct\n\nAn ultra simple set of distinct integer types.\n\n### Use cases:\n- You don't want to mix up array index types\n- You want safety checks on an integer that must have a range\n- You want the above, but with a value that represents null\n\n### Types:\n```zig\npub fn OptionalRangedInt(\n    comptime T: type,\n    comptime type_id: u32,\n    comptime range: Range(T),\n    comptime null_value: T,\n) type { ... }\n\npub fn OptionalInt(\n    comptime T: type,\n    comptime type_id: u32,\n    comptime null_value: T,\n) type { ... }\n\npub fn RangedInt(\n    comptime T: type,\n    comptime type_id: u32,\n    comptime range: Range(T),\n) type { ... }\n\npub fn Int(\n    comptime T: type,\n    comptime type_id: u32,\n) type { ... }\n```\n\n### Methods:\nEach type provides the following methods:\n- `init` creates a new distinct type\n- `set` changes the value of the distinct type\n- `val` fetches the value of the distinct type\n- `cast` converts the distinct type to another distinct type\nLimitation: you can't directly cast from an optional to non-optional type","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fretrodev256%2Finstinct","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fretrodev256%2Finstinct","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fretrodev256%2Finstinct/lists"}