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

Type inference for ... is more fragile in GHC-9.* #249

Open
gromakovsky opened this issue Nov 19, 2021 · 0 comments
Open

Type inference for ... is more fragile in GHC-9.* #249

gromakovsky opened this issue Nov 19, 2021 · 0 comments
Labels
type:breaking Breaking change (removal, renaming, semantic change, etc.)

Comments

@gromakovsky
Copy link
Member

This issue was first noticed in #243. Consider the following code:

super :: [()] -> Bool
super = null ... asFun (: [])

asFun :: (a -> b) -> a -> b
asFun = id

AFAIU, without asFun it compiles successfully with GHC-8., but fails to compile with GHC-9. which complains about ambiguous types. See comments in that PR.

There are several things to do:

  1. Report it as a potential bug in GHC. I am not entirely sure it's a bug because incoherent instances are involved which implies some non-determinism. We can just report it as is and let GHC developers figure it out OR try to dive deeper into it and think whether GHC complies with its specification in this case.
  2. Figure out whether this implementation of ... is safe at all because incoherent instances generally look scary.

Maybe we'll deprecate ... as result. Hence, setting type as breaking.

@gromakovsky gromakovsky added the type:breaking Breaking change (removal, renaming, semantic change, etc.) label Nov 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:breaking Breaking change (removal, renaming, semantic change, etc.)
Projects
None yet
Development

No branches or pull requests

1 participant