From 8f71c6f26eb5b36e5a1ca253b8c8ffdca75849d8 Mon Sep 17 00:00:00 2001 From: Mateusz Kowalczyk Date: Tue, 11 Mar 2014 08:50:42 +0000 Subject: Fix up some whitespace --- doc/haddock.xml | 1566 +++++++++++++++++++++++++++---------------------------- 1 file changed, 783 insertions(+), 783 deletions(-) (limited to 'doc') diff --git a/doc/haddock.xml b/doc/haddock.xml index 020b3b30..6f9f62e6 100644 --- a/doc/haddock.xml +++ b/doc/haddock.xml @@ -38,69 +38,69 @@ - When documenting APIs, it is desirable to keep the - documentation close to the actual interface or implementation - of the API, preferably in the same file, to reduce the risk - that the two become out of sync. Haddock therefore lets you - write the documentation for an entity (function, type, or - class) next to the definition of the entity in the source - code. + When documenting APIs, it is desirable to keep the + documentation close to the actual interface or implementation + of the API, preferably in the same file, to reduce the risk + that the two become out of sync. Haddock therefore lets you + write the documentation for an entity (function, type, or + class) next to the definition of the entity in the source + code. - There is a tremendous amount of useful API documentation - that can be extracted from just the bare source code, - including types of exported functions, definitions of data - types and classes, and so on. Haddock can therefore generate - documentation from a set of straight Haskell 98 modules, and - the documentation will contain precisely the interface that is - available to a programmer using those modules. + There is a tremendous amount of useful API documentation + that can be extracted from just the bare source code, + including types of exported functions, definitions of data + types and classes, and so on. Haddock can therefore generate + documentation from a set of straight Haskell 98 modules, and + the documentation will contain precisely the interface that is + available to a programmer using those modules. - Documentation annotations in the source code should be - easy on the eye when editing the source code itself, so as not - to obscure the code and to make reading and writing - documentation annotations easy. The easier it is to write - documentation, the more likely the programmer is to do it. - Haddock therefore uses lightweight markup in its annotations, - taking several ideas from IDoc. - In fact, Haddock can understand IDoc-annotated source - code. + Documentation annotations in the source code should be + easy on the eye when editing the source code itself, so as not + to obscure the code and to make reading and writing + documentation annotations easy. The easier it is to write + documentation, the more likely the programmer is to do it. + Haddock therefore uses lightweight markup in its annotations, + taking several ideas from IDoc. + In fact, Haddock can understand IDoc-annotated source + code. - The documentation should not expose any of the structure - of the implementation, or to put it another way, the - implementer of the API should be free to structure the - implementation however he or she wishes, without exposing any - of that structure to the consumer. In practical terms, this - means that while an API may internally consist of several - Haskell modules, we often only want to expose a single module - to the user of the interface, where this single module just - re-exports the relevant parts of the implementation - modules. - - Haddock therefore understands the Haskell module system - and can generate documentation which hides not only - non-exported entities from the interface, but also the - internal module structure of the interface. A documentation - annotation can still be placed next to the implementation, and - it will be propagated to the external module in the generated - documentation. + The documentation should not expose any of the structure + of the implementation, or to put it another way, the + implementer of the API should be free to structure the + implementation however he or she wishes, without exposing any + of that structure to the consumer. In practical terms, this + means that while an API may internally consist of several + Haskell modules, we often only want to expose a single module + to the user of the interface, where this single module just + re-exports the relevant parts of the implementation + modules. + + Haddock therefore understands the Haskell module system + and can generate documentation which hides not only + non-exported entities from the interface, but also the + internal module structure of the interface. A documentation + annotation can still be placed next to the implementation, and + it will be propagated to the external module in the generated + documentation. - Being able to move around the documentation by following - hyperlinks is essential. Documentation generated by Haddock - is therefore littered with hyperlinks: every type and class - name is a link to the corresponding definition, and - user-written documentation annotations can contain identifiers - which are linked automatically when the documentation is - generated. + Being able to move around the documentation by following + hyperlinks is essential. Documentation generated by Haddock + is therefore littered with hyperlinks: every type and class + name is a link to the corresponding definition, and + user-written documentation annotations can contain identifiers + which are linked automatically when the documentation is + generated. - We might want documentation in multiple formats - online - and printed, for example. Haddock comes with HTML, LaTeX, + We might want documentation in multiple formats - online + and printed, for example. Haddock comes with HTML, LaTeX, and Hoogle backends, and it is structured in such a way that adding new - backends is straightforward. + backends is straightforward. @@ -125,27 +125,27 @@ Haddock source code, except where otherwise indicated.
- Copyright 2002-2010, Simon Marlow. All rights reserved. + Copyright 2002-2010, Simon Marlow. All rights reserved. - Redistribution and use in source and binary forms, with + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - - Redistributions of source code must retain the above + + + Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the + + + Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - + + - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS "AS + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT @@ -170,9 +170,9 @@ us. - Ashley Yakeley - Benjamin Franksen - Brett Letner + Ashley Yakeley + Benjamin Franksen + Brett Letner Clemens Fruhwirth Conal Elliott David Waern @@ -214,19 +214,19 @@ Haddock, most notably: - - + IDoc - - - HDoc - - - + + + HDoc + + + Doxygen - + and probably several others I've forgotten. @@ -286,165 +286,165 @@ - + dir - - Tell GHC that that its lib directory is + + Tell GHC that that its lib directory is dir. Can be used to override the default path. - + - + dir - + =dir - - Generate files into dir - instead of the current directory. - + + Generate files into dir + instead of the current directory. + - - + + dir - - + + =dir - - Use Haddock auxiliary files (themes, javascript, etc...) in dir. - + + Use Haddock auxiliary files (themes, javascript, etc...) in dir. + - - + + path,file - - + + =path,file - - Read the interface file in - file, which must have been - produced by running Haddock with the - option. The interface - describes a set of modules whose HTML documentation is - located in path (which may be a - relative pathname). The path is - optional, and defaults to .. - - This option allows Haddock to produce separate sets of - documentation with hyperlinks between them. The - path is used to direct hyperlinks - to point to the right files; so make sure you don't move the - HTML files later or these links will break. Using a - relative path means that a - documentation subtree can still be moved around without - breaking links. - - Multiple options may - be given. - + + Read the interface file in + file, which must have been + produced by running Haddock with the + option. The interface + describes a set of modules whose HTML documentation is + located in path (which may be a + relative pathname). The path is + optional, and defaults to .. + + This option allows Haddock to produce separate sets of + documentation with hyperlinks between them. The + path is used to direct hyperlinks + to point to the right files; so make sure you don't move the + HTML files later or these links will break. Using a + relative path means that a + documentation subtree can still be moved around without + breaking links. + + Multiple options may + be given. + - - + + file - - + + =file - - Produce an interface - fileHaddock interface files are - not the same as Haskell interface files, I just couldn't - think of a better name. - in the file file. An interface - file contains information Haddock needs to produce more - documentation that refers to the modules currently being - processed - see the option - for more details. The interface file is in a binary format; - don't try to read it. - + + Produce an interface + fileHaddock interface files are + not the same as Haskell interface files, I just couldn't + think of a better name. + in the file file. An interface + file contains information Haddock needs to produce more + documentation that refers to the modules currently being + processed - see the option + for more details. The interface file is in a binary format; + don't try to read it. + - - + + - - + + - - Generate documentation in HTML format. Several files - will be generated into the current directory (or the - specified directory if the option is - given), including the following: - - - module.html - mini_module.html - - An HTML page for each - module, and a "mini" page for - each used when viewing in frames. - - - - index.html - - The top level page of the documentation: lists - the modules available, using indentation to represent - the hierarchy if the modules are hierarchical. - - - - doc-index.html - doc-index-X.html - - The alphabetic index, possibly split into multiple - pages if big enough. - - - - frames.html - - The top level document when viewing in frames. - - - - some.css - etc... - - Files needed for the themes used. Specify your themes - using the option. - - - - haddock-util.js - - Some JavaScript utilities used to implement some of the - dynamic features like collapsible sections, and switching to - frames view. - - - - + + Generate documentation in HTML format. Several files + will be generated into the current directory (or the + specified directory if the option is + given), including the following: + + + module.html + mini_module.html + + An HTML page for each + module, and a "mini" page for + each used when viewing in frames. + + + + index.html + + The top level page of the documentation: lists + the modules available, using indentation to represent + the hierarchy if the modules are hierarchical. + + + + doc-index.html + doc-index-X.html + + The alphabetic index, possibly split into multiple + pages if big enough. + + + + frames.html + + The top level document when viewing in frames. + + + + some.css + etc... + + Files needed for the themes used. Specify your themes + using the option. + + + + haddock-util.js + + Some JavaScript utilities used to implement some of the + dynamic features like collapsible sections, and switching to + frames view. + + + + @@ -458,10 +458,10 @@ specified directory if the option is given), including the following: - - - package.tex - + + + package.tex + The top-level LaTeX source file; to format the documentation into PDF you might run something like this: @@ -512,110 +512,110 @@ $ pdflatex package.tex - - + + - - + + - - Reserved for future use (output documentation in DocBook XML - format). - + + Reserved for future use (output documentation in DocBook XML + format). + - - + + =URL - - + + =URL - - + + =URL - - =URL + + =URL - - Include links to the source files in the generated - documentation. Use the option to add a - source code link in the header bar of the contents and index pages. - Use the to add a source code link in - the header bar of each module page. Use the - option to add a source code link - next to the documentation for every value and type in each module. - is a flag that gets used for - entities that need to link to an exact source location rather than a - name, eg. since they were defined inside a Template Haskell splice. - - - In each case URL is the base URL - where the source files can be found. For the per-module and - per-entity URLs, the following substitutions are made within the - string URL: - - - - The string %M or %{MODULE} - is replaced by the module name. Note that for the per-entity URLs - this is the name of the exporting module. - - - The string %F or %{FILE} - is replaced by the original source file name. Note that for the - per-entity URLs this is the name of the defining - module. - - - The string %N or %{NAME} - is replaced by the name of the exported value or type. This is - only valid for the option. - - - The string %K or %{KIND} - is replaced by a flag indicating whether the exported name is a value - 'v' or a type 't'. This is - only valid for the option. - - - The string %L or %{LINE} - is replaced by the number of the line where the exported value or - type is defined. This is only valid for the - option. - - - The string %% is replaced by - %. + + Include links to the source files in the generated + documentation. Use the option to add a + source code link in the header bar of the contents and index pages. + Use the to add a source code link in + the header bar of each module page. Use the + option to add a source code link + next to the documentation for every value and type in each module. + is a flag that gets used for + entities that need to link to an exact source location rather than a + name, eg. since they were defined inside a Template Haskell splice. + + + In each case URL is the base URL + where the source files can be found. For the per-module and + per-entity URLs, the following substitutions are made within the + string URL: + + + + The string %M or %{MODULE} + is replaced by the module name. Note that for the per-entity URLs + this is the name of the exporting module. + + + The string %F or %{FILE} + is replaced by the original source file name. Note that for the + per-entity URLs this is the name of the defining + module. + + + The string %N or %{NAME} + is replaced by the name of the exported value or type. This is + only valid for the option. + + + The string %K or %{KIND} + is replaced by a flag indicating whether the exported name is a value + 'v' or a type 't'. This is + only valid for the option. + + + The string %L or %{LINE} + is replaced by the number of the line where the exported value or + type is defined. This is only valid for the + option. + + + The string %% is replaced by + %. - + - For example, if your sources are online under some directory, - you would say - haddock --source-base=url/ - --source-module=url/%F + For example, if your sources are online under some directory, + you would say + haddock --source-base=url/ + --source-module=url/%F - If you have html versions of your sources online with anchors - for each type and function name, you would say - haddock --source-base=url/ - --source-module=url/%M.html - --source-entity=url/%M.html#%N + If you have html versions of your sources online with anchors + for each type and function name, you would say + haddock --source-base=url/ + --source-module=url/%M.html + --source-entity=url/%M.html#%N - For the %{MODULE} substitution you may want to - replace the '.' character in the module names with - some other character (some web servers are known to get confused by - multiple '.' characters in a file name). To - replace it with a character c use - %{MODULE/./c}. + For the %{MODULE} substitution you may want to + replace the '.' character in the module names with + some other character (some web servers are known to get confused by + multiple '.' characters in a file name). To + replace it with a character c use + %{MODULE/./c}. - Similarly, for the %{FILE} substitution + Similarly, for the %{FILE} substitution you may want to replace the '/' character in the file names with some other character (especially for links to colourised entity source code with a shared css file). To replace @@ -627,155 +627,155 @@ $ pdflatex package.tex from haddock, is hscolour. - + - - + + URL - - + + =URL - - Deprecated aliases for - + + Deprecated aliases for + - - + + =URL - - + + =URL - - + + =URL - - Include links to pages where readers may comment on the - documentation. This feature would typically be used in conjunction - with a Wiki system. - - Use the option to add a - user comments link in the header bar of the contents and index pages. - Use the to add a user comments - link in the header bar of each module page. Use the - option to add a comments link - next to the documentation for every value and type in each module. - - - In each case URL is the base URL - where the corresponding comments page can be found. For the - per-module and per-entity URLs the same substitutions are made as - with the and - options above. - - For example, if you want to link the contents page to a wiki - page, and every module to subpages, you would say - haddock --comments-base=url - --comments-module=url/%M - - If your Wiki system doesn't like the '.' character - in Haskell module names, you can replace it with a different character. For - example to replace the '.' characters with - '_' use haddock - --comments-base=url - --comments-module=url/%{MODULE/./_} - Similarly, you can replace the '/' in a file name (may - be useful for entity comments, but probably not.) - - + + Include links to pages where readers may comment on the + documentation. This feature would typically be used in conjunction + with a Wiki system. + + Use the option to add a + user comments link in the header bar of the contents and index pages. + Use the to add a user comments + link in the header bar of each module page. Use the + option to add a comments link + next to the documentation for every value and type in each module. + + + In each case URL is the base URL + where the corresponding comments page can be found. For the + per-module and per-entity URLs the same substitutions are made as + with the and + options above. + + For example, if you want to link the contents page to a wiki + page, and every module to subpages, you would say + haddock --comments-base=url + --comments-module=url/%M + + If your Wiki system doesn't like the '.' character + in Haskell module names, you can replace it with a different character. For + example to replace the '.' characters with + '_' use haddock + --comments-base=url + --comments-module=url/%{MODULE/./_} + Similarly, you can replace the '/' in a file name (may + be useful for entity comments, but probably not.) + + - - + + =path - - Specify a theme to be used for HTML () - documentation. If given multiple times then the pages will use the - first theme given by default, and have alternate style sheets for - the others. The reader can switch between themes with browsers that - support alternate style sheets, or with the "Style" menu that gets - added when the page is loaded. If - no themes are specified, then just the default built-in theme - ("Ocean") is used. - - - The path parameter can be one of: - - - - - A directory: The base name of - the directory becomes the name of the theme. The directory - must contain exactly one - some.css file. - Other files, usually image files, will be copied, along with - the some.css - file, into the generated output directory. - - - A CSS file: The base name of - the file becomes the name of the theme. - - - The name of a built-in theme - ("Ocean" or "Classic"). - - - + + Specify a theme to be used for HTML () + documentation. If given multiple times then the pages will use the + first theme given by default, and have alternate style sheets for + the others. The reader can switch between themes with browsers that + support alternate style sheets, or with the "Style" menu that gets + added when the page is loaded. If + no themes are specified, then just the default built-in theme + ("Ocean") is used. + + + The path parameter can be one of: + + + + + A directory: The base name of + the directory becomes the name of the theme. The directory + must contain exactly one + some.css file. + Other files, usually image files, will be copied, along with + the some.css + file, into the generated output directory. + + + A CSS file: The base name of + the file becomes the name of the theme. + + + The name of a built-in theme + ("Ocean" or "Classic"). + + + - - + + - - Includes the built-in themes ("Ocean" and "Classic"). - Can be combined with . Note that order - matters: The first specified theme will be the default. - + + Includes the built-in themes ("Ocean" and "Classic"). + Can be combined with . Note that order + matters: The first specified theme will be the default. + - - + + file - - + + =file - - Deprecated aliases for - + + Deprecated aliases for + - - + + file - - + + =file - - Specify a file containing documentation which is - placed on the main contents page under the heading - “Description”. The file is parsed as a normal - Haddock doc comment (but the comment markers are not - required). - + + Specify a file containing documentation which is + placed on the main contents page under the heading + “Description”. The file is parsed as a normal + Haddock doc comment (but the comment markers are not + required). + @@ -787,14 +787,14 @@ $ pdflatex package.tex =title - - Use title as the page - heading for each page in the documentation.This will - normally be the name of the library being documented. - - The title should be a plain string (no markup - please!). - + + Use title as the page + heading for each page in the documentation.This will + normally be the name of the library being documented. + + The title should be a plain string (no markup + please!). + @@ -848,8 +848,8 @@ $ pdflatex package.tex relative: x, B.y, C.z - - + + @@ -861,9 +861,9 @@ $ pdflatex package.tex - - Display help and exit. - + + Display help and exit. + @@ -875,9 +875,9 @@ $ pdflatex package.tex - - Output version information and exit. - + + Output version information and exit. + @@ -889,13 +889,13 @@ $ pdflatex package.tex - - Increase verbosity. Currently this will cause Haddock - to emit some extra warnings, in particular about modules - which were imported but it had no information about (this is - often quite normal; for example when there is no information - about the Prelude). - + + Increase verbosity. Currently this will cause Haddock + to emit some extra warnings, in particular about modules + which were imported but it had no information about (this is + often quite normal; for example when there is no information + about the Prelude). + @@ -907,15 +907,15 @@ $ pdflatex package.tex - - When generating HTML, do not generate an index. - Instead, redirect the Contents and/or Index link on each page to - URL. This option is intended for - use in conjunction with and/or - for - generating a separate contents and/or index covering multiple - libraries. - + + When generating HTML, do not generate an index. + Instead, redirect the Contents and/or Index link on each page to + URL. This option is intended for + use in conjunction with and/or + for + generating a separate contents and/or index covering multiple + libraries. + @@ -927,64 +927,64 @@ $ pdflatex package.tex - - Generate an HTML contents and/or index containing entries pulled - from all the specified interfaces (interfaces are specified using - or ). - This is used to generate a single contents and/or index for multiple - sets of Haddock documentation. - + + Generate an HTML contents and/or index containing entries pulled + from all the specified interfaces (interfaces are specified using + or ). + This is used to generate a single contents and/or index for multiple + sets of Haddock documentation. + - - - - - - - Causes Haddock to behave as if every module has the - ignore-exports attribute (). This might be useful for - generating implementation documentation rather than interface - documentation, for example. - + + + + + + + Causes Haddock to behave as if every module has the + ignore-exports attribute (). This might be useful for + generating implementation documentation rather than interface + documentation, for example. + - - - -  module - - - Causes Haddock to behave as if module - module has the hide - attribute. (). - + + + +  module + + + Causes Haddock to behave as if module + module has the hide + attribute. (). + - - - -  module - - - Causes Haddock to behave as if module - module has the show-extensions - attribute. (). - + + + +  module + + + Causes Haddock to behave as if module + module has the show-extensions + attribute. (). + - + =option - - Pass option to GHC. Note that there is a double dash there, unlike for GHC. - + + Pass option to GHC. Note that there is a double dash there, unlike for GHC. + @@ -996,9 +996,9 @@ $ pdflatex package.tex - - Turn off all warnings. - + + Turn off all warnings. + @@ -1006,12 +1006,12 @@ $ pdflatex package.tex - + Prints out space-separated versions of binary Haddock interface files that this version is compatible with. - + @@ -1019,7 +1019,7 @@ $ pdflatex package.tex - + Do not use a temporary directory for reading and writing compilation output files (.o, .hi, and stub files). Instead, use the @@ -1031,7 +1031,7 @@ $ pdflatex package.tex Compilation files are produced when Haddock has to process modules that make use of Template Haskell, in which case Haddock compiles the modules using the GHC API. - + @@ -1090,21 +1090,21 @@ square x = x * x The declaration following a documentation annotation should be one of the following: - - A type signature for a top-level function, - - - A data declaration, - - - A newtype declaration, - - - A type declaration - - - A class declaration, - + + A type signature for a top-level function, + + + A data declaration, + + + A newtype declaration, + + + A type declaration + + + A class declaration, + A data family or type family declaration, or @@ -1166,13 +1166,13 @@ square x = x * x declaration.
- Class methods + Class methods - Class methods are documented in the same way as top - level type signatures, by using either the - -- | or - -- ^ - annotations: + Class methods are documented in the same way as top + level type signatures, by using either the + -- | or + -- ^ + annotations: class C a where @@ -1184,9 +1184,9 @@ class C a where
- Constructors and record fields + Constructors and record fields - Constructors are documented like so: + Constructors are documented like so: data T a b @@ -1196,7 +1196,7 @@ data T a b | C2 a b - or like this: + or like this: data T a b @@ -1204,8 +1204,8 @@ data T a b | C2 a b -- ^ This is the documentation for the 'C2' constructor - Record fields are documented using one of these - styles: + Record fields are documented using one of these + styles: data R a b = @@ -1251,10 +1251,10 @@ data T a = A { someField :: a -- ^ Doc for someField of A
- Function arguments + Function arguments - Individual arguments to a function may be documented - like this: + Individual arguments to a function may be documented + like this: f :: Int -- ^ The 'Int' argument @@ -1406,12 +1406,12 @@ module Foo (
- Re-exporting an entire module + Re-exporting an entire module - Haskell allows you to re-export the entire contents of a - module (or at least, everything currently in scope that was - imported from a given module) by listing it in the export - list: + Haskell allows you to re-export the entire contents of a + module (or at least, everything currently in scope that was + imported from a given module) by listing it in the export + list: module A ( @@ -1420,15 +1420,15 @@ module A ( ) where - What will the Haddock-generated documentation for this - module look like? Well, it depends on how the modules - B and C are imported. - If they are imported wholly and without any - hiding qualifiers, then the documentation - will just contain a cross-reference to the documentation for - B and C. However, if - the modules are not completely - re-exported, for example: + What will the Haddock-generated documentation for this + module look like? Well, it depends on how the modules + B and C are imported. + If they are imported wholly and without any + hiding qualifiers, then the documentation + will just contain a cross-reference to the documentation for + B and C. However, if + the modules are not completely + re-exported, for example: module A ( @@ -1440,37 +1440,37 @@ import B hiding (f) import C (a, b) - then Haddock behaves as if the set of entities - re-exported from B and C - had been listed explicitly in the export - listNOTE: this is not fully implemented at the - time of writing (version 0.2). At the moment, Haddock always - inserts a cross-reference. - . - - The exception to this rule is when the re-exported - module is declared with the hide attribute - (), in which case the module - is never cross-referenced; the contents are always expanded in - place in the re-exporting module. + then Haddock behaves as if the set of entities + re-exported from B and C + had been listed explicitly in the export + listNOTE: this is not fully implemented at the + time of writing (version 0.2). At the moment, Haddock always + inserts a cross-reference. + . + + The exception to this rule is when the re-exported + module is declared with the hide attribute + (), in which case the module + is never cross-referenced; the contents are always expanded in + place in the re-exporting module.
- Omitting the export list + Omitting the export list - If there is no export list in the module, how does - Haddock generate documentation? Well, when the export list is - omitted, e.g.: + If there is no export list in the module, how does + Haddock generate documentation? Well, when the export list is + omitted, e.g.: module Foo where - this is equivalent to an export list which mentions - every entity defined at the top level in this module, and - Haddock treats it in the same way. Furthermore, the generated - documentation will retain the order in which entities are - defined in the module. In this special case the module body - may also include section headings (normally they would be - ignored by Haddock). + this is equivalent to an export list which mentions + every entity defined at the top level in this module, and + Haddock treats it in the same way. Furthermore, the generated + documentation will retain the order in which entities are + defined in the module. In this special case the module body + may also include section headings (normally they would be + ignored by Haddock). module Foo where @@ -1493,9 +1493,9 @@ foo = 5 declaration. There are two ways to do this: - - The documentation can be included in the export list - directly, e.g.: + + The documentation can be included in the export list + directly, e.g.: module Foo ( @@ -1505,15 +1505,15 @@ module Foo ( ... ) where - + - - If the documentation is large and placing it inline in - the export list might bloat the export list and obscure the - structure, then it can be given a name and placed out of - line in the body of the module. This is achieved with a - special form of documentation annotation - -- $: + + If the documentation is large and placing it inline in + the export list might bloat the export list and obscure the + structure, then it can be given a name and placed out of + line in the body of the module. This is achieved with a + special form of documentation annotation + -- $: module Foo ( @@ -1528,11 +1528,11 @@ module Foo ( -- the name $doc. - The documentation chunk is given a name, which is the - sequence of alphanumeric characters directly after the - -- $, and it may be - referred to by the same name in the export list. - + The documentation chunk is given a name, which is the + sequence of alphanumeric characters directly after the + -- $, and it may be + referred to by the same name in the export list. +
@@ -1570,49 +1570,49 @@ import B T. Module B imports A and exports a function f whose type refers to T. Also, both - T and f are re-exported from - module C. + T and f are re-exported from + module C. Haddock takes the view that each entity has a - home module; that is, the module that the library - designer would most like to direct the user to, to find the - documentation for that entity. So, Haddock makes all links to an entity - point to the home module. The one exception is when the entity is also + home module; that is, the module that the library + designer would most like to direct the user to, to find the + documentation for that entity. So, Haddock makes all links to an entity + point to the home module. The one exception is when the entity is also exported by the current module: Haddock makes a local link if it - can. + can. How is the home module for an entity determined? - Haddock uses the following rules: + Haddock uses the following rules: - - If modules A and B both export the entity, and module A imports - (directly or indirectly) module B, then B is preferred. - - - A module with the hide attribute is never - chosen as the home. - - - A module with the not-home attribute is only - chosen if there are no other modules to choose. - + + If modules A and B both export the entity, and module A imports + (directly or indirectly) module B, then B is preferred. + + + A module with the hide attribute is never + chosen as the home. + + + A module with the not-home attribute is only + chosen if there are no other modules to choose. + If multiple modules fit the criteria, then one is chosen at - random. If no modules fit the criteria (because the candidates are all + random. If no modules fit the criteria (because the candidates are all hidden), then Haddock will issue a warning for each reference to an - entity without a home. + entity without a home. In the example above, module A is chosen as the - home for T because it does not import any other - module that exports T. The link from - f's - type in module B will therefore point to - A.T. However, C also exports - T and f, and the link from - f's type in C will therefore - point locally to C.T. + home for T because it does not import any other + module that exports T. The link from + f's + type in module B will therefore point to + A.T. However, C also exports + T and f, and the link from + f's type in C will therefore + point locally to C.T.
@@ -1639,68 +1639,68 @@ module A where Haddock: - + hide hide - - Omit this module from the generated documentation, - but nevertheless propagate definitions and documentation - from within this module to modules that re-export those - definitions. - - - - + + Omit this module from the generated documentation, + but nevertheless propagate definitions and documentation + from within this module to modules that re-export those + definitions. + + + + hide prune - - Omit definitions that have no documentation - annotations from the generated documentation. - - + + Omit definitions that have no documentation + annotations from the generated documentation. + + - + ignore-exports ignore-exports - - Ignore the export list. Generate documentation as - if the module had no export list - i.e. all the top-level - declarations are exported, and section headings may be - given in the body of the module. - - - - - - not-home + + Ignore the export list. Generate documentation as + if the module had no export list - i.e. all the top-level + declarations are exported, and section headings may be + given in the body of the module. + + + + + + not-home not-home - - - Indicates that the current module should not be considered to - be the home module for each entity it exports, - unless that entity is not exported from any other module. See - for more details. - - - - - - show-extensions + + + Indicates that the current module should not be considered to + be the home module for each entity it exports, + unless that entity is not exported from any other module. See + for more details. + + + + + + show-extensions show-extensions - - - Indicates that we should render the extensions used in this module in the + + + Indicates that we should render the extensions used in this module in the resulting documentation. This will only render if the output format supports it. If Language is set, it will be shown as well and all the extensions implied by it won't. All enabled extensions will be rendered, including those implied by their more powerful versions. - - + + @@ -1717,22 +1717,22 @@ module A where when editing documentation comments.
- Paragraphs + Paragraphs - One or more blank lines separates two paragraphs in a - documentation comment. + One or more blank lines separates two paragraphs in a + documentation comment.
- Special characters + Special characters - The following characters have special meanings in - documentation comments: \, /, - ', `, - ", @, - <. To insert a literal occurrence of - one of these special characters, precede it with a backslash - (\). + The following characters have special meanings in + documentation comments: \, /, + ', `, + ", @, + <. To insert a literal occurrence of + one of these special characters, precede it with a backslash + (\). Additionally, the character > has a special meaning at the beginning of a line, and the @@ -1748,35 +1748,35 @@ module A where
- Character references - - Although Haskell source files may contain any character - from the Unicode character set, the encoding of these characters - as bytes varies between systems, so that only source files - restricted to the ASCII character set are portable. Other - characters may be specified in character and string literals - using Haskell character escapes. To represent such characters - in documentation comments, Haddock supports SGML-style numeric - character references of the forms - &#D; - and - &#xH; - where D and H - are decimal and hexadecimal numbers denoting a code position - in Unicode (or ISO 10646). For example, the references - &#x3BB;, &#x3bb; - and &#955; all represent the lower-case - letter lambda. + Character references + + Although Haskell source files may contain any character + from the Unicode character set, the encoding of these characters + as bytes varies between systems, so that only source files + restricted to the ASCII character set are portable. Other + characters may be specified in character and string literals + using Haskell character escapes. To represent such characters + in documentation comments, Haddock supports SGML-style numeric + character references of the forms + &#D; + and + &#xH; + where D and H + are decimal and hexadecimal numbers denoting a code position + in Unicode (or ISO 10646). For example, the references + &#x3BB;, &#x3bb; + and &#955; all represent the lower-case + letter lambda.
- Code Blocks + Code Blocks - Displayed blocks of code are indicated by surrounding a - paragraph with @...@ or by preceding each - line of a paragraph with > (we often - call these “bird tracks”). For - example: + Displayed blocks of code are indicated by surrounding a + paragraph with @...@ or by preceding each + line of a paragraph with > (we often + call these “bird tracks”). For + example: -- | This documentation includes two blocks of code: @@ -1788,7 +1788,7 @@ module A where -- > g x = x * 42 - There is an important difference between the two forms + There is an important difference between the two forms of code block: in the bird-track form, the text to the right of the ‘>’ is interpreted literally, whereas the @...@ form @@ -1796,13 +1796,13 @@ module A where
- Examples + Examples - Haddock has markup support for examples of interaction with a + Haddock has markup support for examples of interaction with a read-eval-print loop (REPL). An - example is introduced with - >>> followed by an expression followed - by zero or more result lines: + example is introduced with + >>> followed by an expression followed + by zero or more result lines: -- | Two examples are given below: @@ -1814,13 +1814,13 @@ module A where -- foo -- bar - Result lines that only contain the string - <BLANKLINE> are rendered as blank lines in the - generated documentation. + Result lines that only contain the string + <BLANKLINE> are rendered as blank lines in the + generated documentation.
- Properties + Properties Haddock provides markup for properties: @@ -1833,60 +1833,60 @@ module A where
- Hyperlinked Identifiers + Hyperlinked Identifiers - Referring to a Haskell identifier, whether it be a type, - class, constructor, or function, is done by surrounding it - with single quotes: + Referring to a Haskell identifier, whether it be a type, + class, constructor, or function, is done by surrounding it + with single quotes: -- | This module defines the type 'T'. - If there is an entity T in scope in - the current module, then the documentation will hyperlink the - reference in the text to the definition of - T (if the output format supports - hyperlinking, of course; in a printed format it might instead - insert a page reference to the definition). + If there is an entity T in scope in + the current module, then the documentation will hyperlink the + reference in the text to the definition of + T (if the output format supports + hyperlinking, of course; in a printed format it might instead + insert a page reference to the definition). - It is also possible to refer to entities that are not in - scope in the current module, by giving the full qualified name - of the entity: + It is also possible to refer to entities that are not in + scope in the current module, by giving the full qualified name + of the entity: -- | The identifier 'M.T' is not in scope - If M.T is not otherwise in scope, - then Haddock will simply emit a link pointing to the entity - T exported from module M - (without checking to see whether either M - or M.T exist). + If M.T is not otherwise in scope, + then Haddock will simply emit a link pointing to the entity + T exported from module M + (without checking to see whether either M + or M.T exist). - To make life easier for documentation writers, a quoted - identifier is only interpreted as such if the quotes surround - a lexically valid Haskell identifier. This means, for - example, that it normally isn't necessary to escape the single - quote when used as an apostrophe: + To make life easier for documentation writers, a quoted + identifier is only interpreted as such if the quotes surround + a lexically valid Haskell identifier. This means, for + example, that it normally isn't necessary to escape the single + quote when used as an apostrophe: -- | I don't have to escape my apostrophes; great, isn't it? - For compatibility with other systems, the following - alternative form of markup is accepted - We chose not to use this as the primary markup for - identifiers because strictly speaking the ` - character should not be used as a left quote, it is a grave accent. - : `T'. + For compatibility with other systems, the following + alternative form of markup is accepted + We chose not to use this as the primary markup for + identifiers because strictly speaking the ` + character should not be used as a left quote, it is a grave accent. + : `T'.
- Emphasis, Bold and Monospaced text + Emphasis, Bold and Monospaced text - Emphasis may be added by surrounding text with - /.../. Other markup is valid inside emphasis. To have a forward + Emphasis may be added by surrounding text with + /.../. Other markup is valid inside emphasis. To have a forward slash inside of emphasis, just escape it: /fo\/o/ Bold (strong) text is indicated by surrounding it with __...__. @@ -1895,18 +1895,18 @@ module A where __This_text_with_underscores_is_bold__. - Monospaced (or typewriter) text is indicated by - surrounding it with @...@. Other markup is - valid inside a monospaced span: for example - @'f' a b@ will hyperlink the - identifier f inside the code fragment. + Monospaced (or typewriter) text is indicated by + surrounding it with @...@. Other markup is + valid inside a monospaced span: for example + @'f' a b@ will hyperlink the + identifier f inside the code fragment.
- Linking to modules + Linking to modules - Linking to a module is done by surrounding the module - name with double quotes: + Linking to a module is done by surrounding the module + name with double quotes: -- | This is a reference to the "Foo" module. @@ -1920,13 +1920,13 @@ module A where
- Itemized and Enumerated lists + Itemized and Enumerated lists - A bulleted item is represented by preceding a paragraph - with either * or - -. A sequence of bulleted - paragraphs is rendered as an itemized list in the generated - documentation, eg.: + A bulleted item is represented by preceding a paragraph + with either * or + -. A sequence of bulleted + paragraphs is rendered as an itemized list in the generated + documentation, eg.: -- | This is a bulleted list: @@ -1936,12 +1936,12 @@ module A where -- * second item - An enumerated list is similar, except each paragraph - must be preceded by either - (n) - or - n. - where n is any integer. e.g. + An enumerated list is similar, except each paragraph + must be preceded by either + (n) + or + n. + where n is any integer. e.g. -- | This is an enumerated list: @@ -2006,9 +2006,9 @@ This belongs to the list above!
- Definition lists + Definition lists - Definition lists are written as follows: + Definition lists are written as follows: -- | This is a definition list: @@ -2018,32 +2018,32 @@ This belongs to the list above! -- [@bar@] The description of @bar@. - To produce output something like this: - - - - foo - - The description of foo. - - - - bar - - The description of bar. - - - - - Each paragraph should be preceded by the - “definition term” enclosed in square brackets. - The square bracket characters have no special meaning outside - the beginning of a definition paragraph. That is, if a - paragraph begins with a [ character, then - it is assumed to be a definition paragraph, and the next - ] character found will close the definition - term. Other markup operators may be used freely within the - definition term. You can escape ] with a backslash as usual. + To produce output something like this: + + + + foo + + The description of foo. + + + + bar + + The description of bar. + + + + + Each paragraph should be preceded by the + “definition term” enclosed in square brackets. + The square bracket characters have no special meaning outside + the beginning of a definition paragraph. That is, if a + paragraph begins with a [ character, then + it is assumed to be a definition paragraph, and the next + ] character found will close the definition + term. Other markup operators may be used freely within the + definition term. You can escape ] with a backslash as usual. Same rules about nesting and no newline separation as for bulleted and numbered lists apply. @@ -2051,13 +2051,13 @@ This belongs to the list above!
- URLs + URLs - A URL can be included in a documentation comment by - surrounding it in angle brackets: - <...>. If the output format supports - it, the URL will be turned into a hyperlink when - rendered. + A URL can be included in a documentation comment by + surrounding it in angle brackets: + <...>. If the output format supports + it, the URL will be turned into a hyperlink when + rendered. The URL can be followed by an optional label: @@ -2072,12 +2072,12 @@ This belongs to the list above!
- Images + Images - An image can be included in a documentation comment by - surrounding it in double angle brackets: - <<...>>. If the output format supports - it, the image will be rendered inside the documentation. + An image can be included in a documentation comment by + surrounding it in double angle brackets: + <<...>>. If the output format supports + it, the image will be rendered inside the documentation. Title text can be included using an optional label: @@ -2087,26 +2087,26 @@ This belongs to the list above!
- Anchors - - Sometimes it is useful to be able to link to a point in - the documentation which doesn't correspond to a particular - entity. For that purpose, we allow anchors to be - included in a documentation comment. The syntax is - #label#, where - label is the name of the anchor. - An anchor is invisible in the generated documentation. - - To link to an anchor from elsewhere, use the syntax - "module#label" - where module is the module name - containing the anchor, and label is - the anchor label. The module does not have to be local, it - can be imported via an interface. + Anchors + + Sometimes it is useful to be able to link to a point in + the documentation which doesn't correspond to a particular + entity. For that purpose, we allow anchors to be + included in a documentation comment. The syntax is + #label#, where + label is the name of the anchor. + An anchor is invisible in the generated documentation. + + To link to an anchor from elsewhere, use the syntax + "module#label" + where module is the module name + containing the anchor, and label is + the anchor label. The module does not have to be local, it + can be imported via an interface.
- Headings + Headings Headings inside of comment documentation are possible be preceding them with a number of =s. From 1 to 6 are accepted. Extra =s will be treated as belonging to the text of the heading. Note that it's up to the output format to decide -- cgit v1.2.3