Hello. Simon Marlow wrote:
I don't think that's entirely fair. Most of the libraries that come with GHC (and Hugs, and soon Nhc) are documented. See for example
As far as I know (please correct me, if I err) one shortcoming of Haddock is its restriction to .hs-files. I think there are a lot of real literate programmers out there which would prefer a Haskell documentation tool for their literate Haskell scripts. Therefore I present the tool lhs2hs, which may seem very puristic and errorprone at this time (in fact it is). It transforms a .lhs-file into a .hs file. Furthermore tex-comments are used to pass information to e.g. Haddock: Example: %%Haddock:this function... %%Haddock:...
testfun...
%%Haddock:another function... \begin{code} ... \end{code} This .lhs file becomes transformed to {-| this function... ... -} testfun... {-| another function... -} ... Ok, its simple, but it can be useful and it is extensible! I have attached the very first version. Type: ghc --make Main.lhs -package util -o lhs2hs ./lhs2hs -h Main.lhs haddock -h Main.hs latex Main.lhs Another idea to simplify literate programming with Haskell: allow XML (introduce a new file extension .xhs), e.g.: <hscomment describes="quicksort"> sorts a list </hscomment> <hsdecl defines "quicksort"> quicksort... </hsdecl> This would allow more transformations! Bye, Steffen