{"id":23115429,"url":"https://github.com/jcaesar/dhall-div","last_synced_at":"2026-01-19T14:02:34.258Z","repository":{"id":146511706,"uuid":"303590840","full_name":"jcaesar/dhall-div","owner":"jcaesar","description":null,"archived":false,"fork":false,"pushed_at":"2020-10-28T10:52:21.000Z","size":3,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-04T01:12:08.135Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dhall","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/jcaesar.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":"2020-10-13T04:48:04.000Z","updated_at":"2024-06-17T19:12:12.000Z","dependencies_parsed_at":"2023-07-09T16:15:15.297Z","dependency_job_id":null,"html_url":"https://github.com/jcaesar/dhall-div","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/jcaesar/dhall-div","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcaesar%2Fdhall-div","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcaesar%2Fdhall-div/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcaesar%2Fdhall-div/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcaesar%2Fdhall-div/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jcaesar","download_url":"https://codeload.github.com/jcaesar/dhall-div/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcaesar%2Fdhall-div/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28571556,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T12:50:50.164Z","status":"ssl_error","status_checked_at":"2026-01-19T12:50:42.704Z","response_time":67,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-12-17T03:41:22.342Z","updated_at":"2026-01-19T14:02:34.238Z","avatar_url":"https://github.com/jcaesar.png","language":"Dhall","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Division for Dhall\n\nYou're excited for a new bright day.\nYou've been tricked into using the using dhall, the newest esolang on the block, in your mission-critical production system.\nYou think to yourself: Ope, I'd like to create a config file where I dimension this volume size to be 30% larger than that input parameter, for safety and giggles.\nYou notice, your since-today favourite language dhall doesn't allow doing calculations on floats, and naturals only have addition, substraction, and multiplication.\nBut you don't fret. Because this repository exists!\n\n## Features\nA division implementation for dhall featuring\n* blazingly fast\n(The ~640000 small integer divisions in the test suite are executed in 10 seconds! Division was never faster!)\n* slim\n(Only 69 lines of code! Division was never slicker!)\n* correct\n(Only tested for values \u003c800! Division was never correcter!)\n* applicable to large numbers\n(Dividends up to 2^2^23, but unless you have more than 64 GB of memory, you're probably limited to 2^2^19 - I don't know what kind of sarcastic remark I could make to people that are bothered by this limitation.)\n\nSpecifically, this implements long division and for `n / m`, returns a pair of values `q`, `r`, such that `m * q + r ≡ n`, where `r` is only larger than `m` if `m` is either 0 or `n / m` is larger than 2^2^23.\n\n## Usage\n```dhall\nlet Natural/div = λ(n : Natural) → λ(m : Natural) → \n    let div = https://github.com/jcaesar/dhall-div/releases/download/1/quotient.dhall sha256:d6a994f4b431081e877a0beac02f5dcc98f3ea5b027986114487578056cb3db9\n    in (div n m).q\nin  Natural/div 42 7\n```\n\n## Endorsements\n[@profpatsch](https://github.com/profpatsch)\n\u003e I mean, do what floats your boat, but in like any kind of production environment I wouldn’t accept that :)\n\n## Related\n* Stackoverflow question that nerdsniped me to do this: https://stackoverflow.com/questions/64116125/integer-division-in-dhall\n* Dhall forum discussion: https://discourse.dhall-lang.org/t/natural-division/366/3\n* x / 0 = 0. Go away. https://www.hillelwayne.com/post/divide-by-zero/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcaesar%2Fdhall-div","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjcaesar%2Fdhall-div","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcaesar%2Fdhall-div/lists"}