Closed drwebb closed 8 years ago
We've been getting this too (at least a few weeks), I end up running stack clean
and then rebuilding/restarting the REPL to fix it.
I haven't been able to clear up the problem, even by doing a stack clean
and restarting emacs.
@drwebb my problem was with plain old stack
rather than the IDE specifically.
In another module in the same project, I get another possibly similar error (at least it is to do with instances no being resolved correctly):
No instance for (Y.FromJSON SphinxPort)
arising from a use of ‘Y.decode’
In the third argument of ‘maybe’, namely ‘(Y.decode s)’
In the second argument of ‘($)’, namely
‘maybe
(error $ Failed to load and parse: ++ path) id (Y.decode s)’
In a stmt of a 'do' block:
return
$ maybe
(error $ Failed to load and parse: ++ path) id (Y.decode s)
The module looks like
...
import qualified Data.Yaml as Y
import Data.Aeson
instance FromJSON SphinxPort where
...
a normal stack build
works fine.
Here's an attempt at a minimal repo, but I'm not having issues with it: https://github.com/mgsloan/issue-59-stack-ide
I'll keep my eye out for such issues.
@mgsloan: FWIW I could not duplicate in a minimal repo either.
I'm going to close this issue, seeing I have not been able to reproduce. The problem has cleared up in the project that was giving me problems.
I have two modules, one, call it "Foo" that is declaring an instance of
ToJSON
for a datatype, the other module "Bar" is using theencode
method. For some strange reason, stack-mode is complaining that I haven't declared the ToJSON instance by showing an error in "Bar", yet stack when run from the cli it compiles as I expect. When I copy-paste the instance declaration from "Foo" to "Bar" it compiles in stack-mode, but obviously stack from the cli reports a duplicate instance declaration.