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

Typeclass information missing when using :GhcModType and :GhcModTypeInsert #89

Open
SageEx opened this issue Dec 23, 2015 · 2 comments
Open

Comments

@SageEx
Copy link

SageEx commented Dec 23, 2015

Is there an option to see the class constraints in the function definition ?
Like:

compress [] = []
compress [a] = [a]
compress (a:b:xs)
    | a==b = compress (a:xs)
    | otherwise = a: compress (b:xs)

On :GhcModTypeInsert it shows compress :: [a] -> [a] however, it should be compress :: Eq a => [a] -> [a].
This lack of typeclass information is wrong - ghci refuses to accept the file (as it should).
So, is there an configuration option that I overlooked ?
If not, shouldn't this be the default behaviour ?

@DanielG
Copy link

DanielG commented Dec 24, 2015

That's a bug upstream in ghc-mod caused by a change of behavior in GHC (I think). We have a partial fix available but I haven't come around to testing and cleaning it up yet. Even just finding out which version of GHC introduced this problem or if it is a problem in ghc-mod after all would already be a big help BTW.

@SageEx
Copy link
Author

SageEx commented Dec 24, 2015

I checked out vim-hdevtools today. It also uses the latest ghc-7.10.3 on my system.
The info function works fine with hdevtools - it shows proper typeclass constraints for the functions along with the type.
I think this bug is in ghc-mod not ghc itself, since hdevtools works fine.
On the project page, it says it shares some code with ghc-mod itself. This might help.

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

2 participants