aboutsummaryrefslogtreecommitdiff
path: root/src/Main.hs
Commit message (Collapse)AuthorAgeFilesLines
* [haddock @ 2003-11-05 11:30:52 by simonmar]simonmar2003-11-051-7/+15
| | | | | | | | | - Suppress warnings about unknown imported modules by default. - Add a -v/--verbose flag to re-enable these warnings. The general idea is to suppress the "Warning: unknown module: Prelude" warnings which most Haddock users will see every time, and which aren't terribly useful.
* [haddock @ 2003-11-05 11:22:04 by simonmar]simonmar2003-11-051-30/+49
| | | | | Remove the last of the uses of 'trace' to emit warnings, and tidy up a couple of places where duplicate warnings were being emitted.
* [haddock @ 2003-10-20 17:19:22 by sof]sof2003-10-201-1/+1
| | | | support for i-parameters + zip comprehensions
* [haddock @ 2003-08-27 07:50:02 by panne]panne2003-08-271-30/+28
| | | | | | | | | | | | | | | | | * Made -D a short option for --dump-interface. * Made -m a short option for --ms-help. * Made -n a short option for --no-implicit-prelude. * Made -c a short option for --css. * Removed DocBook options from executable (they didn't do anything), but mark them as reserved in the docs. Note that the short option for DocBook output is now -S (from SGML) instead of -d. The latter is now a short option for --debug. * The order of the Options in the documentation now matches the order printed by Haddock itself. Note: Although changing the names of options is often a bad idea, I'd really like to make the options for the programs in fptools more consistent and compatible to the ones used in common GNU programs.
* [haddock @ 2003-08-26 19:20:55 by panne]panne2003-08-261-3/+4
| | | | Make it *very* clear that we terminate when given a -V/--version flag
* [haddock @ 2003-08-26 19:01:18 by panne]panne2003-08-261-14/+20
| | | | | | | | | Made option handling a bit more consistent with other tools, in particular: Every program in fptools should output * version info on stdout and terminate successfully when -V or --version * usage info on stdout and terminate successfully when -? or --help * usage info on stderr and terminate unsuccessfully when an unknown option is given.
* [haddock @ 2003-07-30 16:05:40 by simonmar]simonmar2003-07-301-15/+37
| | | | | | | | | | | | | | | Rename instances based on the import_env for the module in which they are to be displayed. This should give, in many cases, better links for the types and classes mentioned in the instance head. This involves keeping around the import_env in the iface until the end, because instances are not collected up until all the modules have been processed. Fortunately it doesn't seem to affect performance much. Instance heads are now attached to ExportDecls, rather than the HTML backend passing around a separate mapping for instances. This is a cleanup.
* [haddock @ 2003-07-30 15:04:52 by simonmar]simonmar2003-07-301-46/+59
| | | | | | Pay attention to import specs when building the the import env, as well as the orig env. This may fix some wrong links in documentation when import specs are being used.
* [haddock @ 2003-07-28 14:32:42 by simonmar]simonmar2003-07-281-5/+11
| | | | Update to avoid using hslibs with GHC >= 5.04
* [haddock @ 2003-07-28 13:35:16 by simonmar]simonmar2003-07-281-6/+43
| | | | | | When a module A exports another module's contents via 'module B', then modules which import entities from B re-exported by A should link to B.foo rather than A.foo. See examples/Bug2.hs.
* [haddock @ 2003-04-25 10:50:05 by ross]ross2003-04-251-1/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | An 80% solution to generating derived instances. A complete solution would duplicate the instance inference logic, but if a type variable occurs as a constructor argument, then we can just propagate the derived class to the variable. But we know nothing of the constraints on any type variables that occur elsewhere. For example, the declarations data Either a b = Left a | Right b deriving (Eq, Ord) data Ptr a = Ptr Addr# deriving (Eq, Ord) newtype IORef a = IORef (STRef RealWorld a) deriving Eq yield the instances (Eq a, Eq b) => Eq (Either a b) (Ord a, Ord b) => Ord (Either a b) Eq (Ptr a) Ord (Ptr a) (??? a) => Eq (IORef a) The last example shows the limits of this local analysis. Note that a type variable may be in both categories: then we know a constraint, but there may be more, or a stronger constraint, e.g. data Tree a = Node a [Tree a] deriving Eq yields (Eq a, ??? a) => Eq (Tree a)
* [haddock @ 2002-11-13 09:49:46 by simonmar]simonmar2002-11-131-1/+1
| | | | Small bugfix in the --read-interface option parsing from Brett Letner.
* [haddock @ 2002-07-24 09:42:17 by simonmar]simonmar2002-07-241-95/+112
| | | | Patches to quieten ghc -Wall, from those nice folks at Galois.
* [haddock @ 2002-07-23 10:18:46 by simonmar]simonmar2002-07-231-12/+23
| | | | Add a version banner when invoked with -v
* [haddock @ 2002-07-15 09:54:16 by simonmar]simonmar2002-07-151-17/+12
| | | | merge rev. 1.35
* [haddock @ 2002-07-15 09:19:38 by simonmar]simonmar2002-07-151-6/+7
| | | | | | | Fix a bug in mkExportItems when processing a module without an explicit export list. We were placing one copy of a declaration for each binder in the declaration, which for a data type would mean one copy of the whole declaration per constructor or record selector.
* [haddock @ 2002-07-10 10:58:31 by simonmar]simonmar2002-07-101-5/+5
| | | | Sort the options a bit
* [haddock @ 2002-07-10 10:26:11 by simonmar]simonmar2002-07-101-11/+14
| | | | | Tweaks to the MS Help support: the extra files are now only generated if you ask for them (--ms-help).
* [haddock @ 2002-07-09 10:12:51 by simonmar]simonmar2002-07-091-0/+2
| | | | commented-out debugging code
* [haddock @ 2002-07-04 15:26:13 by simonmar]simonmar2002-07-041-14/+25
| | | | More bugfixes to the export handling
* [haddock @ 2002-07-04 14:56:10 by simonmar]simonmar2002-07-041-22/+27
| | | | | | | Clean up the code that constructs the exported declarations, and fix a couple of bugs along the way. Now if you import a class hiding one of the methods, then re-export the class, the version in the documentation will correctly have the appropriate method removed.
* [haddock @ 2002-07-03 16:01:07 by simonmar]simonmar2002-07-031-35/+95
| | | | | | Handle import specs properly, include 'hiding'. Haddock now has a complete implementation of the Haskell module system (more or less; I won't claim it's 100% correct).
* [haddock @ 2002-06-24 14:37:42 by simonmar]simonmar2002-06-241-4/+23
| | | | | | | | | | | | | | When reading an interface, allow a file path offset to be specified which represents the path to the HTML files for the modules specified by that interface. The path may be either relative (to the location of the HTML for this package), or absolute. The syntax is --read-interface=PATH,FILE where PATH is the path to the HTML, and FILE is the filename containing the interface.
* [haddock @ 2002-06-21 15:50:42 by simonmar]simonmar2002-06-211-9/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for reading and writing interface files(!) This turned out to be quite easy, and necessary to get decent hyperlinks between the documentation for separate packages in the libraries. The functionality isn't quite complete yet: for a given package of modules, you'd like to say "the HTML for these modules lives in directory <dir>" (currently they are assumed to be all in the same place). Two new flags: --dump-interface=FILE dump an interface file in FILE --read-interface=FILE read interface from FILE an interface file describes *all* the modules being processed. Only the exported names are kept in the interface: if you re-export a name from a module in another interface the signature won't be copied. This is a compromise to keep the size of the interfaces sensible. Also, I added another useful option: --no-implicit-prelude avoids trying to import the Prelude. Previously this was the default, but now importing the Prelude from elsewhere makes sense if you also read in an interface containing the Prelude module, so Haddock imports the Prelude implicitly according to the Haskell spec.
* [haddock @ 2002-06-20 12:39:01 by simonmar]simonmar2002-06-201-2/+19
| | | | | Add support for a "prologue" - a description for the whole library, placed on the contents page before the module list.
* [haddock @ 2002-06-08 14:03:36 by panne]panne2002-06-081-1/+1
| | | | | | | Tiny workaround for the fact that Haddock currently ignores HsImportSpecs: Let the local_orig_env take precedence. This is no real solution at all, but improves things sometimes, e.g. in my GLUT documentation. :-)
* [haddock @ 2002-06-05 09:05:07 by simonmar]simonmar2002-06-051-6/+7
| | | | | Keep foreign imports when there is no export list (bug reported by Sven Panne).
* [haddock @ 2002-06-03 13:46:48 by simonmar]simonmar2002-06-031-0/+6
| | | | Fix for exporting record selectors from a newtype declaration
* [haddock @ 2002-06-03 13:05:57 by simonmar]simonmar2002-06-031-7/+47
| | | | | | | Allow exporting of individual class methods and record selectors. For these we have to invent the correct type signature, which we do in the simplest possible way (i.e. no context reduction nonsense in the class case).
* [haddock @ 2002-05-28 16:16:19 by simonmar]simonmar2002-05-281-38/+66
| | | | | | | Only link to names in the current module which are actually listed in the documentation. A name may be exported but not present in the documentation if it is exported as part of a 'module M' export specifier.
* [haddock @ 2002-05-28 10:12:50 by simonmar]simonmar2002-05-281-3/+10
| | | | Rename the module documentation properly (bug reported by Sven Panne).
* [haddock @ 2002-05-27 14:36:45 by simonmar]simonmar2002-05-271-2/+2
| | | | warning message tweak
* [haddock @ 2002-05-27 09:03:51 by simonmar]simonmar2002-05-271-40/+65
| | | | | | | | | | | | | | Lots of changes: - instances of a class are listed with the class, and instances involving a datatype are listed with that type. Derived instances aren't included at the moment: the calculation to find the instance head for a derived instance is non-trivial. - some formatting changes; use rows with specified height rather than cellspacing in some places. - various fixes (source file links were wrong, amongst others)
* [haddock @ 2002-05-15 13:03:01 by simonmar]simonmar2002-05-151-270/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reworking of the internals to support documenting function arguments (the Most Wanted new feature by the punters). The old method of keeping parsed documentation in a Name -> Doc mapping wasn't going to cut it for anntations on type components, where there's no name to attach the documentation to, so I've moved to storing all the documentation in the abstract syntax. Previously some of the documentation was left in the abstract syntax by the parser, but was later extracted into the mapping. In order to avoid having to parameterise the abstract syntax over the type of documentation stored in it, we have to parse the documentation at the same time as we parse the Haskell source (well, I suppose we could store 'Either String Doc' in the HsSyn, but that's clunky). One upshot is that documentation is now parsed eagerly, and documentation parse errors are fatal (but have better line numbers in the error message). The new story simplifies matters for the code that processes the source modules, because we don't have to maintain the extra Name->Doc mapping, and it should improve efficiency a little too. New features: - Function arguments and return values can now have doc annotations. - If you refer to a qualified name in a doc string, eg. 'IO.putStr', then Haddock will emit a hyperlink even if the identifier is not in scope, so you don't have to make sure everything referred to from the documentation is imported. - several bugs & minor infelicities fixed.
* [haddock @ 2002-05-09 13:37:35 by simonmar]simonmar2002-05-091-19/+25
| | | | Print the module name in a doc-string parse error
* [haddock @ 2002-05-09 10:37:07 by simonmar]simonmar2002-05-091-8/+34
| | | | | | | | | | The last commit to Main.lhs broke the delicate balance of laziness which was being used to avoid computing the dependency graph of modules. So I finally bit the bullet and did a proper topological sort of the module graph, which turned out to be easy (stealing the Digraph module from GHC - this really ought to be in the libraries somewhere).
* [haddock @ 2002-05-08 14:48:39 by simonmar]simonmar2002-05-081-3/+3
| | | | Add support for existential quantifiers on constructors.
* [haddock @ 2002-05-08 11:21:56 by simonmar]simonmar2002-05-081-138/+225
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a facility for specifying options that affect Haddock's treatment of the module. Options are given at the top of the module in a comma-separated list, beginning with '-- #'. eg. -- # prune, hide, ignore-exports Options currently available, with their meanings: prune: ignore declarations which have no documentation annotations ignore-exports: act as if the export list were not specified (i.e. export everything local to the module). hide: do not include this module in the generated documentation, but propagate any exported definitions to modules which re-export them. There's a slight change in the semantics for re-exporting a full module by giving 'module M' in the export list: if module M does not have the 'hide' option, then the documentation will now just contain a reference to module M rather than the full inlined contents of that module. These features, and some other changes in the pipeline, are the result of discussions between myself and Manuel Chakravarty <chak@cse.unsw.edu.au> (author of IDoc) yesterday. Also: some cleanups, use a Writer monad to collect error messages in some places instead of just printing them with trace.
* [haddock @ 2002-05-06 12:49:21 by simonmar]simonmar2002-05-061-2/+3
| | | | Fix silly bug in named documentation block lookup.
* [haddock @ 2002-04-29 15:28:54 by simonmar]simonmar2002-04-291-1/+1
| | | | Allow '-- |' style annotations on constructors and record fields.
* [haddock @ 2002-04-26 11:18:56 by simonmar]simonmar2002-04-261-4/+16
| | | | | | | - support for fundeps (partially contributed by Brett Letner - thanks Brett). - make it build with GHC 4.08.2
* [haddock @ 2002-04-25 14:40:05 by simonmar]simonmar2002-04-251-4/+37
| | | | | | | - Add support for named chunks of documentation which can be referenced from the export list. - Copy the icon from $libdir to the destination in HTML mode.
* [haddock @ 2002-04-24 15:14:11 by simonmar]simonmar2002-04-241-23/+35
| | | | | | | Grok the kind of module headers we use in fptools/libraries, and pass the "portability", "stability", and "maintainer" strings through into the generated HTML. If the module header doesn't match the pattern, then we don't include the info in the HTML.
* [haddock @ 2002-04-11 13:40:30 by simonmar]simonmar2002-04-111-16/+36
| | | | | | | | | | | | | - copy haddock.css into the same place as the generated HTML - new option: --css <file> specifies the style sheet to use - new option: -o <dir> specifies the directory in which to generate the output. - because Haddock now needs to know where to find its default stylesheet, we have to have a wrapper script and do the haddock-inplace thing (Makefile code copied largely from fptools/happy).
* [haddock @ 2002-04-10 16:28:05 by simonmar]simonmar2002-04-101-2/+6
| | | | | | Parse errors in doc strings are now reported as warnings rather that causing the whole thing to fall over. It still needs cleaning up (the warning is emitted with trace) but this will do for the time being.
* [haddock @ 2002-04-10 15:50:10 by simonmar]simonmar2002-04-101-2/+2
| | | | | Generate a little table of contents at the top of the module doc (only if the module actually contains some section headings, though).
* [haddock @ 2002-04-10 13:26:09 by simonmar]simonmar2002-04-101-114/+85
| | | | | | | | | Lots of changes, including: - add index support to the HTML backend - clean up the renamer, put it into a monad - propogate unresolved names to the top level and report them in a nicer way - various bugfixes
* [haddock @ 2002-04-08 16:39:56 by simonmar]simonmar2002-04-081-2/+3
| | | | Fix a problem with exports of the form T(..).
* [haddock @ 2002-04-05 13:58:15 by simonmar]simonmar2002-04-051-83/+86
| | | | | | | | | | | Remap names in the exported declarations to be "closer" to the current module. eg. if an exported declaration mentions a type 'T' which is imported from module A then re-exported from the current module, then links from the type or indeed the documentation will point to the current module rather than module A. This is to support better hiding: module A won't be referred to in the generated output.
* [haddock @ 2002-04-04 16:23:43 by simonmar]simonmar2002-04-041-0/+543
This is Haddock, my stab at a Haskell documentation tool. It's not quite ready for release yet, but I'm putting it in the repository so others can take a look. It uses a locally modified version of the hssource parser, extended with support for GHC extensions and documentation annotations.