ivory-0.1.0.6: Safe embedded C programming.

Safe HaskellNone
LanguageHaskell2010

Ivory.Language.Module

Synopsis

Documentation

newtype ModuleM a Source #

Constructors

Module 

Instances

Monad ModuleM Source # 

Methods

(>>=) :: ModuleM a -> (a -> ModuleM b) -> ModuleM b #

(>>) :: ModuleM a -> ModuleM b -> ModuleM b #

return :: a -> ModuleM a #

fail :: String -> ModuleM a #

Functor ModuleM Source # 

Methods

fmap :: (a -> b) -> ModuleM a -> ModuleM b #

(<$) :: a -> ModuleM b -> ModuleM a #

Applicative ModuleM Source # 

Methods

pure :: a -> ModuleM a #

(<*>) :: ModuleM (a -> b) -> ModuleM a -> ModuleM b #

(*>) :: ModuleM a -> ModuleM b -> ModuleM b #

(<*) :: ModuleM a -> ModuleM b -> ModuleM a #

ReaderM ModuleM Visible Source # 

Methods

ask :: ModuleM Visible #

WriterM ModuleM Module Source # 

Methods

put :: Module -> ModuleM () #

Monoid (ModuleM ()) Source # 

Methods

mempty :: ModuleM () #

mappend :: ModuleM () -> ModuleM () -> ModuleM () #

mconcat :: [ModuleM ()] -> ModuleM () #

visAcc :: Visible -> a -> Visible a Source #

Add an element to the public/private list, depending on visibility

incl :: Def a -> ModuleDef Source #

Include a defintion in the module.

inclSym :: IvoryExpr t => t -> ModuleDef Source #

Import an externally-defined symbol.

depend :: Module -> ModuleDef Source #

Add a dependency on another module.

dependByName :: String -> ModuleDef Source #

Add a dependency on another module by name. Use the same name here that you use when you call package to build the target module. This function is particularly useful when building mutually dependent module structures.

defStruct :: forall sym. (IvoryStruct sym, ASymbol sym) => Proxy sym -> ModuleDef Source #

Include the definition of a structure in the module.

defStringType :: forall str. IvoryString str => Proxy str -> ModuleDef Source #

Include the definition of a string type's structure.

defMemArea :: IvoryArea area => MemArea area -> ModuleDef Source #

Include the definition of a memory area.

defConstMemArea :: IvoryArea area => ConstMemArea area -> ModuleDef Source #

Include the definition of a constant memory area.

package :: String -> ModuleDef -> Module Source #

Package the module up. Default visibility is public.

private :: ModuleDef -> ModuleDef Source #

Start a block of definitions that should not be put in the header.

public :: ModuleDef -> ModuleDef Source #

Start a block of definitions should be put in the header. This is the default, and this function is just included to complement private.