@hackage hslua-annotations0.1.0
A type annotation generator for HSLua
Categories
License
(MIT OR Apache-2.0)
Maintainer
sondre@eons.io
Links
Versions
- 0.1.0 Sun, 5 Apr 2026
Installation
Dependencies (4)
- base >=4.12 && <5
- hslua-core ^>=2.3
- hslua-packaging ^>=2.4
- text >=2 && <3 Show all…
Dependents (0)
hslua-annotations
A type annotation generator for HSLua targetting LuaLS and EmmyLua
This is a small library to generate LuaLS and EmmyLua annotations from HsLua.
Installation
Add hslua-annotations to your Cabal file:
build-depends:
hslua-annotations ^>= 0.1
Usage
import HsLua.Annotations (annotateModule, documentModule)
import HsLua.Module.Path qualified as Path
import HsLua.Packaging
import HsLua.Core qualified as Lua
import Data.Text (Text)
import Data.Text.IO qualified as TIO
-- utility function might be needed to narrow the `Module e` type
renderDocs :: Module Lua.Exception -> Text
renderDocs mod = documentModule mod
-- utility function might be needed to narrow the `Module e` type
renderAnnotations :: Module Lua.Exception -> Text
renderAnnotations mod = annotateModule mod
main :: IO ()
main = do
TIO.writeFile "path.md" $ renderDocs Path.documentedModule
TIO.writeFile "path.lua" $ renderAnnotations Path.documentedModule
License
This project is licensed under either of
- Apache License, Version 2.0, (LICENSE_APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE or http://opensource.org/licenses/MIT)
at your option.