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

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

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

Rinat Stryungis
Hello, libraries!

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

It solves the following issue:

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:

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

Best regards, 
Rinat Stryungis.

Libraries mailing list
[hidden email]