Home > other >  Are type signatures now permitted in instance declarations without needing the InstanceSigs language
Are type signatures now permitted in instance declarations without needing the InstanceSigs language

Time:02-14

I've noticed that when using VS Code with the current version of Haskell (GHC 9.2.1 and HLS 1.6.1.0), I no longer receive errors when I write type signatures in my instance declarations, even though I haven't included the {-# LANGUAGE InstanceSigs -#} extension.

Was there a change made to Haskell recently to allow instance signatures by default?

CodePudding user response:

GHC 9.2.1 enables GHC2021 by default.

The GHC2021 language is supported now. It builds on top of Haskell2010, adding several stable and conservative extensions, and removing deprecated ones. It is now also the “default” language set that is active when no other language set, such as Haskell98 or Haskell2010, is explicitly loaded (e.g via Cabal’s default-language). https://downloads.haskell.org/~ghc/9.2.1/docs/html/users_guide/9.2.1-notes.html

GHC2021 language enables InstanceSigs.

https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0380-ghc2021.rst

  • Related