haddock

Generating documentation for my own code with Haddock and stack

别来无恙 提交于 2020-12-29 02:36:39
问题 I have annotated my code in Haddock style and would like to generate browse-able documentation. Since I am also using stack, I want to integrate the documentation generation into the workflow. However, I have not yet been able to generate anything useful. I can run stack haddock and it will generate documentation in the style I want (to be found deep inside ~/.stack/ ), but it only seems to generate documentation for the packages I depend on, rather than for my own code. When I run stack

Stack ExitFailure 1

被刻印的时光 ゝ 提交于 2020-03-28 06:40:48
问题 I've been trying to run stack install hsdev --stack-yaml ./Documents/hsdev.yaml , where hsdev.yaml contains packages: [] resolver: lts-13.29 extra-deps: - hsdev-0.3.3.4 - hdocs-0.5.3.2 - haddock-api-2.22.0 - network-3.0.1.1 This returns the error -- While building package haddock-api-2.22.0 using: /home/hello/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.5 --builddir=.stack-work/dist/x86_64-linux/Cabal-2.4.0.1 build --ghc-options " -fdiagnostics-color=always"

Why isn't Cabal hyperlinking my sources?

喜欢而已 提交于 2020-01-24 08:12:05
问题 $ cabal --version cabal-install version 1.22.2.0 using version 1.22.2.0 of the Cabal library $ cabal install --haddock-hyperlink-source gloss-juicy Warning: /home/theking/.cabal/config: Unrecognized field hyperlink-source on line 91 I do have hyperlink-source: True on in my config. I added the flag just to be redundant. When I look for the docs, it is all colorized and everything, but the source code isn't linkified. What am I doing wrong? 回答1: Hopefully we're talking about the haddock

How to show progress of `stack haddock`?

百般思念 提交于 2019-12-24 08:19:01
问题 Ran stack haddock haskell-src-exts I get: haskell-src-exts-1.20.3: configure haskell-src-exts-1.20.3: build haskell-src-exts-1.20.3: haddock And I've been waiting around for an hour but it still hasn't finished. Adding --haddock-arguments --verbosity=3 doesn't seem to change anything. It would be really nice to have some sort of progress indicator so I can know if it's stuck or just slow. $ stack --version Version 1.9.1, Git revision f9d0042c141660e1d38f797e1d426be4a99b2a3c (6168 commits) x86

ghc-pkg check haddock warnings

北慕城南 提交于 2019-12-22 04:58:12
问题 Upon a fresh install of the haskell-platform (via homebrew ) ( GHC x64 7.6.3 ) on OSX 10.9.2 I receive the following warnings when I run ghc-pkg check (see below) Warning: haddock-interfaces: /Users/user/.cabal/share/doc/x86_64-osx-ghc-7.6.3/ghc-mod-3.1.7/html/ghc-mod.haddock doesn't exist or isn't a file Warning: haddock-html: /Users/user/.cabal/share/doc/x86_64-osx-ghc-7.6.3/ghc-mod-3.1.7/html doesn't exist or isn't a directory Warning: haddock-interfaces: /Users/user/.cabal/share/doc/x86

What does * (star) or other kinds mean in an instance list of haddock

你。 提交于 2019-12-19 18:22:09
问题 Browsing the haddocks of various packages I often come along instance documentations that look like this (Control.Category): Category k (Coercion k) Category * (->) or this (Control.Monad.Trans.Identity): MonadTrans (IdentityT *) What exactly here does the kind signature mean? It doesn't show up in the source, but I have already noticed that it seems to occur in modules that use the PolyKinds extension. I suspect it is probably like a TypeApplication but with a kind. So that e.g. the last

Enable --hyperlink-source for “cabal install”

随声附和 提交于 2019-12-18 12:49:56
问题 The command cabal haddock has very useful --hyperlink-source option. I would like to have the source hyperlinked when building documentation with cabal install . The ticket #517 seems to be just about it: http://hackage.haskell.org/trac/hackage/ticket/517 However, perhaps it is possible to set this flag via ~/.cabal/config file? If not, how can I get working cabal-install build with the patch from #517 without installing Cabal-1.9, which is currently mandatory (due to one patch from December)

what is the meaning of “let x = x in x” and “data Float#” in GHC.Prim in Haskell

霸气de小男生 提交于 2019-12-18 07:40:56
问题 I looked at the module of GHC.Prim and found that it seems that all datas in GHC.Prim are defined as data Float# without something like =A|B , and all functions in GHC.Prim is defined as gtFloat# = let x = x in x . My question is whether these definations make sense and what they mean. I checked the header of GHC.Prim like below {- This is a generated file (generated by genprimopcode). It is not code to actually be used. Its only purpose is to be consumed by haddock. -} I guess it may have

cabal haddock failing because function is defined in multiple files

女生的网名这么多〃 提交于 2019-12-11 03:58:25
问题 I try to generate documentation for my executable using cabal haddock . My project structure looks like this: ~/.../project_name project_name.cabal Setup.hs src/ Main.hs Data/ ... test/ MainTestSuite ... When I run cabal haddock --executable it fails with the following error message: module ‘projects-0.1.0.0:Main’ is defined in multiple files: dist/build/tmp-8215/src/Main.hs dist/build/tmp-8215/./Setup.hs The Source.hs file has these contents: import Distribution.Simple main = defaultMain The

How to write special characters like new line, and format output of haddock

◇◆丶佛笑我妖孽 提交于 2019-12-08 17:35:57
问题 I would like to format my haddock documentation as I do with javadoc, something like inserting html or any other markup that let me get a cleaner output without uncluding any javascript or CSS... Specially, I would like to know how to insert a line break in the documentation. thanks! 回答1: Haddock is designed to work with multiple output formats, including LaTeX, so it uses its own markup format instead of something like HTML. I don't think you can insert just a line break, but you can start a