X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fghci%2FRtClosureInspect.hs;h=26816a03ecec7cd582ab0e2b413d4be0e103cfa6;hb=7d6dffe542bdad5707a929ae7ac25813c586766d;hp=f653de64e5c0beca1558feb5a2fd55e7a64e0b67;hpb=eeaa039982364fb658d4e6824e078c553ba8c748;p=ghc-hetmet.git diff --git a/compiler/ghci/RtClosureInspect.hs b/compiler/ghci/RtClosureInspect.hs index f653de6..26816a0 100644 --- a/compiler/ghci/RtClosureInspect.hs +++ b/compiler/ghci/RtClosureInspect.hs @@ -10,14 +10,6 @@ module RtClosureInspect( cvObtainTerm, -- :: HscEnv -> Bool -> Maybe Type -> HValue -> IO Term - AddressEnv(..), - DataConEnv, - extendAddressEnvList, - elemAddressEnv, - delFromAddressEnv, - emptyAddressEnv, - lookupAddressEnv, - ClosureType(..), getClosureData, -- :: a -> IO Closure Closure ( tipe, infoTable, ptrs, nonPtrs ), @@ -39,8 +31,6 @@ module RtClosureInspect( isPointed, isFullyEvaluatedTerm, -- unsafeDeepSeq, - - sigmaType ) where #include "HsVersions.h" @@ -315,8 +305,9 @@ printTerm :: Term -> SDoc printTerm Prim{value=value} = text value printTerm t@Term{} = printTerm1 0 t printTerm Suspension{bound_to=Nothing} = char '_' -- <> ppr ct <> char '_' -printTerm Suspension{mb_ty=Just ty, bound_to=Just n} = - parens$ ppr n <> text "::" <> ppr ty +printTerm Suspension{mb_ty=Just ty, bound_to=Just n} + | Just _ <- splitFunTy_maybe ty = text "" + | otherwise = parens$ ppr n <> text "::" <> ppr ty printTerm1 p Term{dc=dc, subTerms=tt} {- | dataConIsInfix dc, (t1:t2:tt') <- tt @@ -571,7 +562,7 @@ zonkTerm = foldTerm idTermFoldM { -- Is this defined elsewhere? --- Find all free tyvars and insert the appropiate ForAll. +-- Generalize the type: find all free tyvars and wrap in the appropiate ForAll. sigmaType ty = mkForAllTys (varSetElems$ tyVarsOfType (dropForAlls ty)) ty {- @@ -624,34 +615,3 @@ map Just [[1,1],[2,2]] :: [Maybe [Integer]] NOTE: (Num t) contexts have been manually replaced by Integer for clarity -} - --------------------------------------------------------------------- --- The DataConEnv is used to store the addresses of datacons loaded --- via the dynamic linker --------------------------------------------------------------------- - -type DataConEnv = AddressEnv StgInfoTable - --- Note that this AddressEnv and DataConEnv I wrote trying to follow --- conventions in ghc, but probably they make not much sense. - -newtype AddressEnv a = AE {aenv:: FiniteMap (Ptr a) Name} - deriving (Outputable) - -emptyAddressEnv = AE emptyFM - -extendAddressEnvList :: AddressEnv a -> [(Ptr a, Name)] -> AddressEnv a -elemAddressEnv :: Ptr a -> AddressEnv a -> Bool -delFromAddressEnv :: AddressEnv a -> Ptr a -> AddressEnv a -nullAddressEnv :: AddressEnv a -> Bool -lookupAddressEnv :: AddressEnv a -> Ptr a -> Maybe Name - -extendAddressEnvList (AE env) = AE . addListToFM env -elemAddressEnv ptr (AE env) = ptr `elemFM` env -delFromAddressEnv (AE env) = AE . delFromFM env -nullAddressEnv = isEmptyFM . aenv -lookupAddressEnv (AE env) = lookupFM env - - -instance Outputable (Ptr a) where - ppr = text . show