hslua-module-version-1.0.1: Lua module to work with version specifiers.

Copyright | © 2019-2022 Albert Krewinkel
License | MIT
Maintainer | Albert Krewinkel <albert+hslua@zeitkraut.de>
Safe Haskell | None
Language | Haskell2010

HsLua.Module.Version

Contents

- Module
- Version objects

Description

Lua module to work with file paths.

Synopsis

- documentedModule :: LuaError e => Module e
- typeVersion :: LuaError e => DocumentedTypeWithList e Version Int
- peekVersion :: LuaError e => Peeker e Version
- pushVersion :: LuaError e => Pusher e Version
- peekVersionFuzzy :: LuaError e => Peeker e Version

# Module

documentedModule :: LuaError e => Module e #

The `path` module specification.

# Version objects

typeVersion :: LuaError e => DocumentedTypeWithList e Version Int #

Type definition of Lua Version values.

peekVersion :: LuaError e => Peeker e Version #

Retrieve a ``Version`` object from the top of the stack.

pushVersion :: LuaError e => Pusher e Version #

Push a ``Version`` element to the Lua stack.

peekVersionFuzzy :: LuaError e => Peeker e Version #

Retrieve a Version-like object from the top of the stack.

This function uses these heuristics, depending on the Lua object type.

- string: object is parsed as a version specifier.
- table: value is expected to be a list of integers, with each index specifying a version branch.
- userdata: assumes the value to be a Version userdata object.
- number: parses the number as an integer value.

Otherwise, or if the object fails to meet an expectation, peeking fails.