hslua-module-version-1.1.1: Lua module to work with version specifiers.
Copyright© 2019-2024 Albert Krewinkel
LicenseMIT
MaintainerAlbert Krewinkel <tarleb@hslua.org>
Safe HaskellSafe-Inferred
LanguageHaskell2010

HsLua.Module.Version

Description

Lua module to work with file paths.

Synopsis

Module

documentedModule :: LuaError e => Module e Source #

The path module specification.

Version objects

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

Type definition of Lua Version values.

peekVersion :: LuaError e => Peeker e Version Source #

Retrieve a Version object from the top of the stack.

pushVersion :: LuaError e => Pusher e Version Source #

Push a Version element to the Lua stack.

peekVersionFuzzy :: LuaError e => Peeker e Version Source #

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.