anchor.diff:  with lib;
   
   let
  +  scalacheckRepoUrl = "https://github.com/rickynils/scalacheck";
  +
  +  docFooter = version: rev:
  +    let shortRev = builtins.substring 0 7 rev;
  +    in "ScalaCheck ${version} / ${shortRev} API documentation. © 2007-2013 Rickard Nilsson";
  +
  +  docSourceUrl = version: rev:
  +    let tag = if hasSuffix "SNAPSHOT" version then rev else version;
  +    in "${scalacheckRepoUrl}/tree/${tag}/src/main/scala€{FILE_PATH}.scala";
   
     mkTestInterface = args: stdenv.mkDerivation rec {
       name = "test-interface-${args.version}";
  
positive.code: 
    mkScalaCheck = args: stdenv.mkDerivation rec {
      inherit (args) name;
      src = fetchgit {
        url = https://github.com/rickynils/scalacheck;
        inherit (args) rev sha256;
      };
      buildInputs = [ openjre args.scala ];
      buildPhase = ''
        find src/main -name '*.scala' > sources
        scalac -classpath ${test-interface."1.0"}/lib/test-interface.jar \
          -sourcepath src/main -d ${name}.jar @sources
        ${lib.optionalString args.runTests ''
          find src/test -name '*.scala' > sources-test
          scalac -classpath ${name}.jar \
            -sourcepath src/test -d ${name}-test.jar @sources-test
          scala -classpath ${name}.jar:${name}-test.jar org.scalacheck.TestAll
        ''}
      '';
      installPhase = ''
        mkdir -p $out/lib
        mv ${name}.jar $out/lib/
      '';
    };
  
  
negative.code:       name = scalacheckVer;
        value = mkScalaCheck {
          name = "scalacheck_${scalaVer}-${scalacheckVer}";
          version = scalacheckVer;
          runTests = if scalacheck ? runTests then scalacheck.runTests else true;
          inherit scala;
          inherit (scalacheck) rev sha256;
  