Agda-2.6.2: A dependently typed functional programming language and proof assistant
Safe HaskellNone
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.

Instances

Instances details
Monad m => ReadHsModuleEnv (ReaderT HsModuleEnv m) Source # 
Instance details

Defined in Agda.Compiler.MAlonzo.Misc

class Monad m => ReadHsModuleEnv m where Source #

Monads that can produce an HsModuleEnv

Minimal complete definition

Nothing

type HsCompileT m = ReaderT HsModuleEnv (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 :: ReadHsModuleEnv 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 :: ReadHsModuleEnv 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 :: ReadHsModuleEnv m => m ModuleName Source #

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

Types coming from Agda are named "T<number>".

Other definitions coming from Agda are named "d<number>".

Names coming from Haskell must always be used qualified.

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.