
Berk Özkütük pushed to branch wip/ozkutuk/sprint-fun at Glasgow Haskell Compiler / GHC Commits: e68113f3 by Berk Özkütük at 2025-06-07T23:44:58+02:00 Add AP and PAP to the list of fun-like closures - - - - - 3 changed files: - compiler/GHC/Runtime/Heap/Inspect.hs - testsuite/tests/ghci/scripts/T14828.stdout - testsuite/tests/ghci/scripts/shadow-bindings.stdout Changes: ===================================== compiler/GHC/Runtime/Heap/Inspect.hs ===================================== @@ -367,7 +367,7 @@ cPprTermBase y = , ifTerm' (isTyCon doubleTyCon . ty) ppr_double , ifTerm' (isTyCon integerTyCon . ty) ppr_integer , ifTerm' (isTyCon naturalTyCon . ty) ppr_natural - , ifFunSuspension (isFunTy . ty) ppr_fun + , ifFunSuspension (isFunTy . ty) ppr_fun ] where ifTerm :: (Term -> Bool) @@ -386,9 +386,11 @@ cPprTermBase y = -> (Precedence -> Term -> m (Maybe SDoc)) -> Precedence -> Term -> m (Maybe SDoc) ifFunSuspension pred f prec t@Suspension{ctype = ctype} - | ctype `elem` fun_ctype && pred t = f prec t + | ctype `elem` fun_ctype && pred t = f prec t where - fun_ctype = [ FUN, FUN_1_0, FUN_0_1, FUN_2_0, FUN_1_1, FUN_0_2, FUN_STATIC ] + -- TODO(ozkutuk): PAP _seems to be_ indicate a function closure, + -- I have no idea what AP is though + fun_ctype = [ FUN, FUN_1_0, FUN_0_1, FUN_2_0, FUN_1_1, FUN_0_2, FUN_STATIC, AP, PAP ] ifFunSuspension _ _ _ _ = return Nothing isFunTy :: Type -> Bool ===================================== testsuite/tests/ghci/scripts/T14828.stdout ===================================== @@ -15,4 +15,4 @@ mappend = <_ :: forall a. Monoid a => a -> a -> a> foldl' = <_ :: forall (t :: * -> *) b a. Foldable t => (b -> a -> b) -> b -> t a -> b> -f = <_ :: forall b. (forall a. a -> a) -> b -> b> +f = (_t8::(forall a. a -> a) -> b -> b) ===================================== testsuite/tests/ghci/scripts/shadow-bindings.stdout ===================================== @@ -27,7 +27,7 @@ it :: () = () Expecting T and foo with function type type T :: * data T = ... -foo :: T -> Bool = <_ :: T -> Bool> +foo :: T -> Bool = _ it :: () = () Expecting T and foo :: Bool type T :: * View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e68113f3716406391813bf575e2a663c... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e68113f3716406391813bf575e2a663c... You're receiving this email because of your account on gitlab.haskell.org.