Send Beginners mailing list submissions to beginners@haskell.org To subscribe or unsubscribe via the World Wide Web, visit http://www.haskell.org/mailman/listinfo/beginners or, via email, send a message with subject or body 'help' to beginners-requ...@haskell.org
You can reach the person managing the list at beginners-ow...@haskell.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Beginners digest..." Today's Topics: 1. Re: a problem with maps (Ertugrul Soeylemez) 2. Re: Combining GHC library and Platform documentation (Jack Henahan) ---------------------------------------------------------------------- Message: 1 Date: Sat, 23 Jul 2011 04:58:47 +0200 From: Ertugrul Soeylemez <e...@ertes.de> Subject: Re: [Haskell-beginners] a problem with maps To: beginners@haskell.org Message-ID: <20110723045847.3aa23...@angst.streitmacht.eu> Content-Type: text/plain; charset=US-ASCII Dennis Raddle <dennis.rad...@gmail.com> wrote: > mapOutList :: Ord k => [(k,a)] -> Mpa k [a] > mapOutList list = M.fromList $ map (second (: [])) list I'm not sure that this really does what you want. Rather something like this: fromAmbList :: Ord k => [(k, a)] -> Map k [a] fromAmbList = M.fromListWith (++) . map (second pure) Greets, Ertugrul -- nightmare = unsafePerformIO (getWrongWife >>= sex) http://ertes.de/ ------------------------------ Message: 2 Date: Fri, 22 Jul 2011 23:09:37 -0400 From: Jack Henahan <jhena...@uvm.edu> Subject: Re: [Haskell-beginners] Combining GHC library and Platform documentation To: Mister Globules <globu...@gmail.com> Cc: beginners@haskell.org Message-ID: <32b5e754-0ef9-4b2b-b3be-d4fac5612...@uvm.edu> Content-Type: text/plain; charset="us-ascii" You might also look into docidx[1], on github for a while and recently released on Hackage. It's a neat little tool. It does all the hard work for you. :D [1]http://hackage.haskell.org/package/docidx-1.0.1 On Jul 20, 2011, at 2:36 AM, Mister Globules wrote: > Magnus Therning <magnus <at> therning.org> writes: > >> >> On Tue, Jul 19, 2011 at 05:51:31AM +0000, Mister Globules wrote: >>> [...] >>> Is there a simple way to create one index.html file with links to all the >>> documentation? >>> >>> As a bonus, is it possible to do the same thing with libraries that I >>> install with cabal? >>> >>> - Globules >>> [...] >> >> Hopefully you have a script installed, as part of ghc itself, called >> gen_contents_index. It's what we in Arch use to update the index.html >> file when installing/removing Haskell packages. I'm not sure it >> already supports privately installed packages, but hopefully it won't >> be too difficult to modify. >> >> /M >> > > Thanks Magnus, I found the script. Based on its behaviour in the no-args > case (I didn't look too closely at --inplace) I wrote a similar script that > allows me to specify multiple directories on the command-line. So, I can > specify the GHC, platform and my personal libraries. > > In case anyone finds it useful I've appended it below. (Hopefully, it will > make it through relatively unscathed.) > > - Globules > > > The following script is in the public domain. > > #!/bin/sh -eu > # > # Generate HTML contents and an index for Haskell libraries. > # > # WARNING: May not handle whitespace, etc. in paths. > # > # Run this command from the directory in which you want index.html created. > The > # package directory arguments can be relative or absolute paths. > # > # Usage: > # > # mkhaskellhtml pkg_dir ... > # > # Example - GHC and platform docs: > # > # cd /local/pkg/ghc-7.0.3/share/doc/ghc/html/libraries > # mkhaskellhtml . /local/pkg/haskell-platform-2011.2.0.1/share/doc > # > # Example - GHC, platform and user package docs: > # > # cd /local/pkg/ghc-7.0.3/share/doc/ghc/html/libraries > # mkhaskellhtml . /local/pkg/haskell-platform-2011.2.0.1/share/doc > ~/.cabal/share/doc > # > > # The default GHC home directory, if the GHC_HOME variable is not set. > GHC_DFL=/local/pkg/ghc-7.0.3 > > # Exclude the GHC API. If you want the GHC API use cat instead. > filter_ghc_api () { > grep -v 'ghc\.haddock$' > # cat > } > > PATH=${GHC_HOME:-$GHC_DFL}/bin:/bin:/usr/bin > > if [ $# -lt 1 ]; then > echo Too few arguments. 1>&2 > echo Usage: $(basename $0) pkg_dir ... 1>&2 > exit 1 > fi > > ris=$(find "$@" -type f -name \*.haddock | > filter_ghc_api | > while read hdk ; do > echo --read-interface=${hdk%/*.haddock},$hdk > done) > > [ -z "$ris" ] && { echo 'No packages found!'; exit 0; } > > haddock \ > --gen-index \ > --gen-contents \ > -o . \ > -t "Haskell Hierarchical Libraries" \ > -p prologue.txt \ > $ris > > > > _______________________________________________ > Beginners mailing list > Beginners@haskell.org > http://www.haskell.org/mailman/listinfo/beginners Jack Henahan jhena...@uvm.edu == Computer science is no more about computers than astronomy is about telescopes. -- Edsger Dijkstra == -------------- next part -------------- A non-text attachment was scrubbed... Name: 398E692F.gpg Type: application/x-apple-msg-attachment Size: 17822 bytes Desc: not available URL: <http://www.haskell.org/pipermail/beginners/attachments/20110722/4445a6de/attachment.bin> -------------- next part -------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 881 bytes Desc: This is a digitally signed message part URL: <http://www.haskell.org/pipermail/beginners/attachments/20110722/4445a6de/attachment.pgp> ------------------------------ _______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners End of Beginners Digest, Vol 37, Issue 49 *****************************************