hslua-packaging-2.3.1: Utilities to build Lua modules.

Copyright | © 2020-2024 Albert Krewinkel
License | MIT
Maintainer | Albert Krewinkel <tarleb@hslua.org>
Stability | alpha
Portability | Portable
Safe Haskell | None
Language | Haskell2010

HsLua.Packaging.Types

Contents

- Documented module
- Documented functions
  - Documentation types

Description

Marshaling and documenting Haskell functions.

Synopsis

- data Module e = Module {
  - moduleName :: Name
  - moduleDescription :: Text
  - moduleFields :: [Field e]
  - moduleFunctions :: [DocumentedFunction e]
  - moduleOperations :: [(Operation, DocumentedFunction e)]
  - moduleTypeInitializers :: [LuaE e Name]
  }
- data Field e = Field {
  - fieldName :: Text
  - fieldType :: TypeSpec
  - fieldDescription :: Text
  - fieldPushValue :: LuaE e ()
  }
- data DocumentedFunction e = DocumentedFunction {
  - callFunction :: LuaE e NumResults
  - functionName :: Name
  - functionDoc :: FunctionDoc
  }
- data FunctionDoc = FunctionDoc {
  - functionDescription :: Text
  - parameterDocs :: [ParameterDoc]
  - functionResultsDocs :: ResultsDoc
  - functionSince :: Maybe Version
  }
- data ParameterDoc = ParameterDoc {
  - parameterName :: Text
  - parameterType :: TypeSpec
  - parameterDescription :: Text
  - parameterIsOptional :: Bool
  }
- data ResultsDoc
  - = ResultsDocList [ResultValueDoc]
  - | ResultsDocMult Text
- data ResultValueDoc = ResultValueDoc {
  - resultValueType :: TypeSpec
  - resultValueDescription :: Text
  }

# Documented module

data Module e Source #

Named and documented Lua module.

Constructors

Module |

Fields

- moduleName :: Name
- moduleDescription :: Text
- moduleFields :: [Field e]
- moduleFunctions :: [DocumentedFunction e]
- moduleOperations :: [(Operation, DocumentedFunction e)]
- moduleTypeInitializers :: [LuaE e Name]

data Field e Source #

Self-documenting module field

Constructors

Field |

Fields

- fieldName :: Text
- fieldType :: TypeSpec
- fieldDescription :: Text
- fieldPushValue :: LuaE e ()

# Documented functions

data DocumentedFunction e Source #

Haskell equivallent to CFunction, i.e., function callable from Lua.

Constructors

DocumentedFunction |

Fields

- callFunction :: LuaE e NumResults
- functionName :: Name
- functionDoc :: FunctionDoc

## Documentation types

data FunctionDoc Source #

Documentation for a Haskell function

Constructors

FunctionDoc |

Fields

- functionDescription :: Text
- parameterDocs :: [ParameterDoc]
- functionResultsDocs :: ResultsDoc
- functionSince :: Maybe Version

  Version in which the function was introduced.

#### Instances

Instances details

Show FunctionDoc Source # |
Instance details Defined in HsLua.Packaging.Types Methods showsPrec :: Int -> FunctionDoc -> ShowS Source # show :: FunctionDoc -> String Source # showList :: [FunctionDoc] -> ShowS Source #
Eq FunctionDoc Source # |
Instance details Defined in HsLua.Packaging.Types Methods (==) :: FunctionDoc -> FunctionDoc -> Bool Source # (/=) :: FunctionDoc -> FunctionDoc -> Bool Source #
Ord FunctionDoc Source # |

Instance details

Defined in HsLua.Packaging.Types

Methods

compare :: FunctionDoc -> FunctionDoc -> Ordering Source #

(<) :: FunctionDoc -> FunctionDoc -> Bool Source #

(<=) :: FunctionDoc -> FunctionDoc -> Bool Source #

(>) :: FunctionDoc -> FunctionDoc -> Bool Source #

(>=) :: FunctionDoc -> FunctionDoc -> Bool Source #

max :: FunctionDoc -> FunctionDoc -> FunctionDoc Source #

min :: FunctionDoc -> FunctionDoc -> FunctionDoc Source #

data ParameterDoc Source #

Documentation for function parameters.

Constructors

ParameterDoc |

Fields

- parameterName :: Text
- parameterType :: TypeSpec
- parameterDescription :: Text
- parameterIsOptional :: Bool

#### Instances

Instances details

Show ParameterDoc Source # |
Instance details Defined in HsLua.Packaging.Types Methods showsPrec :: Int -> ParameterDoc -> ShowS Source # show :: ParameterDoc -> String Source # showList :: [ParameterDoc] -> ShowS Source #
Eq ParameterDoc Source # |
Instance details Defined in HsLua.Packaging.Types Methods (==) :: ParameterDoc -> ParameterDoc -> Bool Source # (/=) :: ParameterDoc -> ParameterDoc -> Bool Source #
Ord ParameterDoc Source # |

Instance details

Defined in HsLua.Packaging.Types

Methods

compare :: ParameterDoc -> ParameterDoc -> Ordering Source #

(<) :: ParameterDoc -> ParameterDoc -> Bool Source #

(<=) :: ParameterDoc -> ParameterDoc -> Bool Source #

(>) :: ParameterDoc -> ParameterDoc -> Bool Source #

(>=) :: ParameterDoc -> ParameterDoc -> Bool Source #

max :: ParameterDoc -> ParameterDoc -> ParameterDoc Source #

min :: ParameterDoc -> ParameterDoc -> ParameterDoc Source #

data ResultsDoc Source #

Documentation for the return values of a function.

Constructors

ResultsDocList [ResultValueDoc] | List of individual results
ResultsDocMult Text | Flexible results

#### Instances

Instances details

Show ResultsDoc Source # |
Instance details Defined in HsLua.Packaging.Types Methods showsPrec :: Int -> ResultsDoc -> ShowS Source # show :: ResultsDoc -> String Source # showList :: [ResultsDoc] -> ShowS Source #
Eq ResultsDoc Source # |
Instance details Defined in HsLua.Packaging.Types Methods (==) :: ResultsDoc -> ResultsDoc -> Bool Source # (/=) :: ResultsDoc -> ResultsDoc -> Bool Source #
Ord ResultsDoc Source # |

Instance details

Defined in HsLua.Packaging.Types

Methods

compare :: ResultsDoc -> ResultsDoc -> Ordering Source #

(<) :: ResultsDoc -> ResultsDoc -> Bool Source #

(<=) :: ResultsDoc -> ResultsDoc -> Bool Source #

(>) :: ResultsDoc -> ResultsDoc -> Bool Source #

(>=) :: ResultsDoc -> ResultsDoc -> Bool Source #

max :: ResultsDoc -> ResultsDoc -> ResultsDoc Source #

min :: ResultsDoc -> ResultsDoc -> ResultsDoc Source #

data ResultValueDoc Source #

Documentation for a single return value of a function.

Constructors

ResultValueDoc |

Fields

- resultValueType :: TypeSpec
- resultValueDescription :: Text

#### Instances

Instances details

Show ResultValueDoc Source # |
Instance details Defined in HsLua.Packaging.Types Methods showsPrec :: Int -> ResultValueDoc -> ShowS Source # show :: ResultValueDoc -> String Source # showList :: [ResultValueDoc] -> ShowS Source #
Eq ResultValueDoc Source # |
Instance details Defined in HsLua.Packaging.Types Methods (==) :: ResultValueDoc -> ResultValueDoc -> Bool Source # (/=) :: ResultValueDoc -> ResultValueDoc -> Bool Source #
Ord ResultValueDoc Source # |

Instance details

Defined in HsLua.Packaging.Types

Methods

compare :: ResultValueDoc -> ResultValueDoc -> Ordering Source #

(<) :: ResultValueDoc -> ResultValueDoc -> Bool Source #

(<=) :: ResultValueDoc -> ResultValueDoc -> Bool Source #

(>) :: ResultValueDoc -> ResultValueDoc -> Bool Source #

(>=) :: ResultValueDoc -> ResultValueDoc -> Bool Source #

max :: ResultValueDoc -> ResultValueDoc -> ResultValueDoc Source #

min :: ResultValueDoc -> ResultValueDoc -> ResultValueDoc Source #