Agda-2.6.2.1: A dependently typed functional programming language and proof assistant
Safe HaskellSafe-Inferred
LanguageHaskell2010

Agda.Compiler.MAlonzo.Misc

Synopsis

Documentation

data HsModuleEnv Source #

Constructors

HsModuleEnv 

Fields

  • mazModuleName :: ModuleName

    The name of the Agda module

  • mazIsMainModule :: Bool

    Whether this is the compilation root and therefore should have the main function. This corresponds to the IsMain flag provided to the backend, not necessarily whether the GHC module has a main function defined.

data GHCOptions Source #

The options derived from GHCFlags and other shared options.

Constructors

GHCOptions 

Fields

Instances

Instances details
Monad m => ReadGHCOpts (ReaderT GHCOptions m) Source # 
Instance details

Defined in Agda.Compiler.MAlonzo.Compiler

data GHCEnv Source #

A static part of the GHC backend's environment that does not change from module to module.

Instances

Instances details
Monad m => ReadGHCOpts (ReaderT GHCEnv m) Source # 
Instance details

Defined in Agda.Compiler.MAlonzo.Compiler

data GHCModuleEnv Source #

Module compilation environment, bundling the overall backend session options along with the module's basic readable properties.

class Monad m => ReadGHCModuleEnv m where Source #

Monads that can produce a GHCModuleEnv.

Minimal complete definition

Nothing

Instances

Instances details
ReadGHCModuleEnv m => ReadGHCModuleEnv (MaybeT m) Source # 
Instance details

Defined in Agda.Compiler.MAlonzo.Misc

ReadGHCModuleEnv m => ReadGHCModuleEnv (ExceptT e m) Source # 
Instance details

Defined in Agda.Compiler.MAlonzo.Misc

ReadGHCModuleEnv m => ReadGHCModuleEnv (IdentityT m) Source # 
Instance details

Defined in Agda.Compiler.MAlonzo.Misc

Monad m => ReadGHCModuleEnv (ReaderT GHCModule m) Source # 
Instance details

Defined in Agda.Compiler.MAlonzo.Compiler

Monad m => ReadGHCModuleEnv (ReaderT GHCModuleEnv m) Source # 
Instance details

Defined in Agda.Compiler.MAlonzo.Misc

ReadGHCModuleEnv m => ReadGHCModuleEnv (StateT s m) Source # 
Instance details

Defined in Agda.Compiler.MAlonzo.Misc

type HsCompileT m = ReaderT GHCModuleEnv (StateT HsCompileState m) Source #

Transformer adding read-only module info and a writable set of imported modules

type HsCompileM = HsCompileT TCM Source #

The default compilation monad is the entire TCM (☹️) enriched with our state and module info

curIsMainModule :: ReadGHCModuleEnv m => m Bool Source #

Whether the current module is expected to have the main function. This corresponds to the IsMain flag provided to the backend, not necessarily whether the GHC module actually has a main function defined.

curAgdaMod :: ReadGHCModuleEnv m => m ModuleName Source #

This is the same value as curMName, but does not rely on the TCM's state. (curMName and co. should be removed, but the current Backend interface is not sufficient yet to allow that)

curHsMod :: ReadGHCModuleEnv m => m ModuleName Source #

Get the Haskell module name of the currently-focused Agda module

data FunctionKind Source #

There are two kinds of functions: those definitely without unused arguments, and those that might have unused arguments.

Constructors

NoUnused 
PossiblyUnused 

data VariableKind Source #

Different kinds of variables: those starting with a, those starting with v, and those starting with x.

Constructors

A 
V 
X 

data NameKind Source #

Different kinds of names.

Constructors

TypeK

Types.

ConK

Constructors.

VarK VariableKind

Variables.

CoverK

Used for coverage checking.

CheckK

Used for constructor type checking.

FunK FunctionKind

Other functions.

encodeString :: NameKind -> String -> String Source #

Turns strings into valid Haskell identifiers.

In order to avoid clashes with names of regular Haskell definitions (those not generated from Agda definitions), make sure that the Haskell names are always used qualified, with the exception of names from the prelude.

duname :: QName -> Name Source #

Name for definition stripped of unused arguments

hsLet :: Name -> Exp -> Exp -> Exp Source #

hsLambda :: [Pat] -> Exp -> Exp Source #

hsMapAlt :: (Exp -> Exp) -> Alt -> Alt Source #

hsMapRHS :: (Exp -> Exp) -> Rhs -> Rhs Source #

isModChar :: Char -> Bool Source #

Can the character be used in a Haskell module name part (conid)? This function is more restrictive than what the Haskell report allows.