anchor.diff: -{ stdenv, ghc, pkgconfig, glibcLocales, cacert }@depArgs:
  +{ stdenv, ghc, pkgconfig, glibcLocales, cacert, stack }@depArgs:
   
   with stdenv.lib;
   
  
positive.code: , extraArgs ? []
  , LD_LIBRARY_PATH ? []
  , ghc ? depArgs.ghc
  , ...
  }@args:
  
  stdenv.mkDerivation (args // {
  
    buildInputs =
      buildInputs ++
      optional stdenv.isLinux glibcLocales ++
      [ ghc pkgconfig ];
  
    STACK_PLATFORM_VARIANT="nix";
    STACK_IN_NIX_SHELL=1;
  
negative.code:     export STACK_ROOT=$NIX_BUILD_TOP/.stack
    '';
  
    buildPhase = args.buildPhase or "${stackCmd} build";
  
    checkPhase = args.checkPhase or "${stackCmd} test";
  
    doCheck = args.doCheck or true;
  
    installPhase = args.installPhase or ''
      ${stackCmd} --local-bin-path=$out/bin build --copy-bins
    '';
  })
  