cosmetic change.

This commit is contained in:
Kazu Yamamoto 2012-02-15 16:57:37 +09:00
parent 9daf5b36f0
commit c2e7f00820

10
Info.hs
View File

@ -73,8 +73,8 @@ typeOf opt fileName modstr lineNo colNo =
findExpr :: TypecheckedModule -> Int -> Int -> [LHsExpr Id] findExpr :: TypecheckedModule -> Int -> Int -> [LHsExpr Id]
findExpr tcm line col = findExpr tcm line col =
let src = tm_typechecked_source tcm let src = tm_typechecked_source tcm
in listifyStaged TypeChecker f src in listifyStaged TypeChecker f src
where where
f :: LHsExpr Id -> Bool f :: LHsExpr Id -> Bool
f (L spn _) = isGoodSrcSpan spn && spn `spans` (line, col) f (L spn _) = isGoodSrcSpan spn && spn `spans` (line, col)
@ -84,9 +84,9 @@ listifyStaged s p = everythingStaged s (++) [] ([] `mkQ` (\x -> [x | p x]))
getType :: GhcMonad m => TypecheckedModule -> LHsExpr Id -> m (Maybe (SrcSpan, Type)) getType :: GhcMonad m => TypecheckedModule -> LHsExpr Id -> m (Maybe (SrcSpan, Type))
getType tcm e = do getType tcm e = do
hs_env <- getSession hs_env <- getSession
(_, mbe) <- Gap.liftIO $ deSugarExpr hs_env modu rn_env ty_env e (_, mbe) <- Gap.liftIO $ deSugarExpr hs_env modu rn_env ty_env e
return $ (getLoc e, ) <$> CoreUtils.exprType <$> mbe return $ (getLoc e, ) <$> CoreUtils.exprType <$> mbe
where where
modu = ms_mod $ pm_mod_summary $ tm_parsed_module tcm modu = ms_mod $ pm_mod_summary $ tm_parsed_module tcm
rn_env = tcg_rdr_env $ fst $ tm_internals_ tcm rn_env = tcg_rdr_env $ fst $ tm_internals_ tcm