Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Modules generated by UUAGC are not recognized #66

nponeccop opened this Issue · 5 comments

2 participants


If I change in editor I get the following in console tab:

    Could not find module `Bar'
    Perhaps you meant
      Var (needs flag -package ghc-7.4.1)
      Bag (needs flag -package ghc-7.4.1)
    Use -v to see a list of the files searched for.

EclipseFP cannot find module Bar which is generated from file and placed in various folders under dist/build, e.g.


When the project is built by cabal those folders are added to ghc search path.


Works for me, but then again it may be linked to having several executables, maybe I got lucky and had the proper executable selected. Make sure the project has been built. We use the same configuration options as cabal so it should work.


I tracked the problem down. When you save an .ag file in Eclipse, EclipseFP runs UUAGC on it and puts .hs file to the same location as the .ag file. That's why you don't see the problem - because you have the .hs file generated. But if you delete that EclipseFP-generated .ag file, the problem arises:

  • delete the generated file
  • open a Haskell module which refers to the generated module
  • see the error message

The current behavior is wrong in many aspects:

  1. During normal building process by Cabal the generated files are put into different locations than EclipseFP puts them.
  2. Because of INCLUDE UUAG statement, many .ag files are not self-contained, so it's useless to try to run UUAG and GHC on them. Instead, all their parents should be enumerated and processed.
  3. The problems with multiple stanzas from #63 apply to .ag files as well.

Well yes, if you delete the file another file depends on you get an error. this is not a problem. Then, when you build the project fully in EclipseFP, the way it's built is... by running "cabal build". So files are generated in the same place as they are with cabal, for the same reason that they are generated by cabal. Of course, when you edit a file, only that file gets build and loaded explicitly by GHC, so it needs the dependent file. that's what happens here. I got your project to build first, without trying to open a file, then when everything is built every file opens ok.


Here is example from my project tree. has the following lines:


When Cabal builds the project, it invokes UUAGC compiler only once for It textually includes 7 files into one big attribute grammar file and generates Bar.hs. cabal install does not run uuagc AG/, but when I modify EclipseFP does and it fails.

The correct behaviour is to get the list of all 'root' AG files from uuagc_options file and detect that AG/ is not a self-contained file but a part of So when I modify AG/ EclipseFP should not attempt to generate AG/Nodes.hs as it will fail, but it should re-generate Bar.hs instead.

I hope it is easier to understand the problem now.


The problem disappears once I disable UUAG builder and rely on UUAG Cabal plugin. When I edit .ag files Bar.hs gets regenerated.

@nponeccop nponeccop closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.