<commit_before>{ stdenv, fetchurl, fetchpatch, bootPkgs, perl, gmp, ncurses, libiconv, binutils, coreutils
, hscolour
}:

let
  inherit (bootPkgs) ghc;

in 
stdenv.mkDerivation rec {
  version = "8.0.0.20160411";
  name = "ghc-${version}";

  src = fetchurl {
    url = "https://downloads.haskell.org/~ghc/8.0.1-rc3/${name}-src.tar.xz";
    sha256 = "0cgk0li3pwag65xcrjci8l840aphklymjfmsrq0qpdi8bpsmi97d";
  };

  patches = [
    ./ghc-8.x-dont-pass-linker-flags-via-response-files.patch  # https://github.com/NixOS/nixpkgs/issues/10752
  ];

  buildInputs = [ ghc perl hscolour ];

  enableParallelBuilding = true;

  preConfigure = ''
    sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
  '' + stdenv.lib.optionalString (!stdenv.isDarwin) ''<commit_msg>ghc: update 8.0.x version to rc4<commit_after>{ stdenv, fetchurl, fetchpatch, bootPkgs, perl, gmp, ncurses, libiconv, binutils, coreutils
, hscolour
}:

let
  inherit (bootPkgs) ghc;

in 
stdenv.mkDerivation rec {
  version = "8.0.0.20160421";
  name = "ghc-${version}";

  src = fetchurl {
    url = "https://downloads.haskell.org/~ghc/8.0.1-rc4/${name}-src.tar.xz";
    sha256 = "183p1ilk8rlndi1vmg2vmlx00s18q3j31kin85qpbvicsxb8j1j1";
  };

  patches = [
    ./ghc-8.x-dont-pass-linker-flags-via-response-files.patch  # https://github.com/NixOS/nixpkgs/issues/10752
  ];

  buildInputs = [ ghc perl hscolour ];

  enableParallelBuilding = true;

  preConfigure = ''
    sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
  '' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
{'fraction_non_alphanumeric': 0.16017868538608807, 'fraction_numerical': 0.05679642629227824, 'mean_word_length': 3.6666666666666665, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1774992', 'n_tokens_mistral': 736, 'n_tokens_neox': 676, 'n_words': 99}