Merge branch 'master' of http://darcs.haskell.org/ghc into ghc-generics
authorJose Pedro Magalhaes <jpm@cs.uu.nl>
Tue, 17 May 2011 06:51:09 +0000 (08:51 +0200)
committerJose Pedro Magalhaes <jpm@cs.uu.nl>
Tue, 17 May 2011 06:51:09 +0000 (08:51 +0200)
1  2 
compiler/deSugar/Check.lhs
compiler/deSugar/DsMeta.hs
compiler/hsSyn/HsBinds.lhs
compiler/hsSyn/HsUtils.lhs
compiler/main/DynFlags.hs
compiler/parser/Lexer.x

@@@ -30,6 -30,7 +30,7 @@@ import Typ
  import SrcLoc
  import UniqSet
  import Util
+ import BasicTypes
  import Outputable
  import FastString
  \end{code}
@@@ -436,14 -437,14 +437,14 @@@ get_lit :: Pat id -> Maybe HsLi
  -- It doesn't matter which one, because they will only be compared
  -- with other HsLits gotten in the same way
  get_lit (LitPat lit)                                    = Just lit
- get_lit (NPat (OverLit { ol_val = HsIntegral i})    mb _) = Just (HsIntPrim   (mb_neg mb i))
- get_lit (NPat (OverLit { ol_val = HsFractional f }) mb _) = Just (HsFloatPrim (mb_neg mb f))
+ get_lit (NPat (OverLit { ol_val = HsIntegral i})    mb _) = Just (HsIntPrim   (mb_neg negate              mb i))
+ get_lit (NPat (OverLit { ol_val = HsFractional f }) mb _) = Just (HsFloatPrim (mb_neg negateFractionalLit mb f))
  get_lit (NPat (OverLit { ol_val = HsIsString s })   _  _) = Just (HsStringPrim s)
  get_lit _                                               = Nothing
  
- mb_neg :: Num a => Maybe b -> a -> a
- mb_neg Nothing  v = v
- mb_neg (Just _) v = -v
+ mb_neg :: (a -> a) -> Maybe b -> a -> a
+ mb_neg _      Nothing  v = v
+ mb_neg negate (Just _) v = negate v
  
  get_unused_cons :: [Pat Id] -> [DataCon]
  get_unused_cons used_cons = ASSERT( not (null used_cons) ) unused_cons
@@@ -643,7 -644,7 +644,7 @@@ might_fail_pat (ConPatOut { pat_args = 
  
  -- Finally the ones that are sure to succeed, or which are covered by the checking algorithm
  might_fail_pat (LazyPat _)                   = False -- Always succeeds
 -might_fail_pat _                             = False -- VarPat, WildPat, LitPat, NPat, TypePat
 +might_fail_pat _                             = False -- VarPat, WildPat, LitPat, NPat
  
  --------------
  might_fail_lpat :: LPat Id -> Bool
@@@ -420,10 -420,6 +420,10 @@@ rep_sig :: LSig Name -> DsM [(SrcSpan, 
        -- Singleton => Ok
        -- Empty     => Too hard, signature ignored
  rep_sig (L loc (TypeSig nm ty))       = rep_proto nm ty loc
 +rep_sig (L _   (GenericSig nm _))     = failWithDs msg
 +  where msg = vcat  [ ptext (sLit "Illegal default signature for") <+> quotes (ppr nm)
 +                    , ptext (sLit "Default signatures are not supported by Template Haskell") ]
 +
  rep_sig (L loc (InlineSig nm ispec))  = rep_inline nm ispec loc
  rep_sig (L loc (SpecSig nm ty ispec)) = rep_specialise nm ty ispec loc
  rep_sig _                             = return []
@@@ -635,6 -631,7 +635,6 @@@ repTy (HsKindSig t k)       = d
                                  k1 <- repKind k
                                  repTSig t1 k1
  repTy (HsSpliceTy splice _ _) = repSplice splice
 -repTy ty@(HsNumTy _)          = notHandled "Number types (for generics)" (ppr ty)
  repTy ty                    = notHandled "Exotic form of type" (ppr ty)
  
  -- represent a kind
@@@ -1583,7 -1580,7 +1583,7 @@@ repLiteral li
  mk_integer :: Integer -> DsM HsLit
  mk_integer  i = do integer_ty <- lookupType integerTyConName
                     return $ HsInteger i integer_ty
- mk_rational :: Rational -> DsM HsLit
+ mk_rational :: FractionalLit -> DsM HsLit
  mk_rational r = do rat_ty <- lookupType rationalTyConName
                     return $ HsRat r rat_ty
  mk_string :: FastString -> DsM HsLit
@@@ -69,23 -69,23 +69,23 @@@ data HsLocalBindsLR idL idR        -- Binding
  type HsValBinds id = HsValBindsLR id id
  
  data HsValBindsLR idL idR  -- Value bindings (not implicit parameters)
-   = ValBindsIn             -- Before renaming
+   = ValBindsIn             -- Before renaming RHS; idR is always RdrName
        (LHsBindsLR idL idR) [LSig idR] -- Not dependency analysed
                                        -- Recursive by default
  
-   | ValBindsOut                  -- After renaming
+   | ValBindsOut                  -- After renaming RHS; idR can be Name or Id
        [(RecFlag, LHsBinds idL)]       -- Dependency analysed, later bindings 
                                          -- in the list may depend on earlier
                                          -- ones.
        [LSig Name]
    deriving (Data, Typeable)
  
- type LHsBinds id = Bag (LHsBind id)
- type LHsBind  id = Located (HsBind id)
- type HsBind id   = HsBindLR id id
+ type LHsBind  id = LHsBindLR  id id
+ type LHsBinds id = LHsBindsLR id id
+ type HsBind   id = HsBindLR   id id
  
- type LHsBindLR idL idR = Located (HsBindLR idL idR)
  type LHsBindsLR idL idR = Bag (LHsBindLR idL idR)
+ type LHsBindLR  idL idR = Located (HsBindLR idL idR)
  
  data HsBindLR idL idR
    = -- | FunBind is used for both functions   @f x = e@
@@@ -597,10 -597,6 +597,10 @@@ data Sig name    -- Signatures and pragma
        -- f :: Num a => a -> a
      TypeSig (Located name) (LHsType name)
  
 +        -- A type signature for a default method inside a class
 +        -- default eq :: (Representable0 a, GEq (Rep0 a)) => a -> a -> Bool
 +  | GenericSig (Located name) (LHsType name)
 +
        -- A type signature in generated code, notably the code
        -- generated for record selectors.  We simply record
        -- the desired Id itself, replete with its name, type
@@@ -670,20 -666,18 +670,20 @@@ okBindSig :: Sig a -> Boo
  okBindSig _ = True
  
  okHsBootSig :: Sig a -> Bool
 -okHsBootSig (TypeSig  _ _) = True
 -okHsBootSig (FixSig _)           = True
 -okHsBootSig _              = False
 +okHsBootSig (TypeSig  _ _)    = True
 +okHsBootSig (GenericSig  _ _) = False
 +okHsBootSig (FixSig _)              = True
 +okHsBootSig _                 = False
  
  okClsDclSig :: Sig a -> Bool
  okClsDclSig (SpecInstSig _) = False
  okClsDclSig _               = True        -- All others OK
  
  okInstDclSig :: Sig a -> Bool
 -okInstDclSig (TypeSig _ _)   = False
 -okInstDclSig (FixSig _)      = False
 -okInstDclSig _                     = True
 +okInstDclSig (TypeSig _ _)    = False
 +okInstDclSig (GenericSig _ _) = False
 +okInstDclSig (FixSig _)       = False
 +okInstDclSig _                      = True
  
  sigName :: LSig name -> Maybe name
  -- Used only in Haddock
@@@ -708,10 -702,9 +708,10 @@@ isVanillaLSig (L _(TypeSig {})) = Tru
  isVanillaLSig _                 = False
  
  isTypeLSig :: LSig name -> Bool        -- Type signatures
 -isTypeLSig (L _(TypeSig {})) = True
 -isTypeLSig (L _(IdSig {}))   = True
 -isTypeLSig _                 = False
 +isTypeLSig (L _(TypeSig {}))    = True
 +isTypeLSig (L _(GenericSig {})) = True
 +isTypeLSig (L _(IdSig {}))      = True
 +isTypeLSig _                    = False
  
  isSpecLSig :: LSig name -> Bool
  isSpecLSig (L _(SpecSig {})) = True
@@@ -734,7 -727,6 +734,7 @@@ isInlineLSig _                    = Fal
  
  hsSigDoc :: Sig name -> SDoc
  hsSigDoc (TypeSig {})                 = ptext (sLit "type signature")
 +hsSigDoc (GenericSig {})      = ptext (sLit "default type signature")
  hsSigDoc (IdSig {})           = ptext (sLit "id signature")
  hsSigDoc (SpecSig {})         = ptext (sLit "SPECIALISE pragma")
  hsSigDoc (InlineSig {})         = ptext (sLit "INLINE pragma")
@@@ -749,7 -741,6 +749,7 @@@ eqHsSig :: Eq a => LSig a -> LSig a -> 
  eqHsSig (L _ (FixSig (FixitySig n1 _))) (L _ (FixSig (FixitySig n2 _))) = unLoc n1 == unLoc n2
  eqHsSig (L _ (IdSig n1))              (L _ (IdSig n2))                = n1 == n2
  eqHsSig (L _ (TypeSig n1 _))          (L _ (TypeSig n2 _))            = unLoc n1 == unLoc n2
 +eqHsSig (L _ (GenericSig n1 _))               (L _ (GenericSig n2 _))         = unLoc n1 == unLoc n2
  eqHsSig (L _ (InlineSig n1 _))          (L _ (InlineSig n2 _))          = unLoc n1 == unLoc n2
        -- For specialisations, we don't have equality over
        -- HsType, so it's not convenient to spot duplicate 
@@@ -763,7 -754,6 +763,7 @@@ instance (OutputableBndr name) => Outpu
  
  ppr_sig :: OutputableBndr name => Sig name -> SDoc
  ppr_sig (TypeSig var ty)        = pprVarSig (unLoc var) (ppr ty)
 +ppr_sig (GenericSig var ty)     = ptext (sLit "default") <+> pprVarSig (unLoc var) (ppr ty)
  ppr_sig (IdSig id)              = pprVarSig id (ppr (varType id))
  ppr_sig (FixSig fix_sig)        = ppr fix_sig
  ppr_sig (SpecSig var ty inl)    = pragBrackets (pprSpec var (ppr ty) inl)
@@@ -27,7 -27,7 +27,7 @@@ module HsUtils
    nlHsDo, nlHsOpApp, nlHsLam, nlHsPar, nlHsIf, nlHsCase, nlList,
    mkLHsTupleExpr, mkLHsVarTuple, missingTupArg,
  
 -  -- Bindigns
 +  -- Bindings
    mkFunBind, mkVarBind, mkHsVarBind, mk_easy_FunBind, 
  
    -- Literals
@@@ -84,7 -84,6 +84,6 @@@ import NameSe
  import BasicTypes
  import SrcLoc
  import FastString
- import Outputable
  import Util
  import Bag
  
@@@ -188,7 -187,7 +187,7 @@@ mkSimpleHsAlt pat exp
  -- See RnEnv.lookupSyntaxName
  
  mkHsIntegral   :: Integer -> PostTcType -> HsOverLit id
- mkHsFractional :: Rational -> PostTcType -> HsOverLit id
+ mkHsFractional :: FractionalLit -> PostTcType -> HsOverLit id
  mkHsIsString   :: FastString -> PostTcType -> HsOverLit id
  mkHsDo         :: HsStmtContext Name -> [LStmt id] -> HsExpr id
  mkHsComp       :: HsStmtContext Name -> [LStmt id] -> LHsExpr id -> HsExpr id
@@@ -548,6 -547,7 +547,6 @@@ collect_lpat (L _ pat) bndr
      go (SigPatIn pat _)                 = collect_lpat pat bndrs
      go (SigPatOut pat _)        = collect_lpat pat bndrs
      go (QuasiQuotePat _)          = bndrs
 -    go (TypePat _)                = bndrs
      go (CoPat _ pat _)            = go pat
  \end{code}
  
@@@ -664,11 -664,15 +663,15 @@@ lStmtsImplicits = hs_lstmt
  
  hsValBindsImplicits :: HsValBindsLR Name idR -> NameSet
  hsValBindsImplicits (ValBindsOut binds _)
-   = unionManyNameSets [foldBag unionNameSets (hs_bind . unLoc) emptyNameSet hs_binds | (_rec, hs_binds) <- binds]
+   = foldr (unionNameSets . lhsBindsImplicits . snd) emptyNameSet binds
+ hsValBindsImplicits (ValBindsIn binds _) 
+   = lhsBindsImplicits binds
+ lhsBindsImplicits :: LHsBindsLR Name idR -> NameSet
+ lhsBindsImplicits = foldBag unionNameSets lhs_bind emptyNameSet
    where
-     hs_bind (PatBind { pat_lhs = lpat }) = lPatImplicits lpat
-     hs_bind _ = emptyNameSet
- hsValBindsImplicits (ValBindsIn {}) = pprPanic "hsValBindsImplicits: ValBindsIn" empty
+     lhs_bind (L _ (PatBind { pat_lhs = lpat })) = lPatImplicits lpat
+     lhs_bind _ = emptyNameSet
  
  lPatImplicits :: LPat Name -> NameSet
  lPatImplicits = hs_lpat
@@@ -723,6 -727,7 +726,6 @@@ collect_sig_lpat pat acc = collect_sig_
  
  collect_sig_pat :: Pat name -> [LHsType name] -> [LHsType name]
  collect_sig_pat (SigPatIn pat ty)     acc = collect_sig_lpat pat (ty:acc)
 -collect_sig_pat (TypePat ty)          acc = ty:acc
  
  collect_sig_pat (LazyPat pat)       acc = collect_sig_lpat pat acc
  collect_sig_pat (BangPat pat)       acc = collect_sig_lpat pat acc
@@@ -108,6 -108,8 +108,8 @@@ import Data.Cha
  import Data.List
  import Data.Map (Map)
  import qualified Data.Map as Map
+ import Data.Set (Set)
+ import qualified Data.Set as Set
  import System.FilePath
  import System.IO        ( stderr, hPutChar )
  
@@@ -122,6 -124,21 +124,21 @@@ data DynFla
     | Opt_D_dump_raw_cmm
     | Opt_D_dump_cmmz
     | Opt_D_dump_cmmz_pretty
+    -- All of the cmmz subflags (there are a lot!)  Automatically
+    -- enabled if you run -ddump-cmmz
+    | Opt_D_dump_cmmz_cbe
+    | Opt_D_dump_cmmz_proc
+    | Opt_D_dump_cmmz_spills
+    | Opt_D_dump_cmmz_rewrite
+    | Opt_D_dump_cmmz_dead
+    | Opt_D_dump_cmmz_stub
+    | Opt_D_dump_cmmz_sp
+    | Opt_D_dump_cmmz_procmap
+    | Opt_D_dump_cmmz_split
+    | Opt_D_dump_cmmz_lower
+    | Opt_D_dump_cmmz_info
+    | Opt_D_dump_cmmz_cafs
+    -- end cmmz subflags
     | Opt_D_dump_cps_cmm
     | Opt_D_dump_cvt_cmm
     | Opt_D_dump_asm
@@@ -320,6 -337,7 +337,6 @@@ data ExtensionFla
     | Opt_TemplateHaskell
     | Opt_QuasiQuotes
     | Opt_ImplicitParams
 -   | Opt_Generics                     -- "Derivable type classes"
     | Opt_ImplicitPrelude
     | Opt_ScopedTypeVariables
     | Opt_UnboxedTuples
     | Opt_DeriveFunctor
     | Opt_DeriveTraversable
     | Opt_DeriveFoldable
 +   | Opt_DeriveGeneric            -- Allow deriving Generic/1
 +   | Opt_DefaultSignatures        -- Allow extra signatures for defmeths
 +   | Opt_Generics                 -- Old generic classes, now deprecated
  
     | Opt_TypeSynonymInstances
     | Opt_FlexibleContexts
@@@ -481,6 -496,11 +498,11 @@@ data DynFlags = DynFlags 
    filesToClean          :: IORef [FilePath],
    dirsToClean           :: IORef (Map FilePath FilePath),
  
+   -- Names of files which were generated from -ddump-to-file; used to
+   -- track which ones we need to truncate because it's our first run
+   -- through
+   generatedDumps        :: IORef (Set FilePath),
    -- hsc dynamic flags
    flags                 :: [DynFlag],
    -- Don't change this without updating extensionFlags:
@@@ -717,12 -737,14 +739,14 @@@ initDynFlags dflags = d
   ways <- readIORef v_Ways
   refFilesToClean <- newIORef []
   refDirsToClean <- newIORef Map.empty
+  refGeneratedDumps <- newIORef Set.empty
   return dflags{
          ways            = ways,
          buildTag        = mkBuildTag (filter (not . wayRTSOnly) ways),
          rtsBuildTag     = mkBuildTag ways,
          filesToClean    = refFilesToClean,
-         dirsToClean     = refDirsToClean
+         dirsToClean     = refDirsToClean,
+         generatedDumps   = refGeneratedDumps
          }
  
  -- | The normal 'DynFlags'. Note that they is not suitable for use in this form
@@@ -798,6 -820,7 +822,7 @@@ defaultDynFlags mySettings 
          -- end of ghc -M values
          filesToClean   = panic "defaultDynFlags: No filesToClean",
          dirsToClean    = panic "defaultDynFlags: No dirsToClean",
+         generatedDumps = panic "defaultDynFlags: No generatedDumps",
          haddockOptions = Nothing,
          flags = defaultFlags,
          language = Nothing,
@@@ -1187,8 -1210,8 +1212,8 @@@ dynamic_flags = 
    , Flag "dylib-install-name" (hasArg setDylibInstallName)
  
          ------- Libraries ---------------------------------------------------
-   , Flag "L"   (Prefix    addLibraryPath)
-   , Flag "l"   (AnySuffix (upd . addOptl))
+   , Flag "L"   (Prefix addLibraryPath)
+   , Flag "l"   (hasArg (addOptl . ("-l" ++)))
  
          ------- Frameworks --------------------------------------------------
          -- -framework-path should really be -F ...
    , Flag "ddump-raw-cmm"           (setDumpFlag Opt_D_dump_raw_cmm)
    , Flag "ddump-cmmz"              (setDumpFlag Opt_D_dump_cmmz)
    , Flag "ddump-cmmz-pretty"       (setDumpFlag Opt_D_dump_cmmz_pretty)
+   , Flag "ddump-cmmz-cbe"          (setDumpFlag Opt_D_dump_cmmz_cbe)
+   , Flag "ddump-cmmz-spills"       (setDumpFlag Opt_D_dump_cmmz_spills)
+   , Flag "ddump-cmmz-proc"         (setDumpFlag Opt_D_dump_cmmz_proc)
+   , Flag "ddump-cmmz-rewrite"      (setDumpFlag Opt_D_dump_cmmz_rewrite)
+   , Flag "ddump-cmmz-dead"         (setDumpFlag Opt_D_dump_cmmz_dead)
+   , Flag "ddump-cmmz-stub"         (setDumpFlag Opt_D_dump_cmmz_stub)
+   , Flag "ddump-cmmz-sp"           (setDumpFlag Opt_D_dump_cmmz_sp)
+   , Flag "ddump-cmmz-procmap"      (setDumpFlag Opt_D_dump_cmmz_procmap)
+   , Flag "ddump-cmmz-split"        (setDumpFlag Opt_D_dump_cmmz_split)
+   , Flag "ddump-cmmz-lower"        (setDumpFlag Opt_D_dump_cmmz_lower)
+   , Flag "ddump-cmmz-info"         (setDumpFlag Opt_D_dump_cmmz_info)
+   , Flag "ddump-cmmz-cafs"         (setDumpFlag Opt_D_dump_cmmz_cafs)
    , Flag "ddump-core-stats"        (setDumpFlag Opt_D_dump_core_stats)
    , Flag "ddump-cps-cmm"           (setDumpFlag Opt_D_dump_cps_cmm)
    , Flag "ddump-cvt-cmm"           (setDumpFlag Opt_D_dump_cvt_cmm)
@@@ -1628,8 -1663,7 +1665,8 @@@ xFlags = 
    ( "ParallelArrays",                   Opt_ParallelArrays, nop ),
    ( "TemplateHaskell",                  Opt_TemplateHaskell, checkTemplateHaskellOk ),
    ( "QuasiQuotes",                      Opt_QuasiQuotes, nop ),
 -  ( "Generics",                         Opt_Generics, nop ),
 +  ( "Generics",                         Opt_Generics,
 +    \ _ -> deprecate "it does nothing; look into -XDefaultSignatures and -XDeriveGeneric for generic programming support." ),
    ( "ImplicitPrelude",                  Opt_ImplicitPrelude, nop ),
    ( "RecordWildCards",                  Opt_RecordWildCards, nop ),
    ( "NamedFieldPuns",                   Opt_RecordPuns, nop ),
    ( "DeriveFunctor",                    Opt_DeriveFunctor, nop ),
    ( "DeriveTraversable",                Opt_DeriveTraversable, nop ),
    ( "DeriveFoldable",                   Opt_DeriveFoldable, nop ),
 +  ( "DeriveGeneric",                    Opt_DeriveGeneric, nop ),
 +  ( "DefaultSignatures",                Opt_DefaultSignatures, nop ),
    ( "TypeSynonymInstances",             Opt_TypeSynonymInstances, nop ),
    ( "FlexibleContexts",                 Opt_FlexibleContexts, nop ),
    ( "FlexibleInstances",                Opt_FlexibleInstances, nop ),
@@@ -1853,7 -1885,6 +1890,7 @@@ glasgowExtsFlags = 
             , Opt_DeriveFunctor
             , Opt_DeriveFoldable
             , Opt_DeriveTraversable
 +           , Opt_DeriveGeneric
             , Opt_FlexibleContexts
             , Opt_FlexibleInstances
             , Opt_ConstrainedClassMethods
diff --combined compiler/parser/Lexer.x
@@@ -68,7 -68,7 +68,7 @@@ import UniqF
  import DynFlags
  import Module
  import Ctype
- import BasicTypes     ( InlineSpec(..), RuleMatchInfo(..) )
+ import BasicTypes     ( InlineSpec(..), RuleMatchInfo(..), FractionalLit(..) )
  import Util           ( readRational )
  
  import Control.Monad
@@@ -335,6 -335,11 +335,6 @@@ $tab+         { warn Opt_WarnTabs (tex
           { token ITcubxparen }
  }
  
 -<0> {
 -  "{|" / { ifExtension genericsEnabled } { token ITocurlybar }
 -  "|}" / { ifExtension genericsEnabled } { token ITccurlybar }
 -}
 -
  <0,option_prags> {
    \(                                  { special IToparen }
    \)                                  { special ITcparen }
@@@ -536,14 -541,14 +536,14 @@@ data Toke
    | ITchar       Char
    | ITstring     FastString
    | ITinteger    Integer
-   | ITrational   Rational
+   | ITrational   FractionalLit
  
    | ITprimchar   Char
    | ITprimstring FastString
    | ITprimint    Integer
    | ITprimword   Integer
-   | ITprimfloat  Rational
-   | ITprimdouble Rational
+   | ITprimfloat  FractionalLit
+   | ITprimdouble FractionalLit
  
    -- Template Haskell extension tokens
    | ITopenExpQuote            --  [| or [e|
@@@ -1056,9 -1061,12 +1056,12 @@@ hexadecimal = (16,hexDigit
  
  -- readRational can understand negative rationals, exponents, everything.
  tok_float, tok_primfloat, tok_primdouble :: String -> Token
- tok_float        str = ITrational   $! readRational str
- tok_primfloat    str = ITprimfloat  $! readRational str
- tok_primdouble   str = ITprimdouble $! readRational str
+ tok_float        str = ITrational   $! readFractionalLit str
+ tok_primfloat    str = ITprimfloat  $! readFractionalLit str
+ tok_primdouble   str = ITprimdouble $! readFractionalLit str
+ readFractionalLit :: String -> FractionalLit
+ readFractionalLit str = (FL $! str) $! readRational str
  
  -- -----------------------------------------------------------------------------
  -- Layout processing
@@@ -1746,10 -1754,8 +1749,10 @@@ setAlrExpectingOCurly b = P $ \s -> PO
  -- -fglasgow-exts or -XParallelArrays) are represented by a bitmap stored in an unboxed
  -- integer
  
 -genericsBit :: Int
 -genericsBit = 0 -- {| and |}
 +-- The "genericsBit" is now unused, available for others
 +-- genericsBit :: Int
 +-- genericsBit = 0 -- {|, |} and "generic"
 +
  ffiBit :: Int
  ffiBit           = 1
  parrBit :: Int
@@@ -1800,6 -1806,8 +1803,6 @@@ nondecreasingIndentationBit = 2
  
  always :: Int -> Bool
  always           _     = True
 -genericsEnabled :: Int -> Bool
 -genericsEnabled  flags = testBit flags genericsBit
  parrEnabled :: Int -> Bool
  parrEnabled      flags = testBit flags parrBit
  arrowsEnabled :: Int -> Bool
@@@ -1868,7 -1876,8 +1871,7 @@@ mkPState flags buf loc 
        alr_justClosedExplicitLetBlock = False
      }
      where
 -      bitmap =     genericsBit       `setBitIf` xopt Opt_Generics flags
 -               .|. ffiBit            `setBitIf` xopt Opt_ForeignFunctionInterface flags
 +      bitmap =     ffiBit            `setBitIf` xopt Opt_ForeignFunctionInterface flags
                 .|. parrBit           `setBitIf` xopt Opt_ParallelArrays  flags
                 .|. arrowsBit         `setBitIf` xopt Opt_Arrows          flags
                 .|. thBit             `setBitIf` xopt Opt_TemplateHaskell flags