HsLua.Packaging.Types

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 #

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 #

Self-documenting module field

Constructors

Field |
Fields fieldName :: Text fieldType :: TypeSpec 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

Show FunctionDoc # |
Instance details Defined in HsLua.Packaging.Types Methods showsPrec :: Int -> FunctionDoc -> ShowS # show :: FunctionDoc -> String # showList :: [FunctionDoc] -> ShowS #
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 #

data ParameterDoc #

Documentation for function parameters.

Constructors

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

#### Instances

Instances details

Show ParameterDoc # |
Instance details Defined in HsLua.Packaging.Types Methods showsPrec :: Int -> ParameterDoc -> ShowS # show :: ParameterDoc -> String # showList :: [ParameterDoc] -> ShowS #
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 #

data ResultsDoc #

Documentation for the return values of a function.

Constructors

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

#### Instances

Instances details

Show ResultsDoc # |
Instance details Defined in HsLua.Packaging.Types Methods showsPrec :: Int -> ResultsDoc -> ShowS # show :: ResultsDoc -> String # showList :: [ResultsDoc] -> ShowS #
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 #

data ResultValueDoc #

Documentation for a single return value of a function.

Constructors

ResultValueDoc |
Fields resultValueType :: TypeSpec resultValueDescription :: Text

#### Instances

Instances details

Show ResultValueDoc # |
Instance details Defined in HsLua.Packaging.Types Methods showsPrec :: Int -> ResultValueDoc -> ShowS # show :: ResultValueDoc -> String # showList :: [ResultValueDoc] -> ShowS #
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 #