X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fmain%2FGHC.hs;h=dd8658175d78e5a2248bbbc032aa69933b3046c7;hb=1172cf9f1b48a0f9ea13269af9395c5c0e13a175;hp=21b4fd916f4939a72ebe86957a8aec967acb58a7;hpb=593daf39e9daa45771f9ce0a28e2eca43d449473;p=ghc-hetmet.git diff --git a/ghc/compiler/main/GHC.hs b/ghc/compiler/main/GHC.hs index 21b4fd9..dd86581 100644 --- a/ghc/compiler/main/GHC.hs +++ b/ghc/compiler/main/GHC.hs @@ -703,6 +703,22 @@ type ParsedSource = Located (HsModule RdrName) type RenamedSource = HsGroup Name type TypecheckedSource = LHsBinds Id +-- NOTE: +-- - things that aren't in the output of the renamer: +-- - the export list +-- - the imports +-- - things that aren't in the output of the typechecker right now: +-- - the export list +-- - the imports +-- - type signatures +-- - type/data/newtype declarations +-- - class declarations +-- - instances +-- - extra things in the typechecker's output: +-- - default methods are turned into top-level decls. +-- - dictionary bindings + + -- | This is the way to get access to parsed and typechecked source code -- for a module. 'checkModule' loads all the dependencies of the specified -- module in the Session, and then attempts to typecheck the module. If @@ -1682,36 +1698,22 @@ lookupGlobalName s name = withSession s $ \hsc_env -> do eps <- readIORef (hsc_EPS hsc_env) return $! lookupType (hsc_HPT hsc_env) (eps_PTE eps) name -#if 0 +-- ----------------------------------------------------------------------------- +-- Misc exported utils -data ObjectCode - = ByteCode - | BinaryCode FilePath +dataConType :: DataCon -> Type +dataConType dc = idType (dataConWrapId dc) --- ToDo: typechecks abstract syntax or renamed abstract syntax. Issues: --- - typechecked syntax includes extra dictionary translation and --- AbsBinds which need to be translated back into something closer to --- the original source. +-- | print a 'NamedThing', adding parentheses if the name is an operator. +pprParenSymName :: NamedThing a => a -> SDoc +pprParenSymName a = parenSymOcc (getOccName a) (ppr (getName a)) --- ToDo: --- - Data and Typeable instances for HsSyn. +-- ---------------------------------------------------------------------------- --- ToDo: --- - things that aren't in the output of the renamer: --- - the export list --- - the imports +#if 0 -- ToDo: --- - things that aren't in the output of the typechecker right now: --- - the export list --- - the imports --- - type signatures --- - type/data/newtype declarations --- - class declarations --- - instances --- - extra things in the typechecker's output: --- - default methods are turned into top-level decls. --- - dictionary bindings +-- - Data and Typeable instances for HsSyn. -- ToDo: check for small transformations that happen to the syntax in -- the typechecker (eg. -e ==> negate e, perhaps for fromIntegral) @@ -1848,16 +1850,6 @@ lookupName :: Session -> Name -> IO (Maybe TyThing) lookupName s name = withSession s $ \hsc_env -> tcRnLookupName hsc_env name -- ----------------------------------------------------------------------------- --- Misc exported utils - -dataConType :: DataCon -> Type -dataConType dc = idType (dataConWrapId dc) - --- | print a 'NamedThing', adding parentheses if the name is an operator. -pprParenSymName :: NamedThing a => a -> SDoc -pprParenSymName a = parenSymOcc (getOccName a) (ppr (getName a)) - --- ----------------------------------------------------------------------------- -- Getting the type of an expression -- | Get the type of an expression