-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Structure to hold detailed type information. The primary use-case at
--   this time are auto-generated docs.
@package hslua-typing
@version 0.1.1


-- | The module provides Haskell types and values that can be used to
--   describe and declare the types of Lua values.
module HsLua.Typing

-- | Type specification for Lua values.
data TypeSpec

-- | Built-in type
BasicType :: Type -> TypeSpec

-- | A type that's been given a name.
NamedType :: Name -> TypeSpec

-- | Sequence of the given type.
SeqType :: TypeSpec -> TypeSpec

-- | Union type; a sum type.
SumType :: [TypeSpec] -> TypeSpec

-- | Record type (type product).
RecType :: Map Name TypeSpec -> TypeSpec

-- | Function type.
FunType :: [TypeSpec] -> [TypeSpec] -> TypeSpec

-- | Unconstrained type.
AnyType :: TypeSpec

-- | Documented custom type.
data TypeDocs
TypeDocs :: Text -> TypeSpec -> Maybe Name -> TypeDocs
[typeDescription] :: TypeDocs -> Text
[typeSpec] :: TypeDocs -> TypeSpec
[typeRegistry] :: TypeDocs -> Maybe Name

-- | Returns the sum of two type specifiers, declaring that a Lua value can
--   have either type.
(#|#) :: TypeSpec -> TypeSpec -> TypeSpec

-- | Generate a string representation of the type specifier.
typeSpecToString :: TypeSpec -> String

-- | Creates a <a>TypeSpec</a> value from a string.
--   
--   The implementation currently handles basic types, sequences, and
--   alternatives. A string that cannot be parsed is returned as a
--   <tt>Named</tt> type with the full string as the name.
typeSpecFromString :: String -> TypeSpec

-- | Unconstraint type; any Lua value.
anyType :: TypeSpec

-- | A type for which there cannot be any value.
voidType :: TypeSpec

-- | The built-in <tt>boolean</tt> Lua type.
booleanType :: TypeSpec

-- | The built-in <tt>function</tt> Lua type.
functionType :: TypeSpec

-- | A Lua integer type.
integerType :: TypeSpec

-- | The built-in <tt>light userdata</tt> Lua type.
lightUserdataType :: TypeSpec

-- | The built-in <tt>nil</tt> Lua type.
nilType :: TypeSpec

-- | The built-in <tt>number</tt> Lua type.
numberType :: TypeSpec

-- | The built-in <tt>string</tt> Lua type.
stringType :: TypeSpec

-- | The built-in <tt>table</tt> Lua type.
tableType :: TypeSpec

-- | The built-in <tt>thread</tt> Lua type.
threadType :: TypeSpec

-- | The built-in <tt>userdata</tt> Lua type.
userdataType :: TypeSpec

-- | Creates a record type.
recType :: [(Name, TypeSpec)] -> TypeSpec

-- | Creates a sequence type.
seqType :: TypeSpec -> TypeSpec

-- | Pushes a table representation of a <a>TypeSpec</a> to the stack.
pushTypeSpec :: LuaError e => TypeSpec -> LuaE e ()

-- | Retrieves a <a>TypeSpec</a> from a table on the stack.
peekTypeSpec :: LuaError e => Peeker e TypeSpec

-- | Pushes documentation for a custom type.
pushTypeDoc :: LuaError e => Pusher e TypeDocs

-- | Retrieves a custom type specifier.
peekTypeDoc :: LuaError e => Peeker e TypeDocs
instance GHC.Classes.Eq HsLua.Typing.TypeDocs
instance GHC.Classes.Eq HsLua.Typing.TypeSpec
instance GHC.Internal.Generics.Generic HsLua.Typing.TypeDocs
instance GHC.Internal.Generics.Generic HsLua.Typing.TypeSpec
instance GHC.Internal.Data.String.IsString HsLua.Typing.TypeSpec
instance GHC.Classes.Ord HsLua.Typing.TypeDocs
instance GHC.Classes.Ord HsLua.Typing.TypeSpec
instance GHC.Internal.Show.Show HsLua.Typing.TypeDocs
instance GHC.Internal.Show.Show HsLua.Typing.TypeSpec
