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

haskell Type.hs ERROR #226

Closed
ruoshuiwyl opened this issue Jul 15, 2016 · 4 comments · Fixed by #238
Closed

haskell Type.hs ERROR #226

ruoshuiwyl opened this issue Jul 15, 2016 · 4 comments · Fixed by #238

Comments

@ruoshuiwyl
Copy link

Env : opensuse 42.1 ghc 7.10.3
runhaskell step2,...,stepA
Types.hs:64:1:
Non type-variable argument
in the constraint: Control.Monad.Error.Class.MonadError MalError m
(Use FlexibleContexts to permit this)
When checking that ‘throwStr’ has the inferred type
throwStr :: forall (m :: * -> *) a.
Control.Monad.Error.Class.MonadError MalError m =>
String -> m a

Types.hs:65:1:
Non type-variable argument
in the constraint: Control.Monad.Error.Class.MonadError MalError m
(Use FlexibleContexts to permit this)
When checking that ‘throwMalVal’ has the inferred type
throwMalVal :: forall (m :: * -> *) a.
Control.Monad.Error.Class.MonadError MalError m =>
MalVal -> m a

@kanaka
Copy link
Owner

kanaka commented Jul 15, 2016

This is due to changes in ghc-7.10.1: http://stackoverflow.com/questions/28287329/ghc-7-10-non-type-variable-argument-use-flexiblecontexts-to-permit-this

You can get things to compile by adding -XFlexibleContexts to the ghc call in the makefile, however, there were also some refactorings to Error/Exception handling in 7.10.1 so you get lots of build warnings.

I think the correct fix for this issue is to refactor and clean up the error/except handling code in the mal implementation so that things compile cleanly without the compiler options. Ideally, 7.6 should also be supported since that's still seems pretty typical version in the wild.

Anybody with Haskell chops want to tackle this? I probably won't have a chance anytime soon.

@ruoshuiwyl
Copy link
Author

Thank you.
I try to compile by addding -XFlexibleContexts.
It works.

@kanaka
Copy link
Owner

kanaka commented Oct 6, 2016

@ruoshuiwyl I would be interesting in hearing if you are able to use the latest changes from @prt2121 without requiring the -XFlexibleContexts hack

@ruoshuiwyl
Copy link
Author

thank you. I try to it.

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

Successfully merging a pull request may close this issue.

2 participants