Skip to content

coreView is huge!

While looking at the !2952 (merged) I noticed that the Core produced for coreView (which has an INLINE pragma) is positively enormous:

coreView [InlPrag=INLINE (sat-args=1)] :: Type -> Maybe Type
[GblId,
 Arity=1,
 Str=<S,1*U>,
 Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True,
         WorkFree=True, Expandable=True,
         Guidance=ALWAYS_IF(arity=1,unsat_ok=False,boring_ok=False)
         Tmpl= \ (ty_a4zA [Occ=Once!] :: Type) ->
                 case ty_a4zA of {
                   __DEFAULT -> GHC.Maybe.Nothing @Type;
                   TyConApp tc_a4zB tys_a4zC [Occ=Once] ->
                     case expandSynTyCon_maybe @KindOrType tc_a4zB tys_a4zC of {
                       Nothing ->
                         case tc_a4zB of {
                           GHC.Core.TyCon.FunTyCon ds1_a8kI [Occ=Once] _ [Occ=Dead]
                                                   _ [Occ=Dead] _ [Occ=Dead] _ [Occ=Dead]
                                                   _ [Occ=Dead] _ [Occ=Dead] ->
                             case ds1_a8kI `cast` (Unique.N:Unique[0] :: Unique ~R# Int) of
                             { ghc-prim-0.6.1:GHC.Types.I# x_aauv [Occ=Once!] ->
                             case x_aauv of {
                               __DEFAULT -> GHC.Maybe.Nothing @Type;
                               3674937295934324920# -> GHC.Maybe.Just @Kind liftedTypeKind
                             }
                             };
                           GHC.Core.TyCon.AlgTyCon ds1_a8kQ [Occ=Once] _ [Occ=Dead]
                                                   _ [Occ=Dead] _ [Occ=Dead] _ [Occ=Dead]
                                                   _ [Occ=Dead] _ [Occ=Dead] _ [Occ=Dead]
                                                   _ [Occ=Dead] _ [Occ=Dead] _ [Occ=Dead]
                                                   _ [Occ=Dead] _ [Occ=Dead] _ [Occ=Dead] ->
                             case ds1_a8kQ `cast` (Unique.N:Unique[0] :: Unique ~R# Int) of
                             { ghc-prim-0.6.1:GHC.Types.I# x_aauv [Occ=Once!] ->
                             case x_aauv of {
                               __DEFAULT -> GHC.Maybe.Nothing @Type;
                               3674937295934324920# -> GHC.Maybe.Just @Kind liftedTypeKind
                             }
                             };
                           GHC.Core.TyCon.SynonymTyCon ds1_a8l5 [Occ=Once] _ [Occ=Dead]
                                                       _ [Occ=Dead] _ [Occ=Dead] _ [Occ=Dead]
                                                       _ [Occ=Dead] _ [Occ=Dead] _ [Occ=Dead]
                                                       _ [Occ=Dead] _ [Occ=Dead] _ [Occ=Dead] ->
                             case ds1_a8l5 `cast` (Unique.N:Unique[0] :: Unique ~R# Int) of
                             { ghc-prim-0.6.1:GHC.Types.I# x_aauv [Occ=Once!] ->
                             case x_aauv of {
                               __DEFAULT -> GHC.Maybe.Nothing @Type;
                               3674937295934324920# -> GHC.Maybe.Just @Kind liftedTypeKind
                             }
                             };
                           GHC.Core.TyCon.FamilyTyCon ds1_a8lh [Occ=Once] _ [Occ=Dead]
                                                      _ [Occ=Dead] _ [Occ=Dead] _ [Occ=Dead]
                                                      _ [Occ=Dead] _ [Occ=Dead] _ [Occ=Dead]
                                                      _ [Occ=Dead] _ [Occ=Dead] _ [Occ=Dead] ->
                             case ds1_a8lh `cast` (Unique.N:Unique[0] :: Unique ~R# Int) of
                             { ghc-prim-0.6.1:GHC.Types.I# x_aauv [Occ=Once!] ->
                             case x_aauv of {
                               __DEFAULT -> GHC.Maybe.Nothing @Type;
                               3674937295934324920# -> GHC.Maybe.Just @Kind liftedTypeKind
                             }
                             };
                           GHC.Core.TyCon.PrimTyCon ds1_a8lt [Occ=Once] _ [Occ=Dead]
                                                    _ [Occ=Dead] _ [Occ=Dead] _ [Occ=Dead]
                                                    _ [Occ=Dead] _ [Occ=Dead] _ [Occ=Dead]
                                                    _ [Occ=Dead] ->
                             case ds1_a8lt `cast` (Unique.N:Unique[0] :: Unique ~R# Int) of
                             { ghc-prim-0.6.1:GHC.Types.I# x_aauv [Occ=Once!] ->
                             case x_aauv of {
                               __DEFAULT -> GHC.Maybe.Nothing @Type;
                               3674937295934324920# -> GHC.Maybe.Just @Kind liftedTypeKind
                             }
                             };
                           GHC.Core.TyCon.PromotedDataCon ds1_a8lD [Occ=Once] _ [Occ=Dead]
                                                          _ [Occ=Dead] _ [Occ=Dead] _ [Occ=Dead]
                                                          _ [Occ=Dead] _ [Occ=Dead] _ [Occ=Dead]
                                                          _ [Occ=Dead] _ [Occ=Dead] ->
                             case ds1_a8lD `cast` (Unique.N:Unique[0] :: Unique ~R# Int) of
                             { ghc-prim-0.6.1:GHC.Types.I# x_aauv [Occ=Once!] ->
                             case x_aauv of {
                               __DEFAULT -> GHC.Maybe.Nothing @Type;
                               3674937295934324920# -> GHC.Maybe.Just @Kind liftedTypeKind
                             }
                             };
                           GHC.Core.TyCon.TcTyCon ds1_a8lO [Occ=Once] _ [Occ=Dead]
                                                  _ [Occ=Dead] _ [Occ=Dead] _ [Occ=Dead]
                                                  _ [Occ=Dead] _ [Occ=Dead] _ [Occ=Dead]
                                                  _ [Occ=Dead] _ [Occ=Dead] ->
                             case ds1_a8lO `cast` (Unique.N:Unique[0] :: Unique ~R# Int) of
                             { ghc-prim-0.6.1:GHC.Types.I# x_aauv [Occ=Once!] ->
                             case x_aauv of {
                               __DEFAULT -> GHC.Maybe.Nothing @Type;
                               3674937295934324920# -> GHC.Maybe.Just @Kind liftedTypeKind
                             }
                             }
                         };
                       Just ds_d8MC [Occ=Once!] ->
                         case ds_d8MC of
                         { (tenv_a4zD, rhs_a4zE [Occ=Once*], tys'_a4zF [Occ=Once*]) ->
                         GHC.Maybe.Just
                           @Type
                           (case tenv_a4zD of {
                              [] -> mkAppTys rhs_a4zE tys'_a4zF;
                              : _ [Occ=Dead] _ [Occ=Dead] ->
                                mkAppTys
                                  (substTy
                                     (GHC.Core.Type.coreView1
                                      `cast` (Sym (ghc-prim-0.6.1:GHC.Classes.N:IP[0]
                                                       <"callStack">_N
                                                       <GHC.Stack.Types.CallStack>_N)
                                              :: GHC.Stack.Types.CallStack
                                                 ~R# (?callStack::GHC.Stack.Types.CallStack)))
                                     (mkTvSubstPrs tenv_a4zD)
                                     rhs_a4zE)
                                  tys'_a4zF
                            })
                         }
                     }
                 }}]
coreView
  = \ (ty_a4zA :: Type) -> ...

It appears nearly all of this is due to the inlining of isConstraintKindCon.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information