From 2f6309a46523135df1ac78f31cbdd5ace5324ca1 Mon Sep 17 00:00:00 2001 From: Vladislav Zavialov <vlad.z.4096@gmail.com> Date: Sat, 26 Aug 2023 17:49:39 +0300 Subject: [PATCH] Remove outdated CPP in compiler/* and template-haskell/* The boot compiler was bumped to 9.4 in cebb5819b43. There is no point supporting older GHC versions with CPP. --- compiler/GHC/Cmm/DebugBlock.hs | 3 --- compiler/GHC/CmmToAsm/BlockLayout.hs | 4 --- compiler/GHC/CmmToAsm/Reg/Graph.hs | 5 ---- compiler/GHC/CmmToAsm/Reg/Graph/SpillClean.hs | 6 ----- compiler/GHC/CmmToLlvm/CodeGen.hs | 5 ---- compiler/GHC/Core/Coercion/Opt.hs | 4 --- compiler/GHC/Core/Opt/Simplify.hs | 7 ------ compiler/GHC/Data/FastString.hs | 7 ------ compiler/GHC/Driver/Pipeline.hs | 3 --- compiler/GHC/Hs/Binds.hs | 4 --- compiler/GHC/Hs/Expr.hs | 17 ------------- compiler/GHC/Hs/Pat.hs | 9 ------- compiler/GHC/Iface/Ext/Ast.hs | 3 --- compiler/GHC/Rename/Expr.hs | 3 --- compiler/GHC/Runtime/Eval.hs | 5 ---- compiler/GHC/Tc/Errors/Hole.hs | 3 --- compiler/GHC/Tc/Module.hs | 4 --- compiler/GHC/Tc/Solver/Equality.hs | 4 --- compiler/GHC/Tc/TyCl.hs | 4 --- compiler/GHC/Tc/TyCl/PatSyn.hs | 3 --- compiler/GHC/Utils/Binary.hs | 3 --- compiler/GHC/Utils/Binary/Typeable.hs | 25 ------------------- .../Language/Haskell/TH/Syntax.hs | 16 +----------- 23 files changed, 1 insertion(+), 146 deletions(-) diff --git a/compiler/GHC/Cmm/DebugBlock.hs b/compiler/GHC/Cmm/DebugBlock.hs index 8eee5843aa24..a889f4c796ce 100644 --- a/compiler/GHC/Cmm/DebugBlock.hs +++ b/compiler/GHC/Cmm/DebugBlock.hs @@ -119,9 +119,6 @@ cmmDebugGen modLoc decls = map (blocksForScope Nothing) topScopes -- recover by copying ticks below. scp' | SubScope _ scp' <- scp = scp' | CombinedScope scp' _ <- scp = scp' -#if __GLASGOW_HASKELL__ < 901 - | otherwise = panic "findP impossible" -#endif scopeMap = foldl' (\acc (key, scope) -> insertMulti key scope acc) Map.empty childScopes diff --git a/compiler/GHC/CmmToAsm/BlockLayout.hs b/compiler/GHC/CmmToAsm/BlockLayout.hs index ebbbf5bbd3c1..94680637ae15 100644 --- a/compiler/GHC/CmmToAsm/BlockLayout.hs +++ b/compiler/GHC/CmmToAsm/BlockLayout.hs @@ -738,10 +738,6 @@ sequenceChain info weights blocks@((BasicBlock entry _):_) = = [masterChain] | (rest,entry) <- breakChainAt entry masterChain = [entry,rest] -#if __GLASGOW_HASKELL__ <= 810 - | otherwise = pprPanic "Entry point eliminated" $ - ppr masterChain -#endif blockList = assert (noDups [masterChain]) diff --git a/compiler/GHC/CmmToAsm/Reg/Graph.hs b/compiler/GHC/CmmToAsm/Reg/Graph.hs index 40508d39f10b..51b5b045ec80 100644 --- a/compiler/GHC/CmmToAsm/Reg/Graph.hs +++ b/compiler/GHC/CmmToAsm/Reg/Graph.hs @@ -385,11 +385,6 @@ graphAddCoalesce (r1, r2) graph , RegReal _ <- r2 = graph -#if __GLASGOW_HASKELL__ <= 810 - | otherwise - = panic "graphAddCoalesce" -#endif - -- | Patch registers in code using the reg -> reg mapping in this graph. patchRegsFromGraph diff --git a/compiler/GHC/CmmToAsm/Reg/Graph/SpillClean.hs b/compiler/GHC/CmmToAsm/Reg/Graph/SpillClean.hs index cb13e62137bc..6a1abd75370f 100644 --- a/compiler/GHC/CmmToAsm/Reg/Graph/SpillClean.hs +++ b/compiler/GHC/CmmToAsm/Reg/Graph/SpillClean.hs @@ -399,12 +399,6 @@ cleanBackward' liveSlotsOnEntry reloadedBy noReloads acc (li : instrs) cleanBackward liveSlotsOnEntry noReloads' (li : acc) instrs -#if __GLASGOW_HASKELL__ <= 810 - -- some other instruction - | otherwise - = cleanBackward liveSlotsOnEntry noReloads (li : acc) instrs -#endif - -- | Combine the associations from all the inward control flow edges. -- diff --git a/compiler/GHC/CmmToLlvm/CodeGen.hs b/compiler/GHC/CmmToLlvm/CodeGen.hs index cf871ecd0110..b362b8a975af 100644 --- a/compiler/GHC/CmmToLlvm/CodeGen.hs +++ b/compiler/GHC/CmmToLlvm/CodeGen.hs @@ -1684,11 +1684,6 @@ genMachOp_slow opt op [x, y] = case op of MO_AlignmentCheck {} -> panicOp -#if __GLASGOW_HASKELL__ < 811 - MO_VF_Extract {} -> panicOp - MO_V_Extract {} -> panicOp -#endif - where binLlvmOp ty binOp allow_y_cast = do platform <- getPlatform diff --git a/compiler/GHC/Core/Coercion/Opt.hs b/compiler/GHC/Core/Coercion/Opt.hs index 3ffbcecda4de..3cc6a1638df1 100644 --- a/compiler/GHC/Core/Coercion/Opt.hs +++ b/compiler/GHC/Core/Coercion/Opt.hs @@ -624,10 +624,6 @@ opt_univ env sym prov role oty1 oty2 where prov' = case prov of -#if __GLASGOW_HASKELL__ < 901 --- This alt is redundant with the first match of the FunDef - PhantomProv kco -> PhantomProv $ opt_co4_wrap env sym False Nominal kco -#endif ProofIrrelProv kco -> ProofIrrelProv $ opt_co4_wrap env sym False Nominal kco PluginProv _ -> prov diff --git a/compiler/GHC/Core/Opt/Simplify.hs b/compiler/GHC/Core/Opt/Simplify.hs index 7b7b439e33dc..9387e1489f07 100644 --- a/compiler/GHC/Core/Opt/Simplify.hs +++ b/compiler/GHC/Core/Opt/Simplify.hs @@ -43,10 +43,6 @@ import GHC.Types.Unique.FM import Control.Monad import Data.Foldable ( for_ ) -#if __GLASGOW_HASKELL__ <= 810 -import GHC.Utils.Panic ( panic ) -#endif - {- ************************************************************************ * * @@ -285,9 +281,6 @@ simplifyPgm logger unit_env name_ppr_ctx opts -- Loop do_iteration (iteration_no + 1) (counts1:counts_so_far) binds2 rules1 } } -#if __GLASGOW_HASKELL__ <= 810 - | otherwise = panic "do_iteration" -#endif where -- Remember the counts_so_far are reversed totalise :: [SimplCount] -> SimplCount diff --git a/compiler/GHC/Data/FastString.hs b/compiler/GHC/Data/FastString.hs index 36d6a2d820b8..8bd11082e10b 100644 --- a/compiler/GHC/Data/FastString.hs +++ b/compiler/GHC/Data/FastString.hs @@ -146,9 +146,6 @@ import Foreign import GHC.Conc.Sync (sharedCAF) #endif -#if __GLASGOW_HASKELL__ < 811 -import GHC.Base (unpackCString#,unpackNBytes#) -#endif import GHC.Exts import GHC.IO @@ -583,11 +580,7 @@ hashStr sbs@(SBS.SBS ba#) = loop 0# 0# -- DO NOT move this let binding! indexCharOffAddr# reads from the -- pointer so we need to evaluate this based on the length check -- above. Not doing this right caused #17909. -#if __GLASGOW_HASKELL__ >= 901 !c = int8ToInt# (indexInt8Array# ba# n) -#else - !c = indexInt8Array# ba# n -#endif !h2 = (h *# 16777619#) `xorI#` c in loop h2 (n +# 1#) diff --git a/compiler/GHC/Driver/Pipeline.hs b/compiler/GHC/Driver/Pipeline.hs index 9165de9c2474..1551de3df052 100644 --- a/compiler/GHC/Driver/Pipeline.hs +++ b/compiler/GHC/Driver/Pipeline.hs @@ -617,9 +617,6 @@ compileForeign hsc_env lang stub_c = do LangObjcxx -> viaCPipeline Cobjcxx LangAsm -> \pe hsc_env ml fp -> asPipeline True pe hsc_env ml fp LangJs -> \pe hsc_env ml fp -> Just <$> foreignJsPipeline pe hsc_env ml fp -#if __GLASGOW_HASKELL__ < 811 - RawObject -> panic "compileForeign: should be unreachable" -#endif pipe_env = mkPipeEnv NoStop stub_c Nothing (Temporary TFL_GhcSession) res <- runPipeline (hsc_hooks hsc_env) (pipeline pipe_env hsc_env Nothing stub_c) case res of diff --git a/compiler/GHC/Hs/Binds.hs b/compiler/GHC/Hs/Binds.hs index 41977c86886e..9671facf9ae2 100644 --- a/compiler/GHC/Hs/Binds.hs +++ b/compiler/GHC/Hs/Binds.hs @@ -545,10 +545,6 @@ ppr_monobind (FunBind { fun_id = fun, ppr_monobind (PatSynBind _ psb) = ppr psb ppr_monobind (XHsBindsLR b) = case ghcPass @idL of -#if __GLASGOW_HASKELL__ <= 900 - GhcPs -> dataConCantHappen b - GhcRn -> dataConCantHappen b -#endif GhcTc -> ppr_absbinds b where ppr_absbinds (AbsBinds { abs_tvs = tyvars, abs_ev_vars = dictvars diff --git a/compiler/GHC/Hs/Expr.hs b/compiler/GHC/Hs/Expr.hs index 2420d6c1517e..ce856e160ed2 100644 --- a/compiler/GHC/Hs/Expr.hs +++ b/compiler/GHC/Hs/Expr.hs @@ -712,9 +712,6 @@ ppr_expr (HsEmbTy _ _ ty) = hsep [text "type", ppr ty] ppr_expr (XExpr x) = case ghcPass @p of -#if __GLASGOW_HASKELL__ < 811 - GhcPs -> ppr x -#endif GhcRn -> ppr x GhcTc -> ppr x @@ -749,9 +746,6 @@ ppr_infix_expr (HsVar _ (L _ v)) = Just (pprInfixOcc v) ppr_infix_expr (HsRecSel _ f) = Just (pprInfixOcc f) ppr_infix_expr (HsUnboundVar _ occ) = Just (pprInfixOcc occ) ppr_infix_expr (XExpr x) = case ghcPass @p of -#if __GLASGOW_HASKELL__ < 901 - GhcPs -> Nothing -#endif GhcRn -> ppr_infix_expr_rn x GhcTc -> ppr_infix_expr_tc x ppr_infix_expr _ = Nothing @@ -856,9 +850,6 @@ hsExprNeedsParens prec = go go (XExpr x) = case ghcPass @p of GhcTc -> go_x_tc x GhcRn -> go_x_rn x -#if __GLASGOW_HASKELL__ <= 900 - GhcPs -> True -#endif go_x_tc :: XXExprGhcTc -> Bool go_x_tc (WrapExpr (HsWrap _ e)) = hsExprNeedsParens prec e @@ -1302,10 +1293,6 @@ ppr_cmd (HsCmdArrForm _ (L _ op) ps_fix rn_fix args) = fall_through ppr_cmd (XCmd x) = case ghcPass @p of -#if __GLASGOW_HASKELL__ < 811 - GhcPs -> ppr x - GhcRn -> ppr x -#endif GhcTc -> case x of HsWrap w cmd -> pprHsWrapper w (\_ -> parens (ppr_cmd cmd)) @@ -1874,10 +1861,6 @@ instance OutputableBndrId p pprHsQuote (VarBr _ False n) = text "''" <> pprPrefixOcc (unLoc n) pprHsQuote (XQuote b) = case ghcPass @p of -#if __GLASGOW_HASKELL__ <= 900 - GhcPs -> dataConCantHappen b - GhcRn -> dataConCantHappen b -#endif GhcTc -> pprPanic "pprHsQuote: `HsQuote GhcTc` shouldn't exist" (ppr b) -- See Note [The life cycle of a TH quotation] diff --git a/compiler/GHC/Hs/Pat.hs b/compiler/GHC/Hs/Pat.hs index 304c9f56e8a7..d0a15eccbb93 100644 --- a/compiler/GHC/Hs/Pat.hs +++ b/compiler/GHC/Hs/Pat.hs @@ -383,9 +383,6 @@ pprPat (ConPat { pat_con = con pprPat (EmbTyPat _ toktype tp) = ppr toktype <+> ppr tp pprPat (XPat ext) = case ghcPass @p of -#if __GLASGOW_HASKELL__ < 811 - GhcPs -> dataConCantHappen ext -#endif GhcRn -> case ext of HsPatExpanded orig _ -> pprPat orig GhcTc -> case ext of @@ -593,9 +590,6 @@ isIrrefutableHsPat is_strict = goL go (EmbTyPat {}) = True go (XPat ext) = case ghcPass @p of -#if __GLASGOW_HASKELL__ < 811 - GhcPs -> dataConCantHappen ext -#endif GhcRn -> case ext of HsPatExpanded _ pat -> go pat GhcTc -> case ext of @@ -759,9 +753,6 @@ patNeedsParens p = go @p go (ViewPat {}) = True go (EmbTyPat {}) = True go (XPat ext) = case ghcPass @q of -#if __GLASGOW_HASKELL__ < 901 - GhcPs -> dataConCantHappen ext -#endif GhcRn -> case ext of HsPatExpanded orig _ -> go orig GhcTc -> case ext of diff --git a/compiler/GHC/Iface/Ext/Ast.hs b/compiler/GHC/Iface/Ext/Ast.hs index 26d3578b0fb6..3558277b20ed 100644 --- a/compiler/GHC/Iface/Ext/Ast.hs +++ b/compiler/GHC/Iface/Ext/Ast.hs @@ -850,9 +850,6 @@ instance HiePass p => ToHie (BindContext (LocatedA (HsBind (GhcPass p)))) where [ toHie expr ] XHsBindsLR ext -> case hiePass @p of -#if __GLASGOW_HASKELL__ < 811 - HieRn -> dataConCantHappen ext -#endif HieTc | AbsBinds{ abs_exports = xs, abs_binds = binds , abs_ev_binds = ev_binds diff --git a/compiler/GHC/Rename/Expr.hs b/compiler/GHC/Rename/Expr.hs index bd2f0278be46..e51a515c511c 100644 --- a/compiler/GHC/Rename/Expr.hs +++ b/compiler/GHC/Rename/Expr.hs @@ -2311,9 +2311,6 @@ isStrictPattern (L loc pat) = EmbTyPat{} -> False XPat ext -> case ghcPass @p of -#if __GLASGOW_HASKELL__ < 811 - GhcPs -> dataConCantHappen ext -#endif GhcRn | HsPatExpanded _ p <- ext -> isStrictPattern (L loc p) diff --git a/compiler/GHC/Runtime/Eval.hs b/compiler/GHC/Runtime/Eval.hs index 6f32c07f4662..1802b98f565d 100644 --- a/compiler/GHC/Runtime/Eval.hs +++ b/compiler/GHC/Runtime/Eval.hs @@ -396,11 +396,6 @@ handleRunStatus step expr bindings final_ids status history | EvalComplete alloc (EvalException e) <- status = return (ExecComplete (Left (fromSerializableException e)) alloc) -#if __GLASGOW_HASKELL__ <= 810 - | otherwise - = panic "not_tracing" -- actually exhaustive, but GHC can't tell -#endif - resumeExec :: GhcMonad m => (SrcSpan->Bool) -> SingleStep -> Maybe Int -> m ExecResult diff --git a/compiler/GHC/Tc/Errors/Hole.hs b/compiler/GHC/Tc/Errors/Hole.hs index 08907f048add..8d0c0fa9a9c3 100644 --- a/compiler/GHC/Tc/Errors/Hole.hs +++ b/compiler/GHC/Tc/Errors/Hole.hs @@ -836,9 +836,6 @@ tcFilterHoleFits limit typed_hole ht@(hole_ty, _) candidates = Just (dataConWrapId con, dataConNonlinearType con) _ -> Nothing } where name = case hfc of -#if __GLASGOW_HASKELL__ < 901 - IdHFCand id -> idName id -#endif GreHFCand gre -> greName gre NameHFCand name -> name discard_it = go subs seen maxleft ty elts diff --git a/compiler/GHC/Tc/Module.hs b/compiler/GHC/Tc/Module.hs index 5293a8637199..2f80fb6ea6fb 100644 --- a/compiler/GHC/Tc/Module.hs +++ b/compiler/GHC/Tc/Module.hs @@ -792,10 +792,6 @@ checkHiBootIface tcg_env boot_info -- TODO: Maybe setGlobalTypeEnv should be strict. setGlobalTypeEnv tcg_env_w_binds type_env' } -#if __GLASGOW_HASKELL__ <= 810 - | otherwise = panic "checkHiBootIface: unreachable code" -#endif - {- Note [DFun impedance matching] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ We return a list of "impedance-matching" bindings for the dfuns diff --git a/compiler/GHC/Tc/Solver/Equality.hs b/compiler/GHC/Tc/Solver/Equality.hs index 515f42c104d8..d0f32e2f28d2 100644 --- a/compiler/GHC/Tc/Solver/Equality.hs +++ b/compiler/GHC/Tc/Solver/Equality.hs @@ -2546,10 +2546,6 @@ rewriteEqEvidence new_rewriters old_ev swapped (Reduction lhs_co nlhs) (Reductio , ppr new_rewriters ]) ; return new_ev } -#if __GLASGOW_HASKELL__ <= 810 - | otherwise - = panic "rewriteEvidence" -#endif where new_pred = mkTcEqPredLikeEv old_ev nlhs nrhs loc = ctEvLoc old_ev diff --git a/compiler/GHC/Tc/TyCl.hs b/compiler/GHC/Tc/TyCl.hs index b66fd243a0a9..6a359a68b903 100644 --- a/compiler/GHC/Tc/TyCl.hs +++ b/compiler/GHC/Tc/TyCl.hs @@ -2981,10 +2981,6 @@ tcFamDecl1 parent (FamilyDecl { fdInfo = fam_info -- overlap done by dropDominatedAxioms ; return fam_tc } } -#if __GLASGOW_HASKELL__ <= 810 - | otherwise = panic "tcFamInst1" -- Silence pattern-exhaustiveness checker -#endif - -- | Maybe return a list of Bools that say whether a type family was declared -- injective in the corresponding type arguments. Length of the list is equal to -- the number of arguments (including implicit kind/coercion arguments). diff --git a/compiler/GHC/Tc/TyCl/PatSyn.hs b/compiler/GHC/Tc/TyCl/PatSyn.hs index 6e65c7eaa83d..baa3effe07bf 100644 --- a/compiler/GHC/Tc/TyCl/PatSyn.hs +++ b/compiler/GHC/Tc/TyCl/PatSyn.hs @@ -933,9 +933,6 @@ tcPatSynBuilderBind prag_fn (PSB { psb_id = ps_lname@(L loc ps_name) ; traceTc "tcPatSynBuilderBind }" $ ppr builder_binds ; return builder_binds } } } -#if __GLASGOW_HASKELL__ <= 810 - | otherwise = panic "tcPatSynBuilderBind" -- Both cases dealt with -#endif where mb_match_group = case dir of diff --git a/compiler/GHC/Utils/Binary.hs b/compiler/GHC/Utils/Binary.hs index 03f13b1124dd..f65efa819176 100644 --- a/compiler/GHC/Utils/Binary.hs +++ b/compiler/GHC/Utils/Binary.hs @@ -10,9 +10,6 @@ {-# LANGUAGE UnboxedTuples #-} {-# OPTIONS_GHC -O2 -funbox-strict-fields #-} -#if MIN_VERSION_base(4,16,0) -#define HAS_TYPELITCHAR -#endif -- We always optimise this, otherwise performance of a non-optimised -- compiler is severely affected diff --git a/compiler/GHC/Utils/Binary/Typeable.hs b/compiler/GHC/Utils/Binary/Typeable.hs index 5734905ebd6e..6b28f98c3b2f 100644 --- a/compiler/GHC/Utils/Binary/Typeable.hs +++ b/compiler/GHC/Utils/Binary/Typeable.hs @@ -4,9 +4,6 @@ {-# OPTIONS_GHC -O2 -funbox-strict-fields #-} {-# OPTIONS_GHC -Wno-orphans -Wincomplete-patterns #-} -#if MIN_VERSION_base(4,16,0) -#define HAS_TYPELITCHAR -#endif -- | Orphan Binary instances for Data.Typeable stuff module GHC.Utils.Binary.Typeable @@ -19,9 +16,7 @@ import GHC.Prelude import GHC.Utils.Binary import GHC.Exts (RuntimeRep(..), VecCount(..), VecElem(..)) -#if __GLASGOW_HASKELL__ >= 901 import GHC.Exts (Levity(Lifted, Unlifted)) -#endif import GHC.Serialized import Foreign @@ -102,13 +97,8 @@ instance Binary RuntimeRep where put_ bh (VecRep a b) = putByte bh 0 >> put_ bh a >> put_ bh b put_ bh (TupleRep reps) = putByte bh 1 >> put_ bh reps put_ bh (SumRep reps) = putByte bh 2 >> put_ bh reps -#if __GLASGOW_HASKELL__ >= 901 put_ bh (BoxedRep Lifted) = putByte bh 3 put_ bh (BoxedRep Unlifted) = putByte bh 4 -#else - put_ bh LiftedRep = putByte bh 3 - put_ bh UnliftedRep = putByte bh 4 -#endif put_ bh IntRep = putByte bh 5 put_ bh WordRep = putByte bh 6 put_ bh Int64Rep = putByte bh 7 @@ -129,13 +119,8 @@ instance Binary RuntimeRep where 0 -> VecRep <$> get bh <*> get bh 1 -> TupleRep <$> get bh 2 -> SumRep <$> get bh -#if __GLASGOW_HASKELL__ >= 901 3 -> pure (BoxedRep Lifted) 4 -> pure (BoxedRep Unlifted) -#else - 3 -> pure LiftedRep - 4 -> pure UnliftedRep -#endif 5 -> pure IntRep 6 -> pure WordRep 7 -> pure Int64Rep @@ -173,17 +158,13 @@ instance Binary KindRep where instance Binary TypeLitSort where put_ bh TypeLitSymbol = putByte bh 0 put_ bh TypeLitNat = putByte bh 1 -#if defined(HAS_TYPELITCHAR) put_ bh TypeLitChar = putByte bh 2 -#endif get bh = do tag <- getByte bh case tag of 0 -> pure TypeLitSymbol 1 -> pure TypeLitNat -#if defined(HAS_TYPELITCHAR) 2 -> pure TypeLitChar -#endif _ -> fail "Binary.putTypeLitSort: invalid tag" putTypeRep :: BinHandle -> TypeRep a -> IO () @@ -198,12 +179,6 @@ putTypeRep bh (App f x) = do put_ bh (2 :: Word8) putTypeRep bh f putTypeRep bh x -#if __GLASGOW_HASKELL__ < 903 -putTypeRep bh (Fun arg res) = do - put_ bh (3 :: Word8) - putTypeRep bh arg - putTypeRep bh res -#endif instance Binary Serialized where put_ bh (Serialized the_type bytes) = do diff --git a/libraries/template-haskell/Language/Haskell/TH/Syntax.hs b/libraries/template-haskell/Language/Haskell/TH/Syntax.hs index 6315c211c88c..95f1b7fa171c 100644 --- a/libraries/template-haskell/Language/Haskell/TH/Syntax.hs +++ b/libraries/template-haskell/Language/Haskell/TH/Syntax.hs @@ -57,7 +57,7 @@ import Data.Ratio import GHC.CString ( unpackCString# ) import GHC.Generics ( Generic ) import GHC.Types ( Int(..), Word(..), Char(..), Double(..), Float(..), - TYPE, RuntimeRep(..), Multiplicity (..) ) + TYPE, RuntimeRep(..), Levity(..), Multiplicity (..) ) import qualified Data.Kind as Kind (Type) import GHC.Prim ( Int#, Word#, Char#, Double#, Float#, Addr# ) import GHC.Ptr ( Ptr, plusPtr ) @@ -70,11 +70,6 @@ import Foreign.ForeignPtr import Foreign.C.String import Foreign.C.Types -#if __GLASGOW_HASKELL__ >= 901 -import GHC.Types ( Levity(..) ) -#endif - -#if __GLASGOW_HASKELL__ >= 903 import Data.Array.Byte (ByteArray(..)) import GHC.Exts ( ByteArray#, unsafeFreezeByteArray#, copyAddrToByteArray#, newByteArray# @@ -82,7 +77,6 @@ import GHC.Exts , copyByteArray#, newPinnedByteArray#) import GHC.ForeignPtr (ForeignPtr(..), ForeignPtrContents(..)) import GHC.ST (ST(..), runST) -#endif ----------------------------------------------------- -- @@ -1014,11 +1008,7 @@ class Lift (t :: TYPE r) where -- | Turn a value into a Template Haskell expression, suitable for use in -- a splice. lift :: Quote m => t -> m Exp -#if __GLASGOW_HASKELL__ >= 901 default lift :: (r ~ ('BoxedRep 'Lifted), Quote m) => t -> m Exp -#else - default lift :: (r ~ 'LiftedRep, Quote m) => t -> m Exp -#endif lift = unTypeCode . liftTyped -- | Turn a value into a Template Haskell typed expression, suitable for use @@ -1141,8 +1131,6 @@ instance Lift Addr# where lift x = return (LitE (StringPrimL (map (fromIntegral . ord) (unpackCString# x)))) -#if __GLASGOW_HASKELL__ >= 903 - -- | -- @since 2.19.0.0 instance Lift ByteArray where @@ -1174,8 +1162,6 @@ addrToByteArray (I# len) addr = runST $ ST $ s'' -> case unsafeFreezeByteArray# mb s'' of (# s''', ret #) -> (# s''', ByteArray ret #) -#endif - instance Lift a => Lift (Maybe a) where liftTyped x = unsafeCodeCoerce (lift x) -- GitLab