{"id":20303890,"url":"https://github.com/billstclair/elm-bitwise-infix","last_synced_at":"2026-05-11T15:15:04.014Z","repository":{"id":57674851,"uuid":"70806331","full_name":"billstclair/elm-bitwise-infix","owner":"billstclair","description":"Infix versions of Elm's Bitwise module functions","archived":false,"fork":false,"pushed_at":"2016-11-14T20:54:54.000Z","size":4,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-02T19:43:05.010Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Elm","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/billstclair.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-13T12:54:58.000Z","updated_at":"2017-01-10T23:20:32.000Z","dependencies_parsed_at":"2022-09-02T15:01:30.400Z","dependency_job_id":null,"html_url":"https://github.com/billstclair/elm-bitwise-infix","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/billstclair%2Felm-bitwise-infix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/billstclair%2Felm-bitwise-infix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/billstclair%2Felm-bitwise-infix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/billstclair%2Felm-bitwise-infix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/billstclair","download_url":"https://codeload.github.com/billstclair/elm-bitwise-infix/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241801257,"owners_count":20022389,"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-11-14T16:41:35.202Z","updated_at":"2026-05-11T15:15:03.975Z","avatar_url":"https://github.com/billstclair.png","language":"Elm","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Infix versions of Elm's Bitwise module functions\n\nWhen converting code from JavaScript, it's a real pain to change all the bitwise operators from infix to prefix. This module makes that unnecessary. You just add a twiddle prefix (~) to the operators.\n\n```Bitwise.not``` has no infix operator, since Elm doesn't provide single argument \"infix\" operators. So I named it ```BitwiseInfix.lognot```, in honor of its Common Lisp name.\n\nAll the operators are left associative.\n\nI mirrored the [JavaScript precedences](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence), putting the shift operators at lower precedence than arithmetic, but higher than comparison, and the others lower than comparison.\n\n```(~\u003c\u003c)```, ```(~\u003e\u003e)```, and ```(~\u003e\u003e\u003e)``` have a precedence of 5.\u003cbr/\u003e\n```(~\u0026)``` has a precedence of 3.\u003cbr/\u003e\n```(~^)``` has a precedence of 2.\u003cbr/\u003e\n```(~|)``` has a precedence of 1.\n\nExamples:\n\n```\nimport BitwiseInfix exposing (..)\n\n3 ~\u0026 1 ~| 4 ~\u0026 12     -- 5\n3 ~\u0026 (1 ~| 4) ~\u0026 12   -- 0\n2 ~\u003c\u003c 1 ~| 2          -- 6\n2 ~\u003c\u003c (1 ~| 2)        -- 16\n1 ~| 2 ~^ 2 ~| 1      -- 1\n(1 ~| 2) ~^ (2 ~| 1)  -- 0\n3 ~\u0026 1 ~^ 4 ~\u0026 12     -- 5\n3 ~\u0026 (1 ~^ 4) ~\u0026 12   -- 0\n9 ~\u003e\u003e 1 ~\u003c\u003c 1         -- 8\n9 ~\u003e\u003e (1 ~\u003c\u003c 1)       -- 2\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbillstclair%2Felm-bitwise-infix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbillstclair%2Felm-bitwise-infix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbillstclair%2Felm-bitwise-infix/lists"}