[Type-constraints] Removed unnecessary definitions
This commit is contained in:
parent
960a49c1ed
commit
39659b2917
@ -316,13 +316,11 @@ setWarnTypedHoles = id
|
|||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
|
|
||||||
class HasType a where
|
class HasType a where
|
||||||
getId :: GhcMonad m => TypecheckedModule -> a -> m ([Id])
|
|
||||||
getType :: GhcMonad m => TypecheckedModule -> a -> m (Maybe (SrcSpan, Type))
|
getType :: GhcMonad m => TypecheckedModule -> a -> m (Maybe (SrcSpan, Type))
|
||||||
|
|
||||||
|
|
||||||
instance HasType (LHsBind Id) where
|
instance HasType (LHsBind Id) where
|
||||||
#if __GLASGOW_HASKELL__ >= 708
|
#if __GLASGOW_HASKELL__ >= 708
|
||||||
getId _ b = return $ collectHsBindBinders (unLoc b)
|
|
||||||
getType _ (L spn FunBind{fun_matches = m}) = return $ Just (spn, typ)
|
getType _ (L spn FunBind{fun_matches = m}) = return $ Just (spn, typ)
|
||||||
where in_tys = mg_arg_tys m
|
where in_tys = mg_arg_tys m
|
||||||
out_typ = mg_res_ty m
|
out_typ = mg_res_ty m
|
||||||
|
@ -30,14 +30,12 @@ import qualified Data.Map as M
|
|||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
|
|
||||||
instance HasType (LHsExpr Id) where
|
instance HasType (LHsExpr Id) where
|
||||||
getId _ _e = return []
|
|
||||||
getType tcm e = do
|
getType tcm e = do
|
||||||
hs_env <- G.getSession
|
hs_env <- G.getSession
|
||||||
mbe <- liftIO $ Gap.deSugar tcm e hs_env
|
mbe <- liftIO $ Gap.deSugar tcm e hs_env
|
||||||
return $ (G.getLoc e, ) <$> CoreUtils.exprType <$> mbe
|
return $ (G.getLoc e, ) <$> CoreUtils.exprType <$> mbe
|
||||||
|
|
||||||
instance HasType (LPat Id) where
|
instance HasType (LPat Id) where
|
||||||
getId _ = return . G.collectPatBinders
|
|
||||||
getType _ (G.L spn pat) = return $ Just (spn, hsPatType pat)
|
getType _ (G.L spn pat) = return $ Just (spn, hsPatType pat)
|
||||||
|
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
@ -89,12 +87,6 @@ listifySpans tcs lc = listifyStaged TypeChecker p tcs
|
|||||||
where
|
where
|
||||||
p (L spn _) = G.isGoodSrcSpan spn && spn `G.spans` lc
|
p (L spn _) = G.isGoodSrcSpan spn && spn `G.spans` lc
|
||||||
|
|
||||||
listifyAbsBinds :: TypecheckedSource -> [Located (G.HsBind Id)]
|
|
||||||
listifyAbsBinds = listifyStaged TypeChecker p
|
|
||||||
where
|
|
||||||
p (L _ G.AbsBinds{}) = True
|
|
||||||
p _ = False
|
|
||||||
|
|
||||||
listifyParsedSpans :: Typeable a => ParsedSource -> (Int, Int) -> [Located a]
|
listifyParsedSpans :: Typeable a => ParsedSource -> (Int, Int) -> [Located a]
|
||||||
listifyParsedSpans pcs lc = listifyStaged Parser p pcs
|
listifyParsedSpans pcs lc = listifyStaged Parser p pcs
|
||||||
where
|
where
|
||||||
|
Loading…
Reference in New Issue
Block a user