free-compiler-0.3.0.0: A Haskell to Coq compiler.

Safe HaskellSafe
LanguageHaskell2010

FreeC.IR.Syntax.Module

Description

This module contains the definition of modules of our intermediate language.

Synopsis

Documentation

data ModuleOf contents Source #

A module declaration that contains declarations of type contents.

This type is used for example to represent partially transformed modules where only the name, imports and pragmas of the module are transformed into the intermediate representation.

Constructors

ModuleOf 
Instances
Eq contents => Eq (ModuleOf contents) Source # 
Instance details

Defined in FreeC.IR.Syntax.Module

Methods

(==) :: ModuleOf contents -> ModuleOf contents -> Bool Source #

(/=) :: ModuleOf contents -> ModuleOf contents -> Bool Source #

Show contents => Show (ModuleOf contents) Source # 
Instance details

Defined in FreeC.IR.Syntax.Module

Methods

showsPrec :: Int -> ModuleOf contents -> ShowS Source #

show :: ModuleOf contents -> String Source #

showList :: [ModuleOf contents] -> ShowS Source #

Pretty contents => Pretty (ModuleOf [contents]) Source #

Pretty instance for modules.

Instance details

Defined in FreeC.IR.Syntax.Module

Methods

pretty :: ModuleOf [contents] -> Doc #

prettyList :: [ModuleOf [contents]] -> Doc #

StripExprType contents => StripExprType (ModuleOf contents) Source #

Strips the expression type annotations from all declarations in a module.

Instance details

Defined in FreeC.IR.Strip

Methods

stripExprType :: ModuleOf contents -> ModuleOf contents Source #

Similar contents => Similar (ModuleOf contents) Source #

Two modules are similar if their names and contents are similar.

Instance details

Defined in FreeC.IR.Similar

Methods

similar' :: ModuleOf contents -> ModuleOf contents -> Renaming -> Bool

Parseable (ModuleOf [TopLevelDecl]) Source #

Modules can be parsed.

Instance details

Defined in FreeC.Frontend.IR.Parser

Methods

parseIR' :: Parser (ModuleOf [TopLevelDecl]) Source #

modWithContents :: (contents -> contents') -> ModuleOf contents -> ModuleOf contents' Source #

Applies the given function to the contents of the given module.

type Module = ModuleOf [TopLevelDecl] Source #

A module declaration.

data ImportDecl Source #

An import declaration.

Constructors

ImportDecl 
Instances
Eq ImportDecl Source # 
Instance details

Defined in FreeC.IR.Syntax.Module

Show ImportDecl Source # 
Instance details

Defined in FreeC.IR.Syntax.Module

Pretty ImportDecl Source #

Pretty instance for import declarations.

Instance details

Defined in FreeC.IR.Syntax.Module

Similar ImportDecl Source #

Two import declarations are similar if they import the same module.

Instance details

Defined in FreeC.IR.Similar

Methods

similar' :: ImportDecl -> ImportDecl -> Renaming -> Bool

Parseable ImportDecl Source #

Import declarations can be parsed.

Instance details

Defined in FreeC.Frontend.IR.Parser

Methods

parseIR' :: Parser ImportDecl Source #

data TopLevelDecl Source #

Declarations that can occur on top-level of a Module declaration.

Instances
Eq TopLevelDecl Source # 
Instance details

Defined in FreeC.IR.Syntax.Module

Show TopLevelDecl Source # 
Instance details

Defined in FreeC.IR.Syntax.Module

Pretty TopLevelDecl Source #

Pretty instance for top-level declarations.

Instance details

Defined in FreeC.IR.Syntax.Module

StripExprType TopLevelDecl Source #

Strips the expression type annotations from top-level function declarations.

Instance details

Defined in FreeC.IR.Strip

Similar TopLevelDecl Source #

Only top-level declarations of the same type can be similar.

Instance details

Defined in FreeC.IR.Similar

Methods

similar' :: TopLevelDecl -> TopLevelDecl -> Renaming -> Bool

Parseable (ModuleOf [TopLevelDecl]) Source #

Modules can be parsed.

Instance details

Defined in FreeC.Frontend.IR.Parser

Methods

parseIR' :: Parser (ModuleOf [TopLevelDecl]) Source #

isTopLevelTypeDecl :: TopLevelDecl -> Bool Source #

Tests whether the given top-level declaration is a TypeDecl.

isTopLevelTypeSig :: TopLevelDecl -> Bool Source #

Tests whether the given top-level declaration is a TypeSig.

isTopLevelFuncDecl :: TopLevelDecl -> Bool Source #

Tests whether the given top-level declaration is a FuncDecl.

modTypeDecls :: Module -> [TypeDecl] Source #

Gets the type declarations of the given module.

modWithTypeDecls :: [TypeDecl] -> Module -> Module Source #

Sets the type declarations of the given module.

All other type declarations are discarded.

modTypeSigs :: Module -> [TypeSig] Source #

Gets the type signatures of the given module.

modWithTypeSigs :: [TypeSig] -> Module -> Module Source #

Sets the type signatures of the given module.

All other type signatures are discarded.

modFuncDecls :: Module -> [FuncDecl] Source #

Gets the function declarations of the given module.

modWithFuncDecls :: [FuncDecl] -> Module -> Module Source #

Sets the function declarations of the given module.

All other function declarations are discarded.