anchor.diff:                          then "package-db"
                           else "package-conf";
   
  +  # the target dir for haddock documentation
  +  docdir = docoutput: docoutput + "/share/doc";
  +
     newCabalFileUrl = "http://hackage.haskell.org/package/${pname}-${version}/revision/${revision}.cabal";
     newCabalFile = fetchurl {
       url = newCabalFileUrl;
  
positive.code:     ''}
  
      ${optionalString enableSeparateDocOutput ''
      for x in $doc/share/doc/html/src/*.html; do
        remove-references-to -t $out $x
      done
      mkdir -p $doc
  
negative.code:   defaultConfigureFlags = [
      "--verbose" "--prefix=$out" "--libdir=\\$prefix/lib/\\$compiler" "--libsubdir=\\$pkgid"
      (optionalString enableSeparateDataOutput "--datadir=$data/share/${ghc.name}")
      (optionalString enableSeparateDocOutput "--docdir=${docdir "$doc"}")
      "--with-gcc=$CC" # Clang won't work without that extra information.
      "--package-db=$packageConfDir"
      (optionalString (enableSharedExecutables && stdenv.isLinux) "--ghc-option=-optl=-Wl,-rpath=$out/lib/${ghc.name}/${pname}-${version}")
  