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

error on correct code using Identity a = a #2252

Open
lue-bird opened this issue Apr 8, 2022 · 1 comment
Open

error on correct code using Identity a = a #2252

lue-bird opened this issue Apr 8, 2022 · 1 comment

Comments

@lue-bird
Copy link

lue-bird commented Apr 8, 2022

When a function annotation includes a type that contains

type alias Identity a =
    a

with an inferred type variable

map : (a -> b) -> Identity a -> Identity b
map change =
    change

elm falsely throws an error

Something is off with the body of the `map` definition:

    map change = change
                 ^^^^^^
This `change` value is a:

    a -> b

But the type annotation on `map` says it should be:

    Identity a -> Identity b

(on "why and when would you could want Identity")

@github-actions
Copy link

github-actions bot commented Apr 8, 2022

Thanks for reporting this! To set expectations:

  • Issues are reviewed in batches, so it can take some time to get a response.
  • Ask questions in a community forum. You will get an answer quicker that way!
  • If you experience something similar, open a new issue. We like duplicates.

Finally, please be patient with the core team. They are trying their best with limited resources.

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