Skip to content

Commit 5e7bced

Browse files
committed
Support for ghc 9.4
1 parent 0ca5375 commit 5e7bced

File tree

9 files changed

+96
-25
lines changed

9 files changed

+96
-25
lines changed

.github/workflows/haskell.yml

+3-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
build:
77
strategy:
88
matrix:
9-
ghc: ['8.4.4', '8.6.5', '8.8.4', '8.10.7']
9+
ghc: ['8.4.4', '8.6.5', '8.8.4', '8.10.7', '9.4.3']
1010
os: ['ubuntu-latest', 'macos-latest']
1111
runs-on: ${{ matrix.os }}
1212

@@ -17,7 +17,7 @@ jobs:
1717
with:
1818
ghc-version: ${{ matrix.ghc }}
1919
- name: Cache
20-
uses: actions/cache@v1
20+
uses: actions/cache@v3
2121
env:
2222
cache-name: cache-cabal
2323
with:
@@ -30,9 +30,7 @@ jobs:
3030
${{ runner.os }}
3131
3232
- name: Install dependencies
33-
run: |
34-
cabal update
35-
cabal build --only-dependencies --enable-tests --enable-benchmarks
33+
run: cabal build --only-dependencies --enable-tests --enable-benchmarks
3634
- name: Build
3735
run: cabal build --enable-tests --enable-benchmarks all
3836
- name: Run tests

nixpkgs/default.nix

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT HAND-EDIT THIS FILE
2+
import (import ./thunk.nix)

nixpkgs/github.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"owner": "NixOS",
3+
"repo": "nixpkgs",
4+
"branch": "nixpkgs-unstable",
5+
"private": false,
6+
"rev": "e37ef84b478fa8da0ced96522adfd956fde9047a",
7+
"sha256": "03qak39mn2142gp6zglrzrkdbig6h4r3da1psmvf3q2dwcw3zsfv"
8+
}

nixpkgs/thunk.nix

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# DO NOT HAND-EDIT THIS FILE
2+
let fetch = { private ? false, fetchSubmodules ? false, owner, repo, rev, sha256, ... }:
3+
if !fetchSubmodules && !private then builtins.fetchTarball {
4+
url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz"; inherit sha256;
5+
} else (import (builtins.fetchTarball {
6+
url = "https://github.com/NixOS/nixpkgs/archive/3aad50c30c826430b0270fcf8264c8c41b005403.tar.gz";
7+
sha256 = "0xwqsf08sywd23x0xvw4c4ghq0l28w2ki22h0bdn766i16z9q2gr";
8+
}) {}).fetchFromGitHub {
9+
inherit owner repo rev sha256 fetchSubmodules private;
10+
};
11+
json = builtins.fromJSON (builtins.readFile ./github.json);
12+
in fetch json

reflex-vty.cabal

+6-5
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ extra-source-files:
1818
ChangeLog.md
1919
extra-doc-files: doc/tasks.png
2020
tested-with:
21-
GHC ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.7
21+
GHC ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.7 || ==9.4.3
2222

2323
source-repository head
2424
type: git
@@ -39,23 +39,23 @@ library
3939
, Reflex.Spider.Orphans
4040
, Control.Monad.NodeId
4141
build-depends:
42-
base >= 4.10.0 && < 4.16,
42+
base >= 4.10.0 && < 4.18,
4343
bimap >= 0.3.3 && < 0.5,
4444
containers >= 0.5.0 && < 0.7,
4545
mtl >= 2.2.2 && < 2.3,
4646
transformers >= 0.5.5 && < 0.6,
4747
stm >= 2.4 && < 2.6,
4848
data-default >= 0.7.1 && < 0.8,
4949
dependent-map >= 0.4 && < 0.5,
50-
text >= 1.2.3 && < 1.3,
50+
text >= 1.2.3 && < 2.1,
5151
dependent-sum >= 0.7 && < 0.8,
5252
exception-transformers >= 0.4.0 && < 0.5,
5353
mmorph >= 1.1 && < 1.2,
5454
ordered-containers >= 0.2.2 && < 0.3,
5555
primitive >= 0.6.3 && < 0.8,
5656
ref-tf >= 0.4.0 && < 0.6,
57-
reflex >= 0.8 && < 0.9,
58-
time >= 1.8.0 && < 1.10,
57+
reflex >= 0.8 && < 1,
58+
time >= 1.8.0 && < 1.13,
5959
vty >= 5.28 && < 5.38
6060
hs-source-dirs: src
6161
default-language: Haskell2010
@@ -88,6 +88,7 @@ library
8888
TemplateHaskell
8989
TupleSections
9090
TypeApplications
91+
TypeOperators
9192
TypeFamilies
9293

9394
executable example

release.nix

+40-13
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,44 @@
1-
{ reflex-platform ? import ./reflex-platform {}
1+
{ reflex-platform ? import ./reflex-platform
22
}:
3-
let inherit (reflex-platform.nixpkgs.haskell) lib;
4-
ghc = reflex-platform.ghc.override {
5-
overrides = self: super: {
6-
vty = self.callHackageDirect {
7-
pkg = "vty";
8-
ver = "5.37";
9-
sha256 = "01ppspii5x02iik9rxkf2idi6r9ngax6w3mqi6d8qj765w3cksiq";
3+
let
4+
pkgs = (reflex-platform {}).nixpkgs;
5+
supportedSystems = [ "x86_64-linux" "x86_64-darwin" ];
6+
inherit (pkgs) lib;
7+
commonOverrides = self: super: {
8+
vty = self.callHackageDirect {
9+
pkg = "vty";
10+
ver = "5.37";
11+
sha256 = "01ppspii5x02iik9rxkf2idi6r9ngax6w3mqi6d8qj765w3cksiq";
12+
} {};
13+
};
14+
in
15+
lib.genAttrs supportedSystems (system: let
16+
rp = reflex-platform { inherit system; __useNewerCompiler = true; };
17+
rpGhc = rp.ghc.override {
18+
overrides = commonOverrides;
19+
};
20+
nixGhc = (import ./nixpkgs { inherit system; }).haskell.packages.ghc943.override {
21+
overrides = self: super: commonOverrides self super // {
22+
hlint = self.callHackageDirect {
23+
pkg = "hlint";
24+
ver = "3.5";
25+
sha256 = "1np43k54918v54saqqgnd82ccd6225njwxpg2031asi70jam80x9";
26+
} {};
27+
patch = self.callHackageDirect {
28+
pkg = "patch";
29+
ver = "0.0.8.1";
30+
sha256 = "0q5rxnyilhbnfph48fnxbclggsbbhs0pkn0kfiadm0hmfr440cgk";
1031
} {};
32+
reflex = self.callHackageDirect {
33+
pkg = "reflex";
34+
ver = "0.9.0.0";
35+
sha256 = "0ibashkz3ifwxa61zg3fwamvjwv125l7jhjd74kgjbq13zpx23ib";
36+
} {};
37+
string-qq = pkgs.haskell.lib.dontCheck super.string-qq;
1138
};
1239
};
13-
in
14-
{
15-
reflex-vty =
16-
ghc.callCabal2nix "reflex-vty" ./. {};
17-
}
40+
in
41+
{
42+
ghc810 = rpGhc.callCabal2nix "reflex-vty" (import ./src.nix) {};
43+
ghc943 = nixGhc.callCabal2nix "reflex-vty" (import ./src.nix) {};
44+
})

shell.nix

+16-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,16 @@
1-
(import ./release.nix {}).reflex-vty.env
1+
# Enter a shell for this project using reflex-platform (which provides ghc8107)
2+
# or nixpkgs (which provides ghc943)
3+
{ compiler ? "ghc810" # or "ghc943"
4+
}:
5+
let pkgs = (import ./reflex-platform { }).nixpkgs;
6+
in
7+
pkgs.mkShell {
8+
name = "shell-${compiler}";
9+
buildInputs = [
10+
pkgs.cabal-install
11+
pkgs.ghcid
12+
];
13+
inputsFrom = [
14+
(import ./release.nix {}).${builtins.currentSystem}.${compiler}.env
15+
];
16+
}

src.nix

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
builtins.filterSource (path: type: !(builtins.elem (baseNameOf path) [
2+
"release.nix"
3+
".git"
4+
"dist"
5+
"cabal.haskell-ci"
6+
"cabal.project"
7+
".travis.yml"
8+
])) ./.

src/Reflex/Vty/Widget.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module Reflex.Vty.Widget where
99
import Control.Applicative (liftA2)
1010
import Control.Monad.Fix (MonadFix)
1111
import Control.Monad.IO.Class (MonadIO)
12-
import Control.Monad.Morph
12+
import Control.Monad.Morph (MFunctor(..))
1313
import Control.Monad.NodeId
1414
import Control.Monad.Reader (ReaderT, ask, local, runReaderT)
1515
import Control.Monad.Ref

0 commit comments

Comments
 (0)