{"id":16717490,"url":"https://github.com/firobe/ocaml-stdint-literals","last_synced_at":"2025-07-29T19:35:03.381Z","repository":{"id":74791621,"uuid":"389207299","full_name":"Firobe/ocaml-stdint-literals","owner":"Firobe","description":"Small PPX for fixed size integer literals","archived":false,"fork":false,"pushed_at":"2022-11-12T23:56:54.000Z","size":8,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T07:50:20.279Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"OCaml","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/Firobe.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":"2021-07-24T21:42:03.000Z","updated_at":"2024-12-06T14:07:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"4bf1ba9f-f70f-4752-9bf2-cc085cc76fd0","html_url":"https://github.com/Firobe/ocaml-stdint-literals","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Firobe%2Focaml-stdint-literals","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Firobe%2Focaml-stdint-literals/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Firobe%2Focaml-stdint-literals/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Firobe%2Focaml-stdint-literals/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Firobe","download_url":"https://codeload.github.com/Firobe/ocaml-stdint-literals/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248173434,"owners_count":21059595,"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":[],"created_at":"2024-10-12T21:32:09.403Z","updated_at":"2025-04-10T06:43:18.403Z","avatar_url":"https://github.com/Firobe.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stdint literals\n\nThis small PPX rewriter allows you to write literals for some of\n[stdint](https://github.com/andrenth/ocaml-stdint)'s types using\nsingle-character suffixes on integers:\n\n- `u` denotes an `uint8`\n- `U` denotes an `uint16`\n- `i` denotes an `uint32`\n- `I` denotes an `uint64`\n- `w` denotes an `uint128`\n- `s` denotes an `int8`\n- `S` denotes an `int16`\n- `l` denotes an `int32` (default behavior in OCaml)\n- `L` denotes an `int64` (default behavior in OCaml)\n- `W` denotes an `int128`\n\n## Installation\n\nRun `opam install stdint-literals`\n\n## Usage\n\nAdd `stdint-literals` in your `dune` file as follows:\n\n```\n(executable\n  (name example)\n  (preprocess (pps stdint-literals))\n  (libraries stdint))\n```\n\n## Example\n\n```ocaml\nlet simple_literals =\n  let i8 = 42u in\n  Format.printf \"%a\\n\" Stdint.Uint8.printer i8 ;\n  let i16 = 42U in\n  Format.printf \"%a\\n\" Stdint.Uint16.printer i16 ;\n  let s8 = 42s in\n  Format.printf \"%a\\n\" Stdint.Int8.printer s8 ;\n  let s16 = 42S in\n  Format.printf \"%a\\n\" Stdint.Int16.printer s16\n\nlet hex_literals = \n  Format.printf \"%a\\n\" Stdint.Uint16.printer_hex Stdint.Uint16.(0xDDAAU + 0xAADDU)\n```\n\nOf course, this also work on hexadecimal (or octal) literals.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirobe%2Focaml-stdint-literals","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffirobe%2Focaml-stdint-literals","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirobe%2Focaml-stdint-literals/lists"}