Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qualified types in same module #49

Open
thomasin opened this issue Sep 12, 2022 · 0 comments
Open

Qualified types in same module #49

thomasin opened this issue Sep 12, 2022 · 0 comments

Comments

@thomasin
Copy link

thomasin commented Sep 12, 2022

https://ellie-app.com/jBhFzgXWv64a1
Hi (: I am not sure if this is a bug/outside scope of this package/I am doing something wrong.

Given

myFile : Elm.File
myFile =
    Elm.file [ "MyFirstFile" ]
        [ Elm.declaration "eightyFour"
            (Elm.value
                { annotation = Just (Elm.Annotation.named [ "MyFirstFile" ] "Custom")
                , importFrom = [ "MyFirstFile" ]
                , name = "Custom"
                }
            )
        ]
myFile.contents == """module MyFirstFile exposing (..)

{-| -}

import MyFirstFile

eightyFour : MyFirstFile.Custom
eightyFour = MyFirstFile.Custom
"""

when I would want the type and expression to not be aliased, and MyFirstFile to not be imported. My use case would be building up expressions without needing to know when they are built which module they are going to be used in. At the moment I do this with elm-syntax by passing file metadata down through expression functions and comparing module directories, but it would be so neat if elm-codegen can do this.

Thank you (:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant