Skip to content

Commit db84d2a

Browse files
authored
Merge pull request #96 from tweag/ghc-9.0-compatibility
Compatibility with GHC 9.0
2 parents 446d43a + ba61041 commit db84d2a

File tree

10 files changed

+74
-71
lines changed

10 files changed

+74
-71
lines changed

.github/workflows/ci.yaml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ jobs:
2323
~/.cabal/packages
2424
~/.cabal/store
2525
dist-newstyle
26-
key: cache-${{ runner.os }}-${{ hashFiles('nixpkgs.nix') }}-v${{ env.cache-invalidation-key }}-${{ hashFiles('linear-base.cabal') }}-${{ github.sha }}
27-
restore-keys: cache-${{ runner.os }}-${{ hashFiles('nixpkgs.nix') }}-v${{ env.cache-invalidation-key }}-${{ hashFiles('linear-base.cabal') }}-
26+
key: cache-${{ runner.os }}-${{ hashFiles('nixpkgs.nix') }}-v${{ env.cache-invalidation-key }}-${{ hashFiles('capability.cabal') }}-${{ github.sha }}
27+
restore-keys: cache-${{ runner.os }}-${{ hashFiles('nixpkgs.nix') }}-v${{ env.cache-invalidation-key }}-${{ hashFiles('capability.cabal') }}-
2828
- name: Update Cabal's database
2929
run: $NIXSHELL --run "cabal update"
3030
- name: Build Cabal's dependencies
@@ -35,3 +35,18 @@ jobs:
3535
run: $NIXSHELL --run "cabal --flag=dev test"
3636
- name: Haddock
3737
run: $NIXSHELL --run "cabal haddock"
38+
39+
stack-ghc9:
40+
name: Build on GHC 9.0
41+
runs-on: ubuntu-latest
42+
steps:
43+
- uses: actions/[email protected]
44+
- name: Cache dependencies
45+
uses: actions/[email protected]
46+
with:
47+
path: ~/.stack
48+
key: stack-ghc9-${{ runner.os }}-v${{ env.cache-invalidation-key }}-${{ hashFiles('stack-ghc9.yaml.lock', 'capability.cabal') }}
49+
- name: Upgrade stack
50+
run: stack upgrade
51+
- name: Build
52+
run: stack --stack-yaml=stack-ghc9.yaml build --pedantic --test --bench --no-run-tests --no-run-benchmarks

capability.cabal

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ library
5858
Capability.Stream
5959
Capability.TypeOf
6060
Capability.Writer
61-
Capability.Writer.Discouraged
6261
build-depends:
6362
base >= 4.14 && < 5.0
6463
, constraints >= 0.1 && < 0.14
@@ -67,7 +66,6 @@ library
6766
, generic-lens >= 2.0 && < 2.2
6867
, lens >= 4.16 && < 5.1
6968
, monad-control >= 1.0 && < 1.1
70-
, monad-unlift >= 0.2 && < 0.3
7169
, mtl >= 2.0 && < 3.0
7270
, mutable-containers >= 0.3 && < 0.4
7371
, primitive >= 0.6 && < 0.8

src/Capability.hs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,6 @@
103103
-- The use of tags allows one to have independent effects that share a superclass.
104104
-- E.g. @HasState "foo" Int@ and @HasWriter "bar" String@.
105105
--
106-
-- Some of the capability modules have a “discouraged” companion (such as
107-
-- "Capability.Writer.Discouraged"). These modules contain deriving-via
108-
-- combinators which you can use if you absolutely must: they are correct, but
109-
-- inefficient, so we recommend that you do not.
110-
--
111106
-- Finally there are
112107
--
113108
-- * "Capability.Derive"

src/Capability/Error.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@ wrapError :: forall innertag t (cs :: [Capability]) inner m a.
174174
, HasCatch innertag inner (t m)
175175
, All cs m)
176176
=> (forall m'. All (HasCatch innertag inner ': cs) m' => m' a) -> m a
177-
wrapError =
178-
derive @t @'[HasCatch innertag inner] @cs
177+
wrapError action =
178+
derive @t @'[HasCatch innertag inner] @cs action
179179
{-# INLINE wrapError #-}
180180

181181
-- XXX: Does it make sense to add a HasMask capability similar to @MonadMask@?

src/Capability/Reader/Internal/Class.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ magnify :: forall innertag t (cs :: [Capability]) inner m a.
107107
, HasReader innertag inner (t m)
108108
, All cs m)
109109
=> (forall m'. All (HasReader innertag inner ': cs) m' => m' a) -> m a
110-
magnify =
111-
derive @t @'[HasReader innertag inner] @cs
110+
magnify action =
111+
derive @t @'[HasReader innertag inner] @cs action
112112
{-# INLINE magnify #-}
113113

114114
--------------------------------------------------------------------------------

src/Capability/Reflection.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ interpret_ ::
7373
Reified tag c m ->
7474
(forall m'. c m' => m' a) ->
7575
m a
76-
interpret_ = interpret @tag @'[] @c
76+
interpret_ dict action = interpret @tag @'[] @c dict action
7777
{-# INLINE interpret_ #-}
7878

7979
-- | @interpret \@tag \@ambient dict action@

src/Capability/State/Internal/Class.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ zoom :: forall innertag t (cs :: [Capability]) inner m a.
132132
, HasState innertag inner (t m)
133133
, All cs m )
134134
=> (forall m'. All (HasState innertag inner ': cs) m' => m' a) -> m a
135-
zoom =
136-
derive @t @'[HasState innertag inner] @cs
135+
zoom action =
136+
derive @t @'[HasState innertag inner] @cs action
137137
{-# INLINE zoom #-}
138138

139139
--------------------------------------------------------------------------------

src/Capability/Writer/Discouraged.hs

Lines changed: 0 additions & 55 deletions
This file was deleted.

stack-ghc9.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
resolver: nightly-2021-07-04
2+
3+
packages:
4+
- .
5+
6+
extra-deps:
7+
# Generic-lens is not yet released in a 9.0-compatible version
8+
- git: https://github.com/kcsongor/generic-lens.git
9+
commit: 8e1fc7dcf444332c474fca17110d4bc554db08c8
10+
subdirs:
11+
- generic-lens-core
12+
- generic-lens

stack-ghc9.yaml.lock

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# This file was autogenerated by Stack.
2+
# You should not edit this file by hand.
3+
# For more information, please see the documentation at:
4+
# https://docs.haskellstack.org/en/stable/lock_files
5+
6+
packages:
7+
- completed:
8+
subdir: generic-lens-core
9+
name: generic-lens-core
10+
version: 2.1.0.0
11+
git: https://github.com/kcsongor/generic-lens.git
12+
pantry-tree:
13+
size: 2283
14+
sha256: 5a26b16c38ad8d8ebc81182e1d09858858f16dc117a0c7b084d8446d3a17d749
15+
commit: 8e1fc7dcf444332c474fca17110d4bc554db08c8
16+
original:
17+
subdir: generic-lens-core
18+
git: https://github.com/kcsongor/generic-lens.git
19+
commit: 8e1fc7dcf444332c474fca17110d4bc554db08c8
20+
- completed:
21+
subdir: generic-lens
22+
name: generic-lens
23+
version: 2.1.0.0
24+
git: https://github.com/kcsongor/generic-lens.git
25+
pantry-tree:
26+
size: 2630
27+
sha256: aba81557550537d4cfda2c1b07accff8589da44a1e418a3cde5639eb438d1c86
28+
commit: 8e1fc7dcf444332c474fca17110d4bc554db08c8
29+
original:
30+
subdir: generic-lens
31+
git: https://github.com/kcsongor/generic-lens.git
32+
commit: 8e1fc7dcf444332c474fca17110d4bc554db08c8
33+
snapshots:
34+
- completed:
35+
size: 540164
36+
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/nightly/2021/7/4.yaml
37+
sha256: 195e3e9394de03e724525e210f82e30c4488f7c8a09fc70850d75d8b79332993
38+
original: nightly-2021-07-04

0 commit comments

Comments
 (0)