hslua-annotations: A type annotation generator for HSLua

[ foreign, library ] [ Propose Tags ] [ Report a vulnerability ]

A type annotation generator for HSLua targetting LuaLS and EmmyLua


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0
Change log CHANGELOG.md
Dependencies base (>=4.12 && <5), hslua-core (>=2.3 && <2.4), hslua-packaging (>=2.4 && <2.5), text (>=2 && <3) [details]
Tested with ghc ==9.10, ghc ==9.12, ghc ==9.14
License (MIT OR Apache-2.0)[multiple license files]
Author Sondre Aasemoen
Maintainer sondre@eons.io
Uploaded by sondr3 at 2026-04-05T13:34:21Z
Category Foreign
Home page https://github.com/sondr3/hslua-annotations
Bug tracker https://github.com/sondr3/hslua-annotations/issues
Source repo head: git clone https://github.com/sondr3/hslua-annotations.git
Downloads 0 total (0 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for hslua-annotations-0.1.0

[back to package description]

hslua-annotations

GitHub Actions Status Hackage version

A type annotation generator for HSLua targetting LuaLS and EmmyLua

Table of Contents

Table of Contents

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

at your option.