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

Copyright | © 2020-2022 Albert Krewinkel
License | MIT
Maintainer | Albert Krewinkel <tarleb+hslua@zeitkraut.de>
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)]
  }
- data Field e = Field {
  - fieldName :: Text
  - 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 :: Text
  - parameterDescription :: Text
  - parameterIsOptional :: Bool
  }
- data ResultsDoc
  - = ResultsDocList [ResultValueDoc]
  - | ResultsDocMult Text
- data ResultValueDoc = ResultValueDoc {
  - resultValueType :: Text
  - resultValueDescription :: Text
  }

# Documented module

data Module e #

Named and documented Lua module.

Constructors

Module |
Fields moduleName :: Name moduleDescription :: Text moduleFields :: [Field e] moduleFunctions :: [DocumentedFunction e] moduleOperations :: [(Operation, DocumentedFunction e)]

data Field e #

Self-documenting module field

Constructors

Field |
Fields fieldName :: Text fieldDescription :: Text fieldPushValue :: LuaE e ()

# Documented functions

data DocumentedFunction e #

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 #

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

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

data ParameterDoc #

Documentation for function parameters.

Constructors

ParameterDoc |
Fields parameterName :: Text parameterType :: Text parameterDescription :: Text parameterIsOptional :: Bool

#### Instances

Instances details

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

data ResultsDoc #

Documentation for the return values of a function.

Constructors

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

#### Instances

Instances details

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

data ResultValueDoc #

Documentation for a single return value of a function.

Constructors

ResultValueDoc |
Fields resultValueType :: Text resultValueDescription :: Text

#### Instances

Instances details

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