{"id":21121371,"url":"https://github.com/gregorias/safe-money","last_synced_at":"2025-03-14T11:23:52.503Z","repository":{"id":188176788,"uuid":"669842474","full_name":"gregorias/safe-money","owner":"gregorias","description":"a prototype library for safe money representation","archived":false,"fork":false,"pushed_at":"2023-11-06T20:45:11.000Z","size":27,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-06T02:41:16.703Z","etag":null,"topics":["existential-types","haskell","type-safe"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gregorias.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}},"created_at":"2023-07-23T15:54:43.000Z","updated_at":"2023-11-05T16:14:33.000Z","dependencies_parsed_at":"2023-08-14T06:11:08.147Z","dependency_job_id":"ed3ec845-abff-4d52-a3a4-3d30a40045d1","html_url":"https://github.com/gregorias/safe-money","commit_stats":null,"previous_names":["gregorias/safe-money"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregorias%2Fsafe-money","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregorias%2Fsafe-money/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregorias%2Fsafe-money/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregorias%2Fsafe-money/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gregorias","download_url":"https://codeload.github.com/gregorias/safe-money/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243566365,"owners_count":20311866,"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":["existential-types","haskell","type-safe"],"created_at":"2024-11-20T03:48:29.647Z","updated_at":"2025-03-14T11:23:52.464Z","avatar_url":"https://github.com/gregorias.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# safe-money\n\nThis is an experimental Haskell library that explores creating a safe type for\nrepresenting monetary amounts.\n\nI set up the following requirements:\n\n1. The type should allow declaring the number of fractional digits.\n2. The type should allow declaring the amount's currency and prevent operations\n   on monetary amounts of differring currencies.\n3. Currency should only allow valid currencies.\n\n## Unsolved problems\n\n```haskell\n-- Can I do not forgetful currency to witness cast?\ncurrencyToWitness :: (c :: Currency) -\u003e CurrencyWitness c\n-- The above doesn't work, because (c :: Currency) says that currencyToWitness\n-- accepts a paramater of type c, which is a value (of type Currency), so it\n-- doesn't work.\n```\n\n## See also\n\n- [How do I efficiently add existentially typed safe money values?](https://stackoverflow.com/questions/77429592/how-do-i-efficiently-add-existentially-typed-safe-money-values)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgregorias%2Fsafe-money","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgregorias%2Fsafe-money","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgregorias%2Fsafe-money/lists"}