Proposal for adding explicit fixity for (~) and (~~)

Rinat Stryungis lazybonesxp at gmail.com
Mon Jul 13 13:20:42 UTC 2020


Hello, libraries!

I want to present a proposal for changes in the `ghc-prim` library.

It solves the following issue:

    https://gitlab.haskell.org/ghc/ghc/-/issues/18252

by adding an explicit fixity for the `(~)` type operator.
It is set equal to 4:

    infix 4 ~, ~~

And there are two reasons for that:

1. These fixities are equal to the corresponding fixities of `(:~:)` and
`(:~~:)`
2. They are less than `GHC.TypeLits.+` and expressions like `5 + 5 ~ 10`
    could be written without brackets.

Also, it looks like the change does not break anything and all existing
tests are passed.

The patch is already implemented and could be seen by the following link:

    https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3610

Also, I've updated documentation and added tests.
Welcome to discuss the change and its implementation.

Best regards,
Rinat Stryungis.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20200713/253fddec/attachment.html>


More information about the Libraries mailing list