Diagrams/GHC7.6

From HaskellWiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

As of this writing (13 Nov 2012), the most recently released versions of diagrams (0.5.x) do not build under GHC 7.6.

If you get a message about installing transformers-0.2.2.0, don't do it! Here's what's happening: the latest version of diagrams on Hackage says it requires base-4.5 or earlier. GHC 7.6 comes with base-4.6, so when you request to install diagrams of course cabal rejects the latest version. But here's where things go screwy: cabal then starts looking back in time to try to find an earlier version of diagrams which "works". It finds diagrams-0.2.2.3, which is quite old and happens to be the last time that the base dependency did not have an upper bound.

However, the development versions of diagrams on github work under GHC 7.6. To build from github:

   cabal update                      # make sure you have the latest gtk2hs packages
   cabal install gtk2hs-buildtools   # if necessary
   mkdir diagrams && cd diagrams
   git clone https://github.com/diagrams/diagrams-core.git core
   git clone https://github.com/diagrams/diagrams-lib.git lib
   git clone https://github.com/diagrams/diagrams-cairo.git cairo
   git clone https://github.com/diagrams/diagrams-svg.git svg
   git clone https://github.com/diagrams/diagrams-contrib.git contrib
   cabal install core/ lib/ cairo/ svg/ contrib/  # or just pick one of {cairo,svg}