{"id":21692517,"url":"https://github.com/lue-bird/elm-syntax-type-infer","last_synced_at":"2025-03-20T13:54:42.203Z","repository":{"id":264495692,"uuid":"893536696","full_name":"lue-bird/elm-syntax-type-infer","owner":"lue-bird","description":"add types to elm-syntax","archived":false,"fork":false,"pushed_at":"2024-12-21T18:40:57.000Z","size":164,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T07:44:33.038Z","etag":null,"topics":["elm","elm-syntax","type-inference"],"latest_commit_sha":null,"homepage":"https://dark.elm.dmy.fr/packages/lue-bird/elm-syntax-type-infer/latest/","language":"Elm","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lue-bird.png","metadata":{"files":{"readme":"README.md","changelog":"changes.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-24T17:39:07.000Z","updated_at":"2024-12-21T18:41:00.000Z","dependencies_parsed_at":"2024-11-24T18:38:05.721Z","dependency_job_id":null,"html_url":"https://github.com/lue-bird/elm-syntax-type-infer","commit_stats":null,"previous_names":["lue-bird/elm-syntax-type-infer"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lue-bird%2Felm-syntax-type-infer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lue-bird%2Felm-syntax-type-infer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lue-bird%2Felm-syntax-type-infer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lue-bird%2Felm-syntax-type-infer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lue-bird","download_url":"https://codeload.github.com/lue-bird/elm-syntax-type-infer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244623079,"owners_count":20483072,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elm","elm-syntax","type-inference"],"created_at":"2024-11-25T18:16:19.505Z","updated_at":"2025-03-20T13:54:42.174Z","avatar_url":"https://github.com/lue-bird.png","language":"Elm","funding_links":[],"categories":[],"sub_categories":[],"readme":"Add type information to the nodes\nof an [elm-syntax](https://dark.elm.dmy.fr/packages/stil4m/elm-syntax/latest/) tree.\n\n```elm\nimport Elm.Syntax.Node\nimport Elm.Syntax.Expression\nimport ElmSyntaxTypeInfer\n\n\n[ { declaration =\n        Elm.Syntax.Node.empty\n            { expression =\n                Elm.Syntax.Node.empty\n                    (Elm.Syntax.Expression.ListExpr\n                        [ Elm.Syntax.Node.empty\n                            (Elm.Syntax.Expression.Integer 1)\n                        ]\n                    )\n            , name = Elm.Syntax.Node.empty \"majorVersions\"\n            , arguments = []\n            }\n  , signature = Nothing\n  , documentation = Nothing\n  }\n]\n    |\u003e ElmSyntaxTypeInfer.valueOrFunctionDeclarations\n        { importedTypes = ElmSyntaxTypeInfer.elmCoreTypes\n        , moduleOriginLookup = exampleModuleOriginLookup\n        , otherModuleDeclaredTypes =\n            []\n                |\u003e ElmSyntaxTypeInfer.moduleDeclarationsToTypes\n                    exampleModuleOriginLookup\n                |\u003e .types\n        }\n    |\u003e Result.map (List.map .type_)\n--\u003e\nOk\n    [ ElmSyntaxTypeInfer.TypeNotVariable\n        (ElmSyntaxTypeInfer.TypeConstruct\n            { moduleOrigin = [ \"List\" ]\n            , name = \"List\"\n            , arguments =\n                [ ElmSyntaxTypeInfer.TypeVariable \"number\" ]\n            }\n        )\n    ]\n\n\nexampleModuleOriginLookup : ElmSyntaxTypeInfer.ModuleOriginLookup\nexampleModuleOriginLookup =\n    []\n        |\u003e ElmSyntaxTypeInfer.importsToModuleOriginLookup\n            ElmSyntaxTypeInfer.elmCoreTypes\n```\n\n## TODO\n\n-   add more tests, especially let-in\n-   implement multi-expression-declarations type infer\n-   (mutually) recursive type aliases can run into an infinite loop\n-   type infer record type alias constructor function reference expression.\n    Requires storing `Maybe (List String)` field order in module type alias declaration types\n-   optimize equivalentVariablesMergeWithSetOf2, potentially de-optimize typedNodeReplaceTypeBy\n\n### performance problems?\n\nRight now, this can't handle medium to large files at an acceptable speed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flue-bird%2Felm-syntax-type-infer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flue-bird%2Felm-syntax-type-infer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flue-bird%2Felm-syntax-type-infer/lists"}