Simon Peyton Jones pushed to branch wip/T23162-spj at Glasgow Haskell Compiler / GHC

Commits:

3 changed files:

Changes:

  • compiler/GHC/Tc/Gen/App.hs
    ... ... @@ -3,6 +3,7 @@
    3 3
     {-# LANGUAGE FlexibleContexts    #-}
    
    4 4
     {-# LANGUAGE GADTs               #-}
    
    5 5
     {-# LANGUAGE MultiWayIf          #-}
    
    6
    +{-# LANGUAGE RecursiveDo         #-}
    
    6 7
     {-# LANGUAGE ScopedTypeVariables #-}
    
    7 8
     {-# LANGUAGE TypeFamilies        #-}
    
    8 9
     {-# LANGUAGE UndecidableInstances #-} -- Wrinkle in Note [Trees That Grow]
    
    ... ... @@ -47,7 +48,7 @@ import GHC.Core.TyCo.Subst ( substTyWithInScope )
    47 48
     import GHC.Core.Type
    
    48 49
     import GHC.Core.Coercion
    
    49 50
     
    
    50
    -import GHC.Builtin.Types ( multiplicityTy )
    
    51
    +import GHC.Builtin.Types ( multiplicityTy, runtimeRepTy )
    
    51 52
     import GHC.Builtin.PrimOps( tagToEnumKey )
    
    52 53
     import GHC.Builtin.Names
    
    53 54
     
    
    ... ... @@ -59,6 +60,7 @@ import GHC.Types.SrcLoc
    59 60
     import GHC.Types.Var.Env  ( emptyTidyEnv, mkInScopeSet )
    
    60 61
     
    
    61 62
     import GHC.Data.Maybe
    
    63
    +import GHC.Data.FastString
    
    62 64
     
    
    63 65
     import GHC.Utils.Misc
    
    64 66
     import GHC.Utils.Outputable as Outputable
    
    ... ... @@ -395,9 +397,7 @@ tcApp rn_expr exp_res_ty
    395 397
            -- Step 3: Instantiate the function type (taking a quick look at args)
    
    396 398
            ; do_ql <- wantQuickLook rn_fun
    
    397 399
            ; (inst_args, app_res_rho)
    
    398
    -              <- setQLInstLevel do_ql $  -- See (TCAPP1) and (TCAPP2) in
    
    399
    -                                         -- Note [tcApp: typechecking applications]
    
    400
    -                 tcInstFun do_ql inst_final tc_head fun_sigma rn_args
    
    400
    +              <- tcInstFun do_ql inst_final tc_head fun_sigma rn_args
    
    401 401
     
    
    402 402
            ; case do_ql of
    
    403 403
                 NoQL -> do { traceTc "tcApp:NoQL" (ppr rn_fun $$ ppr app_res_rho)
    
    ... ... @@ -431,10 +431,6 @@ tcApp rn_expr exp_res_ty
    431 431
                              -- Step 5.5: wrap up
    
    432 432
                            ; finishApp tc_head tc_args app_res_rho res_wrap } }
    
    433 433
     
    
    434
    -setQLInstLevel :: QLFlag -> TcM a -> TcM a
    
    435
    -setQLInstLevel DoQL thing_inside = setTcLevel QLInstVar thing_inside
    
    436
    -setQLInstLevel NoQL thing_inside = thing_inside
    
    437
    -
    
    438 434
     quickLookResultType :: TcRhoType -> ExpRhoType -> TcM ()
    
    439 435
     -- This function implements the shaded bit of rule APP-Downarrow in
    
    440 436
     -- Fig 5 of the QL paper: "A quick look at impredicativity" (ICFP'20).
    
    ... ... @@ -723,7 +719,7 @@ tcInstFun do_ql inst_final (tc_fun, fun_ctxt) fun_sigma rn_args
    723 719
                     -- addHeadCtxt: important for the class constraints
    
    724 720
                     -- that may be emitted from instantiating fun_sigma
    
    725 721
                     addHeadCtxt fun_ctxt $
    
    726
    -                instantiateSigma fun_orig fun_conc_tvs tvs theta body2
    
    722
    +                instantiateSigma do_ql fun_orig fun_conc_tvs tvs theta body2
    
    727 723
                       -- See Note [Representation-polymorphism checking built-ins]
    
    728 724
                       -- in GHC.Tc.Utils.Concrete.
    
    729 725
                       -- NB: we are doing this even when "acc" is not empty,
    
    ... ... @@ -786,8 +782,7 @@ tcInstFun do_ql inst_final (tc_fun, fun_ctxt) fun_sigma rn_args
    786 782
             --     not defer in any way, because this is a QL instantiation variable.
    
    787 783
             -- It's easier just to do the job directly here.
    
    788 784
             do { arg_tys <- zipWithM new_arg_ty (leadingValArgs args) [pos..]
    
    789
    -           ; rr_ty   <- newFlexiTyVarTyQL do_ql runtimeRepTy
    
    790
    -           ; res_ty  <- newFlexiTyVarTyQL do_ql (mkTYPEapp rr_ty)
    
    785
    +           ; res_ty  <- newOpenFlexiTyVarTyQL do_ql TauTv
    
    791 786
                ; let fun_ty' = mkScaledFunTys arg_tys res_ty
    
    792 787
     
    
    793 788
                -- Fill in kappa := nu_1 -> .. -> nu_n -> res_nu
    
    ... ... @@ -827,12 +822,12 @@ tcInstFun do_ql inst_final (tc_fun, fun_ctxt) fun_sigma rn_args
    827 822
         new_arg_ty :: LHsExpr GhcRn -> Int -> TcM (Scaled TcType)
    
    828 823
         -- Make a fresh nus for each argument in rule IVAR
    
    829 824
         new_arg_ty (L _ arg) i
    
    830
    -      = do { arg_nu <- newOpenFlexiFRRTyVarTy $
    
    825
    +      = do { arg_nu <- newArgTyVarTyQL do_ql $
    
    831 826
                            FRRExpectedFunTy (ExpectedFunTyArg (HsExprTcThing tc_fun) arg) i
    
    832 827
                    -- Following matchActualFunTy, we create nu_i :: TYPE kappa_i[conc],
    
    833 828
                    -- thereby ensuring that the arguments have concrete runtime representations
    
    834 829
     
    
    835
    -           ; mult_ty <- newFlexiTyVarTyQL do_ql multiplicityTy
    
    830
    +            ; mult_ty <- newFlexiTyVarTyQL do_ql (mkTyVarOccFS (fsLit "m")) TauTv multiplicityTy
    
    836 831
                    -- mult_ty: e need variables for argument multiplicities (#18731)
    
    837 832
                    -- Otherwise, 'undefined x' wouldn't be linear in x
    
    838 833
     
    
    ... ... @@ -916,30 +911,55 @@ addArgCtxt ctxt (L arg_loc arg) thing_inside
    916 911
     {- *********************************************************************
    
    917 912
     *                                                                      *
    
    918 913
                   Instantiating fresh type variables
    
    914
    +
    
    915
    +      Functions in here use getTcLevelQL to decide what level
    
    916
    +      to put on fresh unification variables.  If do_ql = DoQL, we
    
    917
    +      ignore the level in the monad, and use QLInstVar instead,
    
    918
    +      thereby giving birth to a Quick Look instantiation varaible
    
    919 919
     *                                                                      *
    
    920 920
     ********************************************************************* -}
    
    921 921
     
    
    922
    -getTcLevelQL :: DoQL -> TcM TcLevel
    
    922
    +getTcLevelQL :: QLFlag -> TcM TcLevel
    
    923
    +-- If Quick Look is on, instantiate all fresh unification variables
    
    924
    +-- at level QLInstVar; they are instantiation variables
    
    923 925
     getTcLevelQL DoQL = return QLInstVar
    
    924 926
     getTcLevelQL NoQL = getTcLevel
    
    925 927
     
    
    926
    -newFlexiTyVarTyQL :: DoQL -> TcKind -> TcM TcType
    
    927
    -newFlexiTyVarTyQL do_ql kind
    
    928
    -  = do { lvl <- getTcLevelQL do_ql
    
    929
    -       ; newMetaTyVarTyAtLevel lvl kind }
    
    930
    -
    
    931
    -{-
    
    932
    -newArgTyVarQL do_ql frr_ctxt
    
    933
    -  = do { th_lvl <- getThLevel
    
    934
    -       ; rr_ty <- case th_lvl of
    
    935
    -                    TypedBrack {} -> newFlexiTyVarTyQL do_ql runtimeRepTy
    
    936
    -                    _ -> mdo { 
    
    937
    -       ; rr_ty <- 
    
    938
    -       ; newFlexiTyVarTyQL do_ql (mkTYPEapp rr_ty) }
    
    939
    --}
    
    940
    -
    
    941
    -instantiateSigma :: CtOrigin
    
    942
    -                 -> QLFlag
    
    928
    +newFlexiTyVarQL :: QLFlag -> OccName -> MetaInfo -> TcKind -> TcM TcTyVar
    
    929
    +newFlexiTyVarQL do_ql occ info kind
    
    930
    +  = do { lvl  <- getTcLevelQL do_ql
    
    931
    +       ; ref  <- newMutVar Flexi
    
    932
    +       ; name <- newSysName occ -- See Note [Name of an unification variable]
    
    933
    +                                -- in GHC.Tc.Utils.TcMType
    
    934
    +       ; let details = MetaTv { mtv_info  = info
    
    935
    +                              , mtv_ref   = ref
    
    936
    +                              , mtv_tclvl = lvl }
    
    937
    +       ; return (mkTcTyVar name kind details) }
    
    938
    +
    
    939
    +newFlexiTyVarTyQL :: QLFlag -> OccName -> MetaInfo -> TcKind -> TcM TcType
    
    940
    +newFlexiTyVarTyQL do_ql occ info kind
    
    941
    +  = mkTyVarTy <$> newFlexiTyVarQL do_ql occ info kind
    
    942
    +
    
    943
    +newOpenFlexiTyVarTyQL :: QLFlag -> MetaInfo -> TcM TcType
    
    944
    +newOpenFlexiTyVarTyQL do_ql rr_info
    
    945
    +  = do { let rr_occ = mkTyVarOccFS (fsLit "cx")
    
    946
    +             tv_occ = mkTyVarOccFS (fsLit "q")
    
    947
    +        ; rr_ty  <- newFlexiTyVarTyQL do_ql rr_occ rr_info runtimeRepTy
    
    948
    +        ; arg_nu <- newFlexiTyVarTyQL do_ql tv_occ TauTv   (mkTYPEapp rr_ty)
    
    949
    +        ; return arg_nu }
    
    950
    +
    
    951
    +newArgTyVarTyQL :: QLFlag -> FixedRuntimeRepContext -> TcM TcType
    
    952
    +newArgTyVarTyQL do_ql frr_ctxt
    
    953
    +  = mdo { let conc_orig = ConcreteFRR $
    
    954
    +                          FixedRuntimeRepOrigin
    
    955
    +                            { frr_context = frr_ctxt
    
    956
    +                            , frr_type    = arg_nu }
    
    957
    +        ; rr_info <- mkConcreteInfo conc_orig
    
    958
    +        ; arg_nu  <- newOpenFlexiTyVarTyQL do_ql rr_info
    
    959
    +        ; return arg_nu }
    
    960
    +
    
    961
    +instantiateSigma :: QLFlag
    
    962
    +                 -> CtOrigin
    
    943 963
                      -> ConcreteTyVars -- ^ concreteness information
    
    944 964
                      -> [TyVar]
    
    945 965
                      -> TcThetaType -> TcSigmaType
    
    ... ... @@ -947,9 +967,8 @@ instantiateSigma :: CtOrigin
    947 967
     -- (instantiate orig tvs theta ty)
    
    948 968
     -- instantiates the type variables tvs, emits the (instantiated)
    
    949 969
     -- constraints theta, and returns the (instantiated) type ty
    
    950
    -instantiateSigma orig do_ql concs tvs theta body_ty
    
    951
    -  = do { tv_lvl <- getTcLevelQL do_ql
    
    952
    -       ; rec (subst, inst_tvs) <- mapAccumLM (new_meta tv_lvl subst) empty_subst tvs
    
    970
    +instantiateSigma do_ql orig concs tvs theta body_ty
    
    971
    +  = do { rec (subst, inst_tvs) <- mapAccumLM (new_meta subst) empty_subst tvs
    
    953 972
            ; let inst_theta  = substTheta subst theta
    
    954 973
                  inst_body   = substTy subst body_ty
    
    955 974
     
    
    ... ... @@ -959,7 +978,7 @@ instantiateSigma orig do_ql concs tvs theta body_ty
    959 978
                            , text "tvs"   <+> ppr tvs
    
    960 979
                            , text "theta" <+> ppr theta
    
    961 980
                            , text "type" <+> debugPprType body_ty
    
    962
    -                       , text "with" <+> vcat (map debugPprType inst_tv_tys)
    
    981
    +                       , text "with" <+> ppr inst_tvs
    
    963 982
                            , text "theta:" <+> ppr inst_theta ])
    
    964 983
     
    
    965 984
           ; return (wrap, inst_body) }
    
    ... ... @@ -969,35 +988,26 @@ instantiateSigma orig do_ql concs tvs theta body_ty
    969 988
                    --                We just want an accurate free-var set
    
    970 989
         empty_subst = mkEmptySubst in_scope
    
    971 990
     
    
    972
    -    new_meta :: TcLevel -> Subst -> Subst -> TyVar -> TcM (Subst, TcTyVar)
    
    973
    -    new_meta tv_lvl final_subst subst tv
    
    974
    -      = do { name <- cloneMetaTyVarName (tyVarName tv)
    
    975
    -           ; ref  <- newMutVar Flexi
    
    976
    -           ; info <- get_info tv
    
    977
    -           ; let details = MetaTv { mtv_info  = info
    
    978
    -                                  , mtv_ref   = ref
    
    979
    -                                  , mtv_tclvl = tv_lvl }
    
    980
    -           ; let substd_kind = substTy subst (tyVarKind tv)
    
    981
    -                 new_tv      = mkTcTyVar name substd_kind details
    
    982
    -                 new_subst   = extendTvSubstWithClone subst tv new_tv
    
    991
    +    new_meta :: Subst -> Subst -> TyVar -> TcM (Subst, TcTyVar)
    
    992
    +    new_meta final_subst subst tv
    
    993
    +      = do { let occ = getOccName tv
    
    994
    +                 substd_kind = substTy subst (tyVarKind tv)
    
    995
    +           ; info   <- get_info final_subst tv
    
    996
    +           ; new_tv <- newFlexiTyVarQL do_ql occ info substd_kind
    
    997
    +           ; let new_subst   = extendTvSubstWithClone subst tv new_tv
    
    983 998
                ; return (new_subst, new_tv) }
    
    984 999
     
    
    985 1000
         get_info :: Subst -> TyVar -> TcM MetaInfo
    
    986
    -    get_info concs final_subst tv
    
    1001
    +    get_info final_subst tv
    
    987 1002
           -- Is this a type variable that must be instantiated to a concrete type?
    
    988 1003
           -- If so, create a ConcreteTv metavariable instead of a plain TauTv.
    
    989 1004
           -- See Note [Representation-polymorphism checking built-ins]
    
    990 1005
           --     in GHC.Tc.Utils.Concrete.
    
    991
    -      --
    
    992
    -      -- But check TH level: see [Wrinkle: Typed Template Haskell]
    
    993
    -      -- in Note [hasFixedRuntimeRep] in GHC.Tc.Utils.Concrete.
    
    1006
    +
    
    994 1007
           | Just conc_orig0 <- lookupNameEnv concs (tyVarName tv)
    
    995 1008
           , let conc_orig = substConcreteTvOrigin final_subst body_ty conc_orig0
    
    996 1009
                             -- See Note [substConcreteTvOrigin].
    
    997
    -      = do { th_lvl <- getThLevel
    
    998
    -           ; case th_lvl of
    
    999
    -              TypedBrack {} -> return TauTv
    
    1000
    -              _             -> return (ConcreteTv conc) }
    
    1010
    +      = mkConcreteInfo conc_orig
    
    1001 1011
     
    
    1002 1012
           -- The vastly common case
    
    1003 1013
           | otherwise
    

  • compiler/GHC/Tc/Utils/Instantiate.hs
    ... ... @@ -80,7 +80,6 @@ import GHC.Types.SrcLoc as SrcLoc
    80 80
     import GHC.Types.Var.Env
    
    81 81
     import GHC.Types.Id
    
    82 82
     import GHC.Types.Name
    
    83
    -import GHC.Types.Name.Env
    
    84 83
     import GHC.Types.Name.Reader (WithUserRdr(..))
    
    85 84
     import GHC.Types.Var
    
    86 85
     import qualified GHC.LanguageExtensions as LangExt
    
    ... ... @@ -304,7 +303,7 @@ topInstantiate orig sigma
    304 303
                            , text "tvs"   <+> ppr tvs
    
    305 304
                            , text "theta" <+> ppr theta
    
    306 305
                            , text "type" <+> debugPprType body_ty
    
    307
    -                       , text "with" <+> vcat (map debugPprType inst_tv_tys)
    
    306
    +                       , text "with" <+> ppr inst_tvs
    
    308 307
                            , text "theta:" <+> ppr inst_theta ])
    
    309 308
     
    
    310 309
           ; return (wrap2 <.> wrap1, inner_body) }
    

  • compiler/GHC/Tc/Utils/TcMType.hs
    ... ... @@ -29,7 +29,7 @@ module GHC.Tc.Utils.TcMType (
    29 29
       newOpenBoxedTypeKind,
    
    30 30
       newMetaKindVar, newMetaKindVars,
    
    31 31
       newMetaTyVarTyAtLevel, newConcreteTyVarTyAtLevel, substConcreteTvOrigin,
    
    32
    -  newAnonMetaTyVar, newConcreteTyVar,
    
    32
    +  newAnonMetaTyVar, newConcreteTyVar, mkConcreteInfo,
    
    33 33
       cloneMetaTyVar, cloneMetaTyVarWithInfo,
    
    34 34
       newCycleBreakerTyVar,
    
    35 35
     
    
    ... ... @@ -58,7 +58,6 @@ module GHC.Tc.Utils.TcMType (
    58 58
       newMetaTyVars, newMetaTyVarX, newMetaTyVarsX, newMetaTyVarBndrsX,
    
    59 59
       newMetaTyVarTyVarX,
    
    60 60
       newTyVarTyVar, cloneTyVarTyVar,
    
    61
    -  newConcreteTyVarX,
    
    62 61
       newPatTyVar, newSkolemTyVar, newWildCardX,
    
    63 62
     
    
    64 63
       --------------------------------
    
    ... ... @@ -714,25 +713,28 @@ used for ScopedTypeVariables in patterns, to make sure these type
    714 713
     variables only refer to other type variables, but this restriction was
    
    715 714
     dropped, and ScopedTypeVariables can now refer to full types (GHC
    
    716 715
     Proposal 29).
    
    716
    +
    
    717
    +Note [Name of a unification variable]
    
    718
    +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    719
    +We give unification variables a /System/ Name, which is eagerly elmininated
    
    720
    +the the unifier; see GHC.Tc.Utils.Unify.nicer_to_update_tv1, and
    
    721
    +GHC.Tc.Solver.Equality.canEqTyVarTyVar (nicer_to_update_tv2)
    
    722
    +
    
    723
    +Note [Name of an instantiated type variable]
    
    724
    +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    725
    +At the moment we give a unification variable a System Name, which
    
    726
    +influences the way it is tidied; see TypeRep.tidyTyVarBndr.
    
    717 727
     -}
    
    718 728
     
    
    719 729
     newMetaTyVarName :: FastString -> TcM Name
    
    720
    --- Makes a /System/ Name, which is eagerly eliminated by
    
    721
    --- the unifier; see GHC.Tc.Utils.Unify.nicer_to_update_tv1, and
    
    722
    --- GHC.Tc.Solver.Equality.canEqTyVarTyVar (nicer_to_update_tv2)
    
    730
    +-- Makes a /System/ Name; see Note [Name of a unification variable]
    
    723 731
     newMetaTyVarName str
    
    724 732
       = newSysName (mkTyVarOccFS str)
    
    725 733
     
    
    726 734
     cloneMetaTyVarName :: Name -> TcM Name
    
    735
    +-- See Note [Name of an instantiated type variable]
    
    727 736
     cloneMetaTyVarName name
    
    728 737
       = newSysName (nameOccName name)
    
    729
    -         -- See Note [Name of an instantiated type variable]
    
    730
    -
    
    731
    -{- Note [Name of an instantiated type variable]
    
    732
    -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    733
    -At the moment we give a unification variable a System Name, which
    
    734
    -influences the way it is tidied; see TypeRep.tidyTyVarBndr.
    
    735
    --}
    
    736 738
     
    
    737 739
     metaInfoToTyVarName :: MetaInfo -> FastString
    
    738 740
     metaInfoToTyVarName  meta_info =
    
    ... ... @@ -795,18 +797,21 @@ newConcreteTyVar :: HasDebugCallStack => ConcreteTvOrigin
    795 797
                      -> FastString -> TcKind -> TcM TcTyVar
    
    796 798
     newConcreteTyVar reason fs kind
    
    797 799
       = assertPpr (isConcreteType kind) assert_msg $
    
    798
    -  do { th_lvl <- getThLevel
    
    799
    -     ; if
    
    800
    -        -- See [Wrinkle: Typed Template Haskell]
    
    801
    -        -- in Note [hasFixedRuntimeRep] in GHC.Tc.Utils.Concrete.
    
    802
    -        | TypedBrack _ <- th_lvl
    
    803
    -        -> newNamedAnonMetaTyVar fs TauTv kind
    
    804
    -
    
    805
    -        | otherwise
    
    806
    -        -> newNamedAnonMetaTyVar fs (ConcreteTv reason) kind }
    
    800
    +  do { info <- mkConcreteInfo reason
    
    801
    +     ; newNamedAnonMetaTyVar fs info kind }
    
    807 802
       where
    
    808 803
         assert_msg = text "newConcreteTyVar: non-concrete kind" <+> ppr kind
    
    809 804
     
    
    805
    +mkConcreteInfo :: ConcreteTvOrigin -> TcM MetaInfo
    
    806
    +-- Usually returns (ConcreteTv origin); but if we are in a typed
    
    807
    +-- Template Haskell bracket, return TauTv
    
    808
    +-- See [Wrinkle: Typed Template Haskell] in Note [hasFixedRuntimeRep] in GHC.Tc.Utils.Concrete
    
    809
    +mkConcreteInfo conc_origin
    
    810
    +  = do { th_lvl <- getThLevel
    
    811
    +       ; case th_lvl of
    
    812
    +            TypedBrack {} -> return TauTv
    
    813
    +            _             -> return (ConcreteTv conc_origin) }
    
    814
    +
    
    810 815
     newPatTyVar :: Name -> Kind -> TcM TcTyVar
    
    811 816
     newPatTyVar name kind
    
    812 817
       = do { details <- newMetaDetails TauTv
    
    ... ... @@ -981,18 +986,13 @@ newOpenFlexiTyVar
    981 986
     -- in GHC.Tc.Utils.Concrete.
    
    982 987
     newOpenFlexiFRRTyVar :: FixedRuntimeRepContext -> TcM TcTyVar
    
    983 988
     newOpenFlexiFRRTyVar frr_ctxt
    
    984
    -  = do { th_lvl <- getThLevel
    
    985
    -       ; case th_lvl of
    
    986
    -          { TypedBrack _ -- See [Wrinkle: Typed Template Haskell]
    
    987
    -              -> newOpenFlexiTyVar -- in Note [hasFixedRuntimeRep] in GHC.Tc.Utils.Concrete.
    
    988
    -          ; _ ->
    
    989
    -   mdo { let conc_orig = ConcreteFRR $
    
    989
    +  = mdo { let conc_orig = ConcreteFRR $
    
    990 990
                               FixedRuntimeRepOrigin
    
    991 991
                                 { frr_context = frr_ctxt
    
    992 992
                                 , frr_type    = mkTyVarTy tv }
    
    993
    -        ; rr <- mkTyVarTy <$> newConcreteTyVar conc_orig (fsLit "cx") runtimeRepTy
    
    994
    -        ; tv <- newFlexiTyVar (mkTYPEapp rr)
    
    995
    -        ; return tv } } }
    
    993
    +        ; rr_tv <- newConcreteTyVar conc_orig (fsLit "cx") runtimeRepTy
    
    994
    +        ; tv <- newFlexiTyVar (mkTYPEapp (mkTyVarTy rr_tv))
    
    995
    +        ; return tv }
    
    996 996
     
    
    997 997
     -- | See 'newOpenFlexiFRRTyVar'.
    
    998 998
     newOpenFlexiFRRTyVarTy :: FixedRuntimeRepContext -> TcM TcType