cryptol-2.2.6: Cryptol: The Language of Cryptography

Copyright | (c) 2013-2015 Galois, Inc.
License | BSD3
Maintainer | cryptol@galois.com
Stability | provisional
Portability | portable
Safe Haskell | None
Language | Haskell98

Cryptol.ModuleSystem.Base

Description

Synopsis

- rename :: Rename a => NamingEnv -> a -> ModuleM a
- renameModule :: Module -> ModuleM Module
- renameExpr :: Expr -> ModuleM Expr
- renameDecls :: (Rename d, FromDecl d) => [d] -> ModuleM [d]
- noPat :: RemovePatterns a => a -> ModuleM a
- parseModule :: FilePath -> ModuleM Module
- loadModuleByPath :: FilePath -> ModuleM Module
- loadImport :: Located Import -> ModuleM ()
- loadModule :: FilePath -> Module -> ModuleM Module
- fullyQualified :: Import -> Import
- importIface :: Import -> ModuleM Iface
- importIfaces :: [Import] -> ModuleM IfaceDecls
- moduleFile :: ModName -> String -> FilePath
- findModule :: ModName -> ModuleM FilePath
- findFile :: FilePath -> ModuleM FilePath
- preludeName :: ModName
- addPrelude :: Module -> Module
- loadDeps :: Module -> ModuleM ()
- checkExpr :: Expr -> ModuleM (Expr, Schema)
- checkDecls :: (HasLoc d, Rename d, FromDecl d) => [d] -> ModuleM [DeclGroup]
- checkModule :: Module -> ModuleM Module
- type TCAction i o = i -> InferInput -> IO (InferOutput o)
- typecheck :: HasLoc i => TCAction i o -> i -> IfaceDecls -> ModuleM o
- importIfacesTc :: [Import] -> ModuleM IfaceDecls
- genInferInput :: Range -> IfaceDecls -> ModuleM InferInput
- evalExpr :: Expr -> ModuleM Value
- evalDecls :: [DeclGroup] -> ModuleM ()

# Documentation

rename :: Rename a => NamingEnv -> a -> ModuleM a Source

renameModule :: Module -> ModuleM Module Source

Rename a module in the context of its imported modules.

renameExpr :: Expr -> ModuleM Expr Source

Rename an expression in the context of the focused module.

renameDecls :: (Rename d, FromDecl d) => [d] -> ModuleM [d] Source

Rename declarations in the context of the focused module.

noPat :: RemovePatterns a => a -> ModuleM a Source

Run the noPat pass.

parseModule :: FilePath -> ModuleM Module Source

loadModuleByPath :: FilePath -> ModuleM Module Source

Load a module by its path.

loadImport :: Located Import -> ModuleM () Source

Load the module specified by an import.

loadModule :: FilePath -> Module -> ModuleM Module Source

Load dependencies, typecheck, and add to the eval environment.

fullyQualified :: Import -> Import Source

Rewrite an import declaration to be of the form:

    import foo as foo [ [hiding] (a,b,c) ]

importIface :: Import -> ModuleM Iface Source

Process the interface specified by an import.

importIfaces :: [Import] -> ModuleM IfaceDecls Source

Load a series of interfaces, merging their public interfaces.

moduleFile :: ModName -> String -> FilePath Source

findModule :: ModName -> ModuleM FilePath Source

Discover a module.

findFile :: FilePath -> ModuleM FilePath Source

Discover a file. This is distinct from `findModule` in that we assume we've already been given a particular file name.

preludeName :: ModName Source

addPrelude :: Module -> Module Source

Add the prelude to the import list if it's not already mentioned.

loadDeps :: Module -> ModuleM () Source

Load the dependencies of a module into the environment.

checkExpr :: Expr -> ModuleM (Expr, Schema) Source

Typecheck a single expression.

checkDecls :: (HasLoc d, Rename d, FromDecl d) => [d] -> ModuleM [DeclGroup] Source

Typecheck a group of declarations.

checkModule :: Module -> ModuleM Module Source

Typecheck a module.

type TCAction i o = i -> InferInput -> IO (InferOutput o) Source

typecheck :: HasLoc i => TCAction i o -> i -> IfaceDecls -> ModuleM o Source

importIfacesTc :: [Import] -> ModuleM IfaceDecls Source

Process a list of imports, producing an aggregate interface suitable for use when typechecking.

genInferInput :: Range -> IfaceDecls -> ModuleM InferInput Source

Generate input for the typechecker.

evalExpr :: Expr -> ModuleM Value Source

evalDecls :: [DeclGroup] -> ModuleM () Source