Introduce ListTuplePuns extension
This implements Proposal 0475, introducing the `ListTuplePuns` extension which is enabled by default. Disabling this extension makes it invalid to refer to list, tuple and sum type constructors by using built-in syntax like `[Int]`, `(Int, Int)`, `(# Int#, Int# #)` or `(# Int | Int #)`. Instead, this syntax exclusively denotes data constructors for use with `DataKinds`. The conventional way of referring to these data constructors by prefixing them with a single quote (`'(Int, Int)`) is now a parser error. Tuple declarations have been moved to `GHC.Tuple.Prim` and the `Solo` data constructor has been renamed to `MkSolo` (in a previous commit). Unboxed tuples and sums now have real source declarations in `GHC.Types`. Unit and solo types for tuples are now called `Unit`, `Unit#`, `Solo` and `Solo#`. Constraint tuples now have the unambiguous type constructors `CTuple<n>` as well as `CUnit` and `CSolo`, defined in `GHC.Classes` like before. A new parser construct has been added for the unboxed sum data constructor declarations. The type families `Tuple`, `Sum#` etc. that were intended to provide nicer syntax have been omitted from this change set due to inference problems, to be implemented at a later time. See the MR discussion for more info. Updates the submodule utils/haddock. Updates the cabal submodule due to new language extension. Metric Increase: haddock.base Metric Decrease: MultiLayerModulesTH_OneShot size_hello_artifact Proposal document: https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0475-tuple-syntax.rst Merge request: ghc/ghc!8820 Tracking ticket: ghc/ghc#21294
Showing
- compiler/GHC/Builtin/Names.hs 8 additions, 56 deletionscompiler/GHC/Builtin/Names.hs
- compiler/GHC/Builtin/Types.hs 173 additions, 49 deletionscompiler/GHC/Builtin/Types.hs
- compiler/GHC/Builtin/Types.hs-boot 1 addition, 0 deletionscompiler/GHC/Builtin/Types.hs-boot
- compiler/GHC/Builtin/Uniques.hs 22 additions, 0 deletionscompiler/GHC/Builtin/Uniques.hs
- compiler/GHC/Core/Predicate.hs 1 addition, 1 deletioncompiler/GHC/Core/Predicate.hs
- compiler/GHC/Driver/DynFlags.hs 7 additions, 4 deletionscompiler/GHC/Driver/DynFlags.hs
- compiler/GHC/Driver/Session.hs 1 addition, 0 deletionscompiler/GHC/Driver/Session.hs
- compiler/GHC/Hs/Type.hs 2 additions, 2 deletionscompiler/GHC/Hs/Type.hs
- compiler/GHC/Iface/Type.hs 99 additions, 62 deletionscompiler/GHC/Iface/Type.hs
- compiler/GHC/Parser.y 48 additions, 32 deletionscompiler/GHC/Parser.y
- compiler/GHC/Parser/Errors/Ppr.hs 21 additions, 1 deletioncompiler/GHC/Parser/Errors/Ppr.hs
- compiler/GHC/Parser/Errors/Types.hs 7 additions, 0 deletionscompiler/GHC/Parser/Errors/Types.hs
- compiler/GHC/Parser/Lexer.x 2 additions, 0 deletionscompiler/GHC/Parser/Lexer.x
- compiler/GHC/Parser/PostProcess.hs 155 additions, 7 deletionscompiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Runtime/Eval.hs 2 additions, 1 deletioncompiler/GHC/Runtime/Eval.hs
- compiler/GHC/StgToJS/Linker/Linker.hs 1 addition, 1 deletioncompiler/GHC/StgToJS/Linker/Linker.hs
- compiler/GHC/StgToJS/Linker/Utils.hs 1 addition, 1 deletioncompiler/GHC/StgToJS/Linker/Utils.hs
- compiler/GHC/Tc/Errors/Ppr.hs 1 addition, 1 deletioncompiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Gen/HsType.hs 1 addition, 1 deletioncompiler/GHC/Tc/Gen/HsType.hs
- compiler/GHC/Tc/Instance/Typeable.hs 5 additions, 8 deletionscompiler/GHC/Tc/Instance/Typeable.hs
Loading
Please register or sign in to comment