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

Methods

askHsModuleEnv :: m HsModuleEnv Source #

default askHsModuleEnv :: (MonadTrans t, Monad n, m ~ t n, ReadHsModuleEnv n) => m HsModuleEnv Source #

Instances

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

Defined in Agda.Compiler.MAlonzo.Misc

Methods

askHsModuleEnv :: MaybeT m HsModuleEnv Source #

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

Defined in Agda.Compiler.MAlonzo.Misc

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

Defined in Agda.Compiler.MAlonzo.Compiler

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

Defined in Agda.Compiler.MAlonzo.Compiler

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

Defined in Agda.Compiler.MAlonzo.Misc

Methods

askHsModuleEnv :: StateT s m HsModuleEnv Source #

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

Defined in Agda.Compiler.MAlonzo.Misc

Methods

askHsModuleEnv :: ExceptT e m HsModuleEnv Source #

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

Defined in Agda.Compiler.MAlonzo.Misc

Methods

askHsModuleEnv :: IdentityT m HsModuleEnv Source #

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.

ihname :: String -> Nat -> Name Source #

unqhname :: String -> QName -> Name Source #

xhqn :: String -> QName -> HsCompileM QName Source #

hsName :: String -> QName Source #

bltQual :: String -> String -> HsCompileM QName Source #

duname :: QName -> Name Source #

Name for definition stripped of unused arguments

hsPrimOp :: String -> QOp Source #

hsPrimOpApp :: String -> Exp -> Exp -> Exp Source #

hsInt :: Integer -> Exp Source #

hsTypedInt :: Integral a => a -> Exp Source #

hsTypedDouble :: Real a => a -> Exp Source #

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

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

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

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

mazstr :: String Source #

mazMod' :: String -> ModuleName Source #

rtmHole :: String -> Exp Source #

rtmQual :: String -> QName Source #

rtmVar :: String -> Exp Source #

rtmError :: Text -> Exp Source #

fakeD :: Name -> String -> Decl Source #

fakeDS :: String -> String -> Decl Source #

fakeDQ :: QName -> String -> Decl Source #

fakeType :: String -> Type Source #

fakeExp :: String -> Exp Source #

fakeDecl :: String -> Decl 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.