
yeah, great tools, but .. * when Cabal(-1.1.6) sees a wrong entry in "exposed-modules" (a module whose source cannot be found) it says "Parse of field 'exposed-modules' failed:" with an unhelpful line number (the line where the field starts, not the line where the error occurs) * is there a simple way to "expose" all modules in a source tree? Perhaps: exposed-modules: Foo.Bar.*; Baz.* I have to generate "exposed-modules" by some find/sed hackery, But I want to use Cabal exactly to avoid such extra tools. * when a *.cabal file specifies both a library and an executable that uses this library, the build process compiles all files twice, once for the library, once for the executable? (This may be my misunderstanding of some options/fields.) * haddock(-0.8) does not understand ghc-6.6's new syntax, e.g. foo :: Bar <- baz (withouth parens around the lhs) that is bad because now I have to rewrite my code. * why does haddock *die* in such cases? it has no business parsing the code anyway, as it should only care for declarations. (yes it needs to find the next declaration but couldn't this be done more generously?) (no, since what looks like a decl. could in fact be inside a block comment - but that's already known after scanning, and before proper parsing?) I'd try to help by coding some patches but I don't follow the development closely, so I ask if perhaps someone already is working in it or at least has a roadmap for work. Best regards, -- -- Johannes Waldmann -- Tel/Fax (0341) 3076 6479/80 -- ---- http://www.imn.htwk-leipzig.de/~waldmann/ -------

On Tue, 2006-12-05 at 13:34 +0100, Johannes Waldmann wrote:
yeah, great tools, but ..
Thanks for the comments. Some of these could usefully be turned into bug reports, that way we will not forget them: http://hackage.haskell.org/trac/hackage/ log in with username guest and password haskell' (note the apostrophe at the end)
* when Cabal(-1.1.6) sees a wrong entry in "exposed-modules" (a module whose source cannot be found) it says "Parse of field 'exposed-modules' failed:" with an unhelpful line number (the line where the field starts, not the line where the error occurs)
We're using the ReadP parser lib. I'm not sure we can do a lot better without changing libs. Any suggestions anyone? Note that depending on non-core packages is out as that'd make bootstrapping hard.
* is there a simple way to "expose" all modules in a source tree? Perhaps: exposed-modules: Foo.Bar.*; Baz.* I have to generate "exposed-modules" by some find/sed hackery, But I want to use Cabal exactly to avoid such extra tools.
At the moment you have to list them all explicitly. I don't think we're against relaxing that but we'd need proper dependency analysis to figure out what is needed. At the moment Cabal does no dependency analysis, it leaves that up to the compiler. Eventually we'll need to do that properly. For example it's essential to deal with non-trivial pre-processors like c2hs, so if/when we get that we could look at relaxing the requirement to list all exposed and hidden modules.
* when a *.cabal file specifies both a library and an executable that uses this library, the build process compiles all files twice, once for the library, once for the executable? (This may be my misunderstanding of some options/fields.)
The problem is that the modules need not be compiled using the same flags, so to be safe they get compiled twice. One could optimise that by checking if the flags are indeed exactly the same, however the prevailing opinion seems to be that we should make .cabal files contain executables or libraries but not both. So you'd just make an executable that depends on the lib. We also need to make it easier to work with a bundle of related .cabal packages in that case (which we need anyway for larger projects).
* haddock(-0.8) does not understand ghc-6.6's new syntax, e.g. foo :: Bar <- baz (withouth parens around the lhs) that is bad because now I have to rewrite my code.
Haddock doesn't understand a great deal of the GHC syntactic extensions. The right solution here is to make haddock use the GHC api to parse the file. The first part of this project is done. GHC can now parse haddock documentation markup.
* why does haddock *die* in such cases? it has no business parsing the code anyway, as it should only care for declarations. (yes it needs to find the next declaration but couldn't this be done more generously?) (no, since what looks like a decl. could in fact be inside a block comment - but that's already known after scanning, and before proper parsing?)
It does currently parse the code. Making it more liberal would be tricky, but anyway the right solution is to use the GHC API which obviously can parse all the syntactic extensions.
I'd try to help by coding some patches but I don't follow the development closely, so I ask if perhaps someone already is working in it or at least has a roadmap for work.
We could certainly do with help on any of the above issues. Duncan

* is there a simple way to "expose" all modules in a source tree? Perhaps: exposed-modules: Foo.Bar.*; Baz.* I have to generate "exposed-modules" by some find/sed hackery, But I want to use Cabal exactly to avoid such extra tools.
At the moment you have to list them all explicitly. I don't think we're against relaxing that but we'd need proper dependency analysis to figure out what is needed. At the moment Cabal does no dependency analysis, it leaves that up to the compiler.
but it would be nice for the compilers to interface with cabal on this kind of task, eg, when you successfully load a project into an interactive session, or use the compiler's dependency chasing to build a project, it should also be possible to generate the cabal file? and when you have a cabal file, there should be no need for anything else to launch the project in ghci, ghc, hugs,.. (or is that too ambitious a hope?-) Simon M suggested that the responsibility should be shifted to cabal http://www.mail-archive.com/glasgow-haskell-users@haskell.org/msg11101.html and your comment on preprocessing indicates why
Eventually we'll need to do that properly. For example it's essential to deal with non-trivial pre-processors like c2hs, so if/when we get that we could look at relaxing the requirement to list all exposed and hidden modules.
preferably all haskell implementations should use/maintain the same code for these tasks, so this suggests that, as a first step, cabal just needs to swallow up more of hmake, and then hmake interactive to launch ghci ?-) http://www.cs.york.ac.uk/fp/hmake/hmake.html
* haddock(-0.8) does not understand ghc-6.6's new syntax,
quite apart from the language syntax, what about the comment syntax? I was surprised to see haddock apparently ignoring much of my comment layout, and a quick glance at the code indicated that it indeed throws away or doesn't even collect useful layout info. the first thing I noticed was that I can't find a way to have multiple paragraphs in a list item, apparently because haddock merges them early.. {- | - this is a long list item
a code example
i'm in a good mood, so I write more comments also note the following
variant example
- this is the next item -} are there any plans to make haddock more sensitive to existing comment layout, preserving it in the html form, or am I just not using it the right way? claus

Claus Reinke wrote:
I was surprised to see haddock apparently ignoring much of my comment layout, and a quick glance at the code indicated that it indeed throws away or doesn't even collect useful layout info. the first thing I noticed was that I can't find a way to have multiple paragraphs in a list item, apparently because haddock merges them early..
{- | - this is a long list item
a code example
i'm in a good mood, so I write more comments
also note the following
variant example
- this is the next item -}
are there any plans to make haddock more sensitive to existing comment layout, preserving it in the html form, or am I just not using it the right way?
I haven't looked into what's going on here, but I'll just say that I'm more than happy to accept patches that improve things as long as they don't have a serious impact on backwards compatibility. Cheers, Simon
participants (4)
-
Claus Reinke
-
Duncan Coutts
-
Johannes Waldmann
-
Simon Marlow