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

Refactoring of Curry to IL translation

parent 345bedb0
......@@ -41,7 +41,7 @@ import Env.Value (ValueEnv, ValueInfo (..), lookupValue, qualLookupValue)
import CompilerOpts (Options (..))
import qualified IL as IL
import qualified ModuleSummary
import Transformations (translType)
import Transformations (transType)
trace' :: String -> a -> a
trace' _ x = x
......@@ -968,7 +968,7 @@ lookupIdType qid = do
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 (translType m tyEnv tcEnv t)) -- imported name
t : _ -> liftM Just (visitType (transType m tyEnv tcEnv t)) -- imported name
[] -> case qidModule qid of
Nothing -> trace' ("no type for " ++ show qid) $ return Nothing -- no known type
Just _ -> lookupIdType qid {qidModule = Nothing}
......
......@@ -21,7 +21,7 @@ import Env.Value
import Env.TypeConstructor
import Transformations.CaseCompletion as CC (completeCase)
import Transformations.CurryToIL as IL (ilTrans, translType')
import Transformations.CurryToIL as IL (ilTrans, transType)
import Transformations.Desugar as DS (desugar)
import Transformations.Lift as L (lift)
import Transformations.Qual as Q (qual)
......@@ -42,8 +42,8 @@ ilTrans flat mdl env = (il, env)
where il = IL.ilTrans flat (valueEnv env) (tyConsEnv env) mdl
-- |Translate a type into its representation in the intermediate language
translType :: ModuleIdent -> ValueEnv -> TCEnv -> Type -> IL.Type
translType = IL.translType'
transType :: ModuleIdent -> ValueEnv -> TCEnv -> Type -> IL.Type
transType = IL.transType
-- |Remove syntactic sugar
desugar :: Module -> CompilerEnv -> (Module, CompilerEnv)
......
This diff is collapsed.
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