anchor.diff:              # all packages with haskell- to avoid name clashes for libraries;
               # if that is not desired (for applications), name can be set to
               # fname.
  -            name = if enableLibraryProfiling then
  -                     "haskell-${self.pname}-ghc${ghc.ghc.version}-${self.version}-profiling"
  +            name = if self.isLibrary then
  +                     if enableLibraryProfiling then
  +                       "haskell-${self.pname}-ghc${ghc.ghc.version}-${self.version}-profiling"
  +                     else
  +                       "haskell-${self.pname}-ghc${ghc.ghc.version}-${self.version}"
                      else
  -                     "haskell-${self.pname}-ghc${ghc.ghc.version}-${self.version}";
  +                     "${self.pname}-${self.version}";
   
               # the default download location for Cabal packages is Hackage,
               # you still have to specify the checksum
  
positive.code:             # buildInputs can be extended by the client by using extraBuildInputs,
              # but often propagatedBuildInputs is preferable anyway
              buildInputs = [ghc] ++ self.extraBuildInputs;
              extraBuildInputs = [];
  
              # we make sure that propagatedBuildInputs is defined, so that we don't
              # have to check for its existence
              propagatedBuildInputs = [];
  
              # library directories that have to be added to the Cabal files
              extraLibDirs = [];
  
              libraryProfiling =
                if enableLibraryProfiling then ["--enable-library-profiling"]
  
negative.code: # generic builder for Cabal packages
  
  {stdenv, fetchurl, lib, pkgconfig, ghc, enableLibraryProfiling ? false} :
  {
    mkDerivation =
      args : # arguments for the individual package, can modify the defaults
      let # These attributes are removed in the end. This is in order not to spoil the build
          # environment overly, but also to keep hash-backwards-compatible with the old cabal.nix.
          internalAttrs = [
            "internalAttrs" "buildDepends" "buildTools" "extraLibraries" "pkgconfigDepends"
            "isLibrary" "isExecutable"
          ];
  
          defaults =
            self : { # self is the final version of the attribute set
  
              # pname should be defined by the client to be the package basename
  