News for hackers. Stuff that matters.
Re:Upcoming/proposed breaking changes to Haskell by retrac on Wednesday November 17, 2021 @10:52AM (#29254658)
I find it delightful, really.

    a /= b = not (a == b) 
is the kind of thing that makes Haskell beautiful. Slowly ascending to purity. Didn't break anything of mine, though.
Re:Upcoming/proposed breaking changes to Haskell by jez on Wednesday November 17, 2021 @02:43PM (#29257934)
That is already how it's defined in the `base` package right now though:

    class  Eq a  where
        (==), (/=)           :: a -> a -> Bool
        x /= y               = not (x == y)
        x == y               = not (x /= y)
https://www.stackage.org/haddock/lts-18.17/ghc-prim-0.6.1/sr...

The way this works is that when you implement the `Eq` typeclass for a type, you can provide more specific implementations. A minimal complete implementation is to implement either == or /= for your type, and the other definition will apply.

The way this breaks existing code (iiuc) is that as a top-level function, if you have imported the `Eq` type class but haven't imported the `Prelude` module implicitly (on by default but can be turned off), you will not have `/=` in scope anymore.

I think people are upset by this less because of how hard it would be to fix, but more because of how it acts as a sort of signaling change ("they're willing to break my code for this, which I didn't want, but not for X which I did"). The most common value of X I've seen is removing or reworking the partial functions in the Prelude (e.g., head / tail on `[a]` raising an exception instead of returning `Maybe a`).

Re:Upcoming/proposed breaking changes to Haskell by toomanydoubts on Sunday November 21, 2021 @10:56AM (#29297106)
I had never looked at the definition of Eq. Interesting. How are these operators expanded and evaluated without falling into infinite recursion?
Re:Upcoming/proposed breaking changes to Haskell by olliej on Wednesday November 17, 2021 @08:08PM (#29260969)
that's a default implementation, however it's not true for every type, hence custom implementations
Re:Upcoming/proposed breaking changes to Haskell by kreetx on Thursday November 18, 2021 @03:49AM (#29263455)
Right. With the current situation you could define a custom /= for every type. In the new situation /= is a regular function which is defined as `a /= b = not (a == b)` and you wouldn't be able to redefine it.