Quo vadit GHC2023?

Semi-off, apologies in advance, but this thread had me trying GHC2021 and ran into the following:

{-# LANGUAGE GHC2021 #-}
module Main where
import Servant.API (type (:>))
main :: IO ()
main = undefined

gives:

~/w/test $ ghc Main.hs
bin/Main.hs:4:26: error:
    Illegal keyword 'type' (use ExplicitNamespaces to enable)
  |
3 | import Servant.API (type (:>))
  |                         ^^^^

even though GHC2021 includes TypeOperators:
https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/control.html#extension-GHC2021
which implies ExplicitNamespaces:
https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/type_operators.html#extension-TypeOperators

If I do add {-# LANGUAGE TypeOperators #-} to the above then it compiles just fine:

~/w/test $ ghc Main.hs 
[1 of 1] Compiling Main             ( Main.hs, Main.o )
Linking Main ...

Anyone knows what I’m doing wrong?

1 Like

That sounds like a bug, I would recommend opening a new issue on the GHC GitLab.

Edit: Oh it seems people are already aware, but I don’t know what the current status is. Maybe they’re just following the GHC2021 proposal to the letter (which doesn’t include ExplicitNamespaces).

1 Like

Oh, that’s a bit embarrassing. I find labyrinth of language extension implications often confusing.

I started a discussion on the committee github.

1 Like