Skip to content

Commit

Permalink
Update for GHC 9.6 (#493)
Browse files Browse the repository at this point in the history
* Update for GHC 9.6

* ci: add ghc 9.6

* cabal: loosen bifunctors version bounds

* ci: loosen bounds for ghc84

* ci: build exception-transformers without tests on nix

* Bump version and update changelog

* bench: add import to fix ghc96 build

---------

Co-authored-by: Doug Beardsley <mightybyte@gmail.com>
  • Loading branch information
ali-abrar and mightybyte committed May 24, 2023
1 parent 82c2b5e commit 68d66e8
Show file tree
Hide file tree
Showing 21 changed files with 106 additions and 19 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@ jobs:
build:
strategy:
matrix:
ghc: ['8.4.4', '8.6.5', '8.8.4', '8.10.7', '9.0.1', '9.2.5', '9.4.3']
ghc: ['8.4.4', '8.6.5', '8.8.4', '8.10.7', '9.0.2', '9.2.5', '9.4.5', '9.6.1']
os: ['ubuntu-latest', 'macos-latest']
runs-on: ${{ matrix.os }}

name: GHC ${{ matrix.ghc }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: haskell/actions/setup@v2
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: '3.10.1.0'
- name: Cache
uses: actions/cache@v3
env:
Expand All @@ -35,5 +36,7 @@ jobs:
run: cabal build --enable-tests --enable-benchmarks all
- name: Run tests
run: cabal test --enable-tests all
- name: Build Docs
- if: matrix.ghc != '8.4.4'
# docs aren't built on ghc 8.4.4 because some dependency docs don't build on older GHCs
name: Build Docs
run: cabal haddock
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Revision history for reflex

## 0.9.0.1

* Add support for ghc-9.6

## 0.9.0.0

* Breaking Change: Filter updates to `listWithKey` child widgets so that changes to the input Map don't cause spurious updates to unaffected children. This imposes an `Eq` constraint on the child values.
Expand Down
1 change: 1 addition & 0 deletions bench/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module Main where
import Control.Concurrent.STM
import Control.DeepSeq
import Control.Exception (evaluate)
import Control.Monad
import Control.Monad.Identity
import Control.Monad.IO.Class
import Criterion.Main
Expand Down
4 changes: 2 additions & 2 deletions nixpkgs/github.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"repo": "nixpkgs",
"branch": "nixpkgs-unstable",
"private": false,
"rev": "e37ef84b478fa8da0ced96522adfd956fde9047a",
"sha256": "03qak39mn2142gp6zglrzrkdbig6h4r3da1psmvf3q2dwcw3zsfv"
"rev": "c7eb65213bd7d95eafb8c5e2e181f04da103d054",
"sha256": "1glf6j13hbwi459qrc8kkkhfw27a08vdg17sr3zwhadg4bkxz5ia"
}
24 changes: 13 additions & 11 deletions reflex.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: reflex
Version: 0.9.0.0
Version: 0.9.0.1
Synopsis: Higher-order Functional Reactive Programming
Description:
Interactive programs without callbacks or side-effects.
Expand Down Expand Up @@ -28,7 +28,7 @@ extra-source-files:
ChangeLog.md

tested-with:
GHC ==8.4.4 || ==8.6.5 || ==8.8.1 || ==8.10.7 || ==9.0.1 || ==9.2.5 || ==9.4.3,
GHC ==8.4.4 || ==8.6.5 || ==8.8.1 || ==8.10.7 || ==9.0.1 || ==9.2.5 || ==9.4.5 || ==9.6.1,
GHCJS ==8.6 || ==8.10

flag use-reflex-optimizer
Expand Down Expand Up @@ -71,38 +71,38 @@ library
hs-source-dirs: src
build-depends:
MemoTrie == 0.6.*,
base >= 4.11 && < 4.18,
bifunctors >= 5.2 && < 5.6,
base >= 4.11 && < 4.19,
bifunctors >= 5.2 && < 5.7,
comonad >= 5.0.4 && < 5.1,
commutative-semigroups >= 0.1 && <0.2,
constraints >= 0.10 && <0.14,
constraints-extras >= 0.3 && < 0.5,
containers >= 0.6 && < 0.7,
data-default >= 0.5 && < 0.8,
dependent-map >= 0.3 && < 0.5,
exception-transformers == 0.4.*,
exception-transformers >= 0.4 && < 0.5,
lens >= 4.7 && < 5.3,
mmorph >= 1.0 && < 1.2,
mmorph >= 1.0 && < 1.3,
monad-control >= 1.0.1 && < 1.1,
mtl >= 2.1 && < 2.3,
mtl >= 2.1 && < 2.4,
patch >= 0.0.7 && < 0.1,
prim-uniq >= 0.1.0.1 && < 0.3,
primitive >= 0.5 && < 0.8,
profunctors >= 5.3 && < 5.7,
random >= 1.1 && < 1.3,
ref-tf >= 0.4 && < 0.6,
reflection == 2.1.*,
semigroupoids >= 4.0 && < 6,
semigroupoids >= 4.0 && < 7,
stm >= 2.4 && < 2.6,
syb >= 0.5 && < 0.8,
time >= 1.4 && < 1.13,
transformers >= 0.5.6.0 && < 0.6,
transformers >= 0.5 && < 0.7,
unbounded-delays >= 0.1.0.0 && < 0.2,
witherable >= 0.4 && < 0.5

if flag(split-these)
build-depends: these >= 1 && <1.3,
semialign >=1 && <1.3,
semialign >=1 && <1.4,
monoidal-containers >= 0.6.2.0 && < 0.7
else
build-depends: these >= 0.4 && <0.9,
Expand Down Expand Up @@ -188,7 +188,7 @@ library
dependent-sum >= 0.6 && < 0.8,
haskell-src-exts >= 1.16 && < 1.24,
haskell-src-meta >= 0.6 && < 0.9,
template-haskell >= 2.9 && < 2.20
template-haskell >= 2.9 && < 2.21
exposed-modules:
Reflex.Dynamic.TH
other-extensions: TemplateHaskell
Expand Down Expand Up @@ -260,6 +260,8 @@ test-suite hlint
, directory
, filepath
, filemanip
if impl(ghc >= 9.6)
buildable: False
if impl(ghc < 9.2)
build-depends: hlint (< 2.1 || >= 2.2.2) && < 3.5
else
Expand Down
60 changes: 58 additions & 2 deletions release.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
let
native-reflex-platform = reflex-platform-fun { __useNewerCompiler = true; };
inherit (native-reflex-platform.nixpkgs) lib;

perPlatform = lib.genAttrs supportedSystems (system: let
reflex-platform = reflex-platform-fun { inherit system; __useNewerCompiler = true; };
compilers = [
Expand All @@ -21,6 +20,63 @@ let
"-dontUseTemplateHaskell"
""
];
pkgs = import ./nixpkgs { inherit system; };
sharedOverrides = self: super: {
exception-transformers = pkgs.haskell.lib.dontCheck super.exception-transformers;
};
nixpkgsGhcs =
let
nixGhc902 = pkgs.haskell.packages.ghc902.override { overrides = sharedOverrides; };
nixGhc945 = pkgs.haskell.packages.ghc945.override { overrides = sharedOverrides; };
nixGhc961 = pkgs.haskell.packages.ghc961.override {
overrides = self: super: sharedOverrides self super // {
these-lens = self.callHackageDirect {
pkg = "these-lens";
ver = "1.0.1.3";
sha256 = "0n1vkr57jz5yvy4jm15v5cs42rp342ni0gisib7aqyhibpicqs5c";
} {};
these = self.callHackageDirect {
pkg = "these";
ver = "1.2";
sha256 = "1iaaq1fsvg8c3l0czcicshkmbbr00hnwkdamjbkljsa1qvlilaf0";
} {};
lens = self.callHackageDirect {
pkg = "lens";
ver = "5.2.2";
sha256 = "0c4a421sxfjm1cj3nvgwkr4glll23mqnsvs2iv5qh85931h2f3cy";
} {};

assoc = self.callHackageDirect {
pkg = "assoc";
ver = "1.1";
sha256 = "1krvcafrbj98z5hv55gq4zb1in5yd71nmz9zdiqgnywjzbrvpf75";
} {};

strict = self.callHackageDirect {
pkg = "strict";
ver = "0.5";
sha256 = "02iyvrr7nd7fnivz78lzdchy8zw1cghqj1qx2yzbbb9869h1mny7";
} {};

hlint = self.callHackageDirect {
pkg = "hlint";
ver = "3.5";
sha256 = "1np43k54918v54saqqgnd82ccd6225njwxpg2031asi70jam80x9";
} {};

patch = self.callHackageDirect {
pkg = "patch";
ver = "0.0.8.2";
sha256 = "160zqqhjg48fr3a33gffd82qm3728c8hwf8sn37pbpv82fw71rzg";
} {};
};
};
in
{
ghc902 = nixGhc902.callCabal2nix "reflex" (import ./src.nix) {};
ghc945 = nixGhc945.callCabal2nix "reflex" (import ./src.nix) {};
ghc961 = nixGhc961.callCabal2nix "reflex" (import ./src.nix) {};
};
compilerPkgs = lib.genAttrs compilers (ghc: let
variationPkgs = lib.genAttrs variations (variation: let
reflex-platform = reflex-platform-fun {
Expand All @@ -40,7 +96,7 @@ let
cache = reflex-platform.pinBuildInputs "reflex-${system}-${ghc}"
(builtins.attrValues variationPkgs);
});
in compilerPkgs // {
in compilerPkgs // nixpkgsGhcs // {
cache = reflex-platform.pinBuildInputs "reflex-${system}"
(map (a: a.cache) (builtins.attrValues compilerPkgs));
});
Expand Down
2 changes: 2 additions & 0 deletions src/Reflex/BehaviorWriter/Base.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ module Reflex.BehaviorWriter.Base
, withBehaviorWriterT
) where

import Control.Monad
import Control.Monad.Exception
import Control.Monad.Fix
import Control.Monad.Identity
import Control.Monad.IO.Class
import Control.Monad.Morph
Expand Down
2 changes: 2 additions & 0 deletions src/Reflex/Class.hs
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ import Data.Zip (Zip (..), Unzip (..))
#endif

import Control.Applicative
import Control.Monad
import Control.Monad.Fix
import Control.Monad.Identity
import Control.Monad.Reader
import Control.Monad.State.Strict
Expand Down
2 changes: 2 additions & 0 deletions src/Reflex/Collection.hs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ import Data.Zip (Zip (..))
#endif
#endif

import Control.Monad
import Control.Monad.Fix
import Control.Monad.Identity
import Data.Align
import Data.Functor.Misc
Expand Down
2 changes: 1 addition & 1 deletion src/Reflex/Dynamic.hs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ import Data.Monoid ((<>))
import Data.These
import Data.Type.Equality ((:~:) (..))

import Debug.Trace
import Debug.Trace hiding (traceEventWith)

-- | Map a sampling function over a 'Dynamic'.
mapDynM :: forall t m a b. (Reflex t, MonadHold t m) => (forall m'. MonadSample t m' => a -> m' b) -> Dynamic t a -> m (Dynamic t b)
Expand Down
2 changes: 2 additions & 0 deletions src/Reflex/DynamicWriter/Base.hs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ module Reflex.DynamicWriter.Base
, withDynamicWriterT
) where

import Control.Monad
import Control.Monad.Exception
import Control.Monad.Fix
import Control.Monad.Identity
import Control.Monad.IO.Class
import Control.Monad.Morph
Expand Down
1 change: 1 addition & 0 deletions src/Reflex/EventWriter/Base.hs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import Reflex.Requester.Class
import Reflex.TriggerEvent.Class

import Control.Monad.Exception
import Control.Monad.Fix
import Control.Monad.Identity
import Control.Monad.Morph
import Control.Monad.Primitive
Expand Down
1 change: 1 addition & 0 deletions src/Reflex/PerformEvent/Base.hs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import Reflex.Requester.Class

import Control.Lens
import Control.Monad.Exception
import Control.Monad.Fix
import Control.Monad.Identity
import Control.Monad.Primitive
import Control.Monad.Reader
Expand Down
2 changes: 2 additions & 0 deletions src/Reflex/PerformEvent/Class.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ module Reflex.PerformEvent.Class
, performEventAsync
) where

import Control.Monad
import Control.Monad.Fix
import Control.Monad.Reader
import Control.Monad.Trans.Maybe (MaybeT (..))

Expand Down
1 change: 1 addition & 0 deletions src/Reflex/PostBuild/Base.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import Reflex.TriggerEvent.Class

import Control.Applicative (liftA2)
import Control.Monad.Exception
import Control.Monad.Fix
import Control.Monad.Identity
import Control.Monad.Primitive
import Control.Monad.Reader
Expand Down
2 changes: 2 additions & 0 deletions src/Reflex/Requester/Base/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ import Reflex.Requester.Class
import Reflex.TriggerEvent.Class

import Control.Applicative (liftA2)
import Control.Monad
import Control.Monad.Exception
import Control.Monad.Fix
import Control.Monad.Identity
import Control.Monad.Morph
import Control.Monad.Primitive
Expand Down
1 change: 1 addition & 0 deletions src/Reflex/Requester/Class.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ module Reflex.Requester.Class
, requestingIdentity
) where

import Control.Monad.Fix
import Control.Monad.Identity
import Control.Monad.Reader
import qualified Control.Monad.State.Lazy as Lazy
Expand Down
1 change: 1 addition & 0 deletions src/Reflex/Spider/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import Control.Concurrent
import Control.Exception
import Control.Monad hiding (forM, forM_, mapM, mapM_)
import Control.Monad.Exception
import Control.Monad.Fix
import Control.Monad.Identity hiding (forM, forM_, mapM, mapM_)
import Control.Monad.Primitive
import Control.Monad.Reader.Class
Expand Down
1 change: 1 addition & 0 deletions src/Reflex/TriggerEvent/Base.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module Reflex.TriggerEvent.Base
import Control.Applicative (liftA2)
import Control.Concurrent
import Control.Monad.Exception
import Control.Monad.Fix
import Control.Monad.Primitive
import Control.Monad.Reader
import Control.Monad.Ref
Expand Down
1 change: 1 addition & 0 deletions test/Reflex/Plan/Reflex.hs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import Reflex.TestPlan

import Control.Applicative
import Control.Monad
import Control.Monad.Fix
import Control.Monad.Identity
import Control.Monad.State.Strict

Expand Down
2 changes: 2 additions & 0 deletions test/Reflex/Test/CrossImpl.hs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import qualified Reflex.Spider.Internal as S
import qualified Reflex.Profiled as Prof

import Control.Arrow (second, (&&&))
import Control.Monad
import Control.Monad.Fix
import Control.Monad.Identity hiding (forM, forM_, mapM, mapM_, sequence, sequence_)
import Control.Monad.State.Strict hiding (forM, forM_, mapM, mapM_, sequence, sequence_)
import Data.Dependent.Sum (DSum (..))
Expand Down

0 comments on commit 68d66e8

Please sign in to comment.