mirror of
https://github.com/GaloisInc/cryptol.git
synced 2024-12-16 11:22:33 +03:00
Remove unused code, add explicit exports
This commit is contained in:
parent
f398a68fad
commit
bd0d3ccf35
@ -13,7 +13,7 @@
|
||||
{-# LANGUAGE ViewPatterns #-}
|
||||
{-# LANGUAGE RecursiveDo #-}
|
||||
{-# LANGUAGE Safe #-}
|
||||
module Cryptol.TypeCheck.Infer where
|
||||
module Cryptol.TypeCheck.Infer(checkSigB,inferModule,inferBinds,inferDs) where
|
||||
|
||||
import Cryptol.ModuleSystem.Name (asPrim,lookupPrimDecl)
|
||||
import Cryptol.Parser.Position
|
||||
@ -51,10 +51,6 @@ import Control.Monad(zipWithM,unless)
|
||||
|
||||
inferModule :: P.Module Name -> InferM Module
|
||||
inferModule m =
|
||||
do inferModuleK m return
|
||||
|
||||
inferModuleK :: P.Module Name -> (Module -> InferM a) -> InferM a
|
||||
inferModuleK m continue =
|
||||
inferDs (P.mDecls m) $ \ds1 ->
|
||||
do proveModuleTopLevel
|
||||
ts <- getTSyns
|
||||
@ -62,16 +58,16 @@ inferModuleK m continue =
|
||||
pTs <- getParamTypes
|
||||
pCs <- getParamConstraints
|
||||
pFuns <- getParamFuns
|
||||
continue Module { mName = thing (P.mName m)
|
||||
, mExports = P.modExports m
|
||||
, mImports = map thing (P.mImports m)
|
||||
, mTySyns = Map.mapMaybe onlyLocal ts
|
||||
, mNewtypes = Map.mapMaybe onlyLocal nts
|
||||
, mParamTypes = pTs
|
||||
, mParamConstraints = pCs
|
||||
, mParamFuns = pFuns
|
||||
, mDecls = ds1
|
||||
}
|
||||
return Module { mName = thing (P.mName m)
|
||||
, mExports = P.modExports m
|
||||
, mImports = map thing (P.mImports m)
|
||||
, mTySyns = Map.mapMaybe onlyLocal ts
|
||||
, mNewtypes = Map.mapMaybe onlyLocal nts
|
||||
, mParamTypes = pTs
|
||||
, mParamConstraints = pCs
|
||||
, mParamFuns = pFuns
|
||||
, mDecls = ds1
|
||||
}
|
||||
where
|
||||
onlyLocal (IsLocal, x) = Just x
|
||||
onlyLocal (IsExternal, _) = Nothing
|
||||
|
Loading…
Reference in New Issue
Block a user