Skip to content

Library to generate type annotations #158

Description

@sondr3

Hey @tarleb, I created issue #128 quite a while ago now and said I might have a prototype for generating type annotations available over Christmas... well, real world happened but I'm getting back into the swing of things with Haskell again and have re-created the dead prototype I had for generating types from HsLua. I've created a repo where you can take a look. It might be useful as a core library as well, but I'm neither super well versed with the type annotations in Lua or HsLua, but from testing the manual typings I've written for a few test projects it lines up pretty well.

I have a few thoughts about the API, I understand it will be a major breaking change but it would be nice to have type safe type annotations when creating functions/modules as the Lua community seems to have landed on a shared subset of type annotations. Like the ... for variadics, typ? for optional types, string|integer for union types, ---@deprecated [note] for deprecations and so on instead of the Text field it is today. hslua-typings does not have a way to differentiate between ...string and string[] for example.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions