| Opt_RelaxedPolyRec -- -X=RelaxedPolyRec
| Opt_MagicHash
| Opt_EmptyDataDecls
+ | Opt_KindSignatures
-- optimisation opts
| Opt_Strictness
xFlags :: [(String, DynFlag)]
xFlags = [
( "MagicHash", Opt_MagicHash ),
+ ( "KindSignatures", Opt_KindSignatures ),
( "EmptyDataDecls", Opt_EmptyDataDecls ),
( "FI", Opt_FFI ), -- support `-ffi'...
( "FFI", Opt_FFI ), -- ...and also `-fffi'
, Opt_ScopedTypeVariables
, Opt_MagicHash
, Opt_EmptyDataDecls
+ , Opt_KindSignatures
, Opt_TypeFamilies ]
------------------
,("-", ITminus, 0)
,("!", ITbang, 0)
- ,("*", ITstar, bit glaExtsBit .|.
+ ,("*", ITstar, bit glaExtsBit .|. bit kindSigsBit .|.
bit tyFamBit) -- For data T (a::*) = MkT
,(".", ITdot, bit tvBit) -- For 'forall a . t'
tyFamBit = 9 -- indexed type families: 'family' keyword and kind sigs
haddockBit = 10 -- Lex and parse Haddock comments
magicHashBit = 11 -- # in both functions and operators
+kindSigsBit = 12 -- # in both functions and operators
glaExtsEnabled, ffiEnabled, parrEnabled :: Int -> Bool
glaExtsEnabled flags = testBit flags glaExtsBit
tyFamEnabled flags = testBit flags tyFamBit
haddockEnabled flags = testBit flags haddockBit
magicHashEnabled flags = testBit flags magicHashBit
+kindSigsEnabled flags = testBit flags kindSigsBit
-- PState for parsing options pragmas
--
.|. tyFamBit `setBitIf` dopt Opt_TypeFamilies flags
.|. haddockBit `setBitIf` dopt Opt_Haddock flags
.|. magicHashBit `setBitIf` dopt Opt_MagicHash flags
+ .|. kindSigsBit `setBitIf` dopt Opt_KindSignatures flags
--
setBitIf :: Int -> Bool -> Int
b `setBitIf` cond | cond = bit b
; unbox_strict <- doptM Opt_UnboxStrictFields
; gla_exts <- doptM Opt_GlasgowExts
; empty_data_decls <- doptM Opt_EmptyDataDecls
+ ; kind_signatures <- doptM Opt_KindSignatures
; gadt_ok <- doptM Opt_GADTs
; is_boot <- tcIsHsBoot -- Are we compiling an hs-boot file?
; checkTc (gadt_ok || h98_syntax) (badGadtDecl tc_name)
-- Check that we don't use kind signatures without Glasgow extensions
- ; checkTc (gla_exts || isNothing mb_ksig) (badSigTyDecl tc_name)
+ ; checkTc (kind_signatures || isNothing mb_ksig) (badSigTyDecl tc_name)
-- Check that the stupid theta is empty for a GADT-style declaration
; checkTc (null stupid_theta || h98_syntax) (badStupidTheta tc_name)
badSigTyDecl tc_name
= vcat [ ptext SLIT("Illegal kind signature") <+>
quotes (ppr tc_name)
- , nest 2 (parens $ ptext SLIT("Use -fglasgow-exts to allow kind signatures")) ]
+ , nest 2 (parens $ ptext SLIT("Use -XKindSignatures to allow kind signatures")) ]
badFamInstDecl tc_name
= vcat [ ptext SLIT("Illegal family instance for") <+>