{ haskellLib }:

self: super: {
  ghcjs-prim = null;
  derive = null;
  focus-http-th = null;
  th-lift-instances = null;
  websockets = null;
  wai = null;
  warp = null;
  wai-app-static = null;

  cabal-doctest = null;
  syb = haskellLib.overrideCabal super.syb (drv: { jailbreak = true; });

  reflex-todomvc = haskellLib.overrideCabal super.reflex-todomvc (drv: {
    postFixup = ''
      mkdir $out/reflex-todomvc.app
      cp reflex-todomvc.app/* $out/reflex-todomvc.app/
      cp $out/bin/reflex-todomvc $out/reflex-todomvc.app/
    '';
  });
  cabal-macosx = null;
  mkDerivation = drv: super.mkDerivation (drv // {
    doHaddock = false;
    enableSharedLibraries = false;
    enableSharedExecutables = false;
  });
}

{ haskellLib }:

self: super: {
  ghcjs-prim = null;
  derive = null;
  focus-http-th = null;
  th-lift-instances = null;
  websockets = null;
  wai = null;
  warp = null;
  wai-app-static = null;

  cabal-doctest = null;
  syb = haskellLib.overrideCabal super.syb (drv: { jailbreak = true; });

  # HACK(matthewbauer):
  # Temporary fix for https://github.com/ekmett/free/issues/176
  # Optimizations are broken on iOS for some modules.
  free = haskellLib.appendConfigureFlag super.free "--enable-optimization=0";
  jsaddle = haskellLib.appendConfigureFlag super.jsaddle "--enable-optimization=0";

  reflex-todomvc = haskellLib.overrideCabal super.reflex-todomvc (drv: {
    postFixup = ''
      mkdir $out/reflex-todomvc.app
      cp reflex-todomvc.app/* $out/reflex-todomvc.app/
      cp $out/bin/reflex-todomvc $out/reflex-todomvc.app/
    '';
  });
  cabal-macosx = null;
  mkDerivation = drv: super.mkDerivation (drv // {
    doHaddock = false;
    enableSharedLibraries = false;
    enableSharedExecutables = false;
  });
}

Add temporary fix for Haskell free + iOS issue
Add temporary fix for Haskell free + iOS issue

Discussion here: https://github.com/ekmett/free/issues/176

We need to disable optimizations for things to build.
