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

Merge branch 'master' of /home/bjp/public_html/repos/curry-frontend

Conflicts:

	src/Generators/GenFlatCurry.hs
parents 37a752be 364bf941
......@@ -921,24 +921,23 @@ lookupIdArity qid = gets (lookupA . typeEnvE)
getTypeOf :: Ident -> FlatState (Maybe TypeExpr)
getTypeOf _ident = return Nothing -- TODO 2011-10-18 (bjp): reactivate!
-- do
-- valEnv <- gets typeEnvE
-- case lookupValue ident valEnv of
-- Value _ _ (ForAll _ t) : _ -> do
-- t1 <- visitType (ttrans t)
-- trace' ("getTypeOf(" ++ show ident ++ ") = " ++ show t1) $
-- return (Just t1)
-- DataConstructor _ _ (ForAllExist _ _ t) : _ -> do
-- t1 <- visitType (ttrans t)
-- trace' ("getTypeOfDataCon(" ++ show ident ++ ") = " ++ show t1) $
-- return (Just t1)
-- _ -> do
-- (_, ats) <- gets functionIdE
-- case lookup ident ats of
-- Just t -> liftM Just (visitType t)
-- Nothing -> trace' ("lookupValue did not return a value for index " ++ show ident)
-- (return Nothing)
getTypeOf _ident = do
valEnv <- gets typeEnvE
case lookupValue ident valEnv of
Value _ _ (ForAll _ t) : _ -> do
t1 <- visitType (ttrans t)
trace' ("getTypeOf(" ++ show ident ++ ") = " ++ show t1) $
return (Just t1)
DataConstructor _ _ (ForAllExist _ _ t) : _ -> do
t1 <- visitType (ttrans t)
trace' ("getTypeOfDataCon(" ++ show ident ++ ") = " ++ show t1) $
return (Just t1)
_ -> do
(_, ats) <- gets functionIdE
case lookup ident ats of
Just t -> liftM Just (visitType t)
Nothing -> trace' ("lookupValue did not return a value for index " ++ show ident)
(return Nothing)
ttrans :: Type -> IL.Type
ttrans (TypeConstructor i ts) = IL.TypeConstructor i (map ttrans ts)
......
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