Commit 05426068 authored by Björn Peemöller 's avatar Björn Peemöller
Browse files

Small refactorings

parent 38c2c1d8
......@@ -30,7 +30,7 @@ import Base.TypeConstructors (TCEnv, TypeInfo (..), qualLookupTC)
import Base.Value (ValueEnv, ValueInfo (..), lookupValue, qualLookupValue)
import CompilerOpts (Options (..))
import qualified CurryToIL as IL
import qualified CurryToIL as CTIL
import Env.TopEnv (topEnvMap)
import Env.CurryEnv (CurryEnv)
import qualified Env.CurryEnv as CurryEnv
......@@ -1049,7 +1049,7 @@ lookupIdType qid
case Map.lookup qid lt `mplus` Map.lookup qid ct of
Just t -> trace' ("lookupIdType local " ++ show (qid, t)) $ liftM Just (visitType t) -- local name or constructor
Nothing -> case [ t | Value _ (ForAll _ t) <- qualLookupValue qid aEnv ] of
t : _ -> liftM Just (visitType (IL.translType t)) -- imported name
t : _ -> liftM Just (visitType (CTIL.translType t)) -- imported name
[] -> case qualidMod qid of
Nothing -> trace' ("no type for " ++ show qid) $ return Nothing -- no known type
Just _ -> lookupIdType qid {qualidMod = Nothing}
......
......@@ -301,10 +301,11 @@ Interface files are updated by the Curry builder when necessary.
> --tyEnv''' = addImportedLabels m lEnv tyEnv''
> intf = exportInterface modul pEnv'' tcEnv'' tyEnv'''
> -- |Translate FlatCurry into the intermediate language 'IL'
> transModule :: Bool -> Bool -> Bool -> ModuleEnv -> ValueEnv -> TCEnv
> -> ArityEnv -> Module -> (IL.Module,ArityEnv,[(DumpLevel,Doc)])
> -> ArityEnv -> Module -> (IL.Module, ArityEnv, [(DumpLevel, Doc)])
> transModule flat' _debug _trusted mEnv tyEnv tcEnv aEnv (Module m es ds) =
> (il',aEnv',dumps)
> (il', aEnv', dumps)
> where
> topDs = filter (not . isImportDecl) ds
> evEnv = evalEnv topDs
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment