Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

To allow compilation with ghc-8.10.4 #11

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions myShell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
let

myHaskellPackageOverlay = self: super: {

myHaskellPackages = super.haskellPackages.override {
overrides = hself: hsuper: rec {

cas-store = self.haskell.lib.overrideCabal self.haskellPackages.cas-store (old: { libraryHaskellDepends = old.libraryHaskellDepends ++ [ self.haskellPackages.kqueue ]; });

funflow = super.haskell.lib.dontCheck (hself.callHackage "funflow" "1.5.0" {});

funflow-nix = super.haskell.lib.dontCheck hsuper.funflow-nix;


};
};
};

in

{ nixpkgs ? import <nixpkgs> { config.allowBroken = true;
overlays = [ myHaskellPackageOverlay ];
},
compiler ? "default",
doBenchmark ? false }:

let

inherit (nixpkgs) pkgs;

f = { mkDerivation, base, containers, data-default, funflow
, funflow-nix, Glob, lib, path, path-io, time, unix
}:
mkDerivation {
pname = "map-scraper";
version = "0.1.0.0";
src = ./.;
isLibrary = false;
isExecutable = true;
executableHaskellDepends = [
base containers data-default funflow funflow-nix Glob path path-io
time unix
];
license = lib.licenses.bsd3;
};

haskellPackages = if compiler == "default"
then pkgs.haskellPackages
else pkgs.haskell.packages.${compiler};

variant = if doBenchmark then pkgs.haskell.lib.doBenchmark else pkgs.lib.id;

drv = variant (pkgs.myHaskellPackages.callPackage f {});

in

if pkgs.lib.inNixShell then drv.env else drv
2 changes: 1 addition & 1 deletion shell.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
let
np = import <nixpkgs> {};
in
np.mkShell { buildInputs = [np.haskell.packages.ghc822.ghc]; }
np.mkShell { buildInputs = [np.haskell.packages.ghc8104.ghc]; }
10 changes: 6 additions & 4 deletions src/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TupleSections #-}

{-# OPTIONS_GHC -Wall -Wno-type-defaults #-}

module Main where

import Control.Arrow
Expand Down Expand Up @@ -57,7 +59,7 @@ partitionA f = proc xs ->
That d -> ((second (partitionA f)) >>> arr (\(d, (cs, ds)) -> (cs, d:ds))) -< (d, ys)
These c d -> (second (partitionA f)) >>> arr (\((c, d), (cs, ds)) -> (c:cs, d:ds)) -< ((c, d), ys)

boolChoice :: ArrowFlow eff ex a => a CS.Item (These CS.Item (Content Dir))
boolChoice :: (ArrowFlow eff ex a, ArrowChoice a) => a CS.Item (These CS.Item (Content Dir))
boolChoice = proc dir -> do
str <- readString_ -< dir
case str of
Expand Down Expand Up @@ -250,8 +252,8 @@ nixScriptX impure std script scripts params = proc (scriptDir, a) -> do
{ _etCommand = "perl"
, _etParams = contentParam (s ^</> script) : params args
, _etWriteToStdOut = std
, _etEnv = [("NIX_PATH", textParam "nixpkgs="
<> textParam nixPackages )] }) -< (env, a)
, _etEnv = EnvExplicit [("NIX_PATH", textParam "nixpkgs="
<> textParam nixPackages )] }) -< (env, a)
where
props = def { ep_impure = impure }
absScripts sd = map (sd ^</>) (script : scripts)
Expand Down Expand Up @@ -281,7 +283,7 @@ mergeDirs' = proc inDirs -> do
rmOut :: ArrowFlow eff ex arr => arr (Content Dir) (Content Dir)
rmOut = proc dir -> do mergeFiles <<< globDir -< (dir, "*.pickle")

splitDir :: ArrowFlow eff ex arr => arr (Content Dir) ([Content File])
splitDir :: (ArrowFlow eff ex arr, ArrowChoice arr) => arr (Content Dir) ([Content File])
splitDir = proc dir -> do
(_, fs) <- listDirContents -< dir
mapA reifyFile -< fs
Expand Down