{-# LANGUAGE TypeSynonymInstances #-}moduleGHC.Vacuum.Types(moduleGHC.Vacuum.Types)whereimportGHC.Vacuum.ClosureTypeimportGHC.Vacuum.Internal(HValue)importData.ListimportData.WordimportData.IntMap(IntMap)importData.Monoid(Monoid(..))importqualifiedData.IntMapasIMimportSystem.Mem.StableName------------------------------------------------typeHNodeId=IntdataHNode=HNode{nodePtrs::[HNodeId],nodeLits::[Word],nodeInfo::InfoTab}deriving(Eq,Ord,Read,Show)emptyHNode::ClosureType->HNodeemptyHNodect=HNode{nodePtrs=[],nodeLits=[],nodeInfo=ifisConctthenConInfo[][][]00ct0[]elseOtherInfo00ct0[]}nodePkg::HNode->StringnodeMod::HNode->StringnodeName::HNode->StringnodePkg=fst3.itabName.nodeInfonodeMod=snd3.itabName.nodeInfonodeName=trd3.itabName.nodeInfofst3(x,_,_)=xsnd3(_,x,_)=xtrd3(_,_,x)=xitabName::InfoTab->(String,String,String)itabNamei@(ConInfo{})=(itabPkgi,itabModi,itabConi)itabName_=([],[],[])summary::HNode->([String],[HNodeId],[Word])summary(HNodepslsinfo)=caseitabNameinfoof(a,b,c)->([a,b,c],ps,ls)dataInfoTab=ConInfo{itabPkg::String,itabMod::String,itabCon::String,itabPtrs::Word,itabLits::Word,itabType::ClosureType,itabSrtLen::Word,itabCode::[Word]}|OtherInfo{itabPtrs::Word,itabLits::Word,itabType::ClosureType,itabSrtLen::Word,itabCode::[Word]}deriving(Eq,Ord,Read,Show)dataClosure=Closure{closPtrs::[HValue],closLits::[Word],closITab::InfoTab}deriving(Show)-- So we can derive Show for ClosureinstanceShowHValuewhereshow_="(HValue)"-- A box for safe deposit of HValuesdataBoxa=Boxa------------------------------------------------dataEnv=Env{uniq::HNodeId-- the keys are hashes of StableNames,seen::IntMap[(StableNameHValue,HNodeId)],hvals::IntMap(BoxHValue),graph::IntMapHNode}emptyEnv::EnvemptyEnv=Env{uniq=0,seen=mempty,hvals=mempty,graph=mempty}------------------------------------------------