Skip to content

Commit

Permalink
Merge pull request #445 from fused-effects/ghc-9.6-support
Browse files Browse the repository at this point in the history
Support GHC 9.6 and base-4.18.
  • Loading branch information
patrickt committed Jun 8, 2023
2 parents ab3c492 + 55d6b60 commit 616a5d2
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ghc: ["8.2", "8.4", "8.6", "8.8", "8.10", "9.0", "9.2", "9.4"]
ghc: ["8.2", "8.4", "8.6", "8.8", "8.10", "9.0", "9.2", "9.4", "9.6.2"]

steps:
- uses: actions/checkout@v2
Expand Down
3 changes: 3 additions & 0 deletions examples/Labelled.hs
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeApplications #-}
module Labelled
( example
) where

#if !MIN_VERSION_base(4,18,0)
import Control.Applicative
#endif
import Control.Carrier.Reader
import Control.Carrier.State.Strict
import Control.Effect.Labelled
Expand Down
15 changes: 11 additions & 4 deletions fused-effects.cabal
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
cabal-version: 2.2

name: fused-effects
version: 1.1.2.1
version: 1.1.2.2
synopsis: A fast, flexible, fused effect system.
description: A fast, flexible, fused effect system, à la Effect Handlers in Scope, Monad Transformers and Modular Algebraic Effects: What Binds Them Together, and Fusion for Free—Efficient Algebraic Effect Handlers.
homepage: https://github.com/fused-effects/fused-effects
license: BSD-3-Clause
license-file: LICENSE
author: Nicolas Wu, Tom Schrijvers, Rob Rix, Patrick Thomson
maintainer: robrix@github.com
copyright: 2018-2021 Nicolas Wu, Tom Schrijvers, Rob Rix, Patrick Thomson
copyright: 2018-2023 Nicolas Wu, Tom Schrijvers, Rob Rix, Patrick Thomson
category: Control
build-type: Simple
extra-source-files:
Expand All @@ -25,6 +25,7 @@ tested-with:
GHC == 9.0.1
GHC == 9.2.1
GHC == 9.4.2
GHC == 9.6.2

common common
default-language: Haskell2010
Expand All @@ -48,6 +49,12 @@ common common
if (impl(ghc >= 9.2))
ghc-options:
-Wno-missing-kind-signatures
-- Temporary hack to deal with a bug in GHC 9.6 where
-- derivations of MonadTrans cause spurious redundant-constraint warnings.
-- https://gitlab.haskell.org/ghc/ghc/-/issues/23143
if (impl(ghc >= 9.6))
ghc-options:
-Wno-redundant-constraints

library
import: common
Expand Down Expand Up @@ -117,8 +124,8 @@ library
Control.Effect.Throw.Internal
Control.Effect.Writer.Internal
build-depends:
base >= 4.9 && < 4.18
, transformers >= 0.4 && < 0.6
base >= 4.9 && < 4.19
, transformers >= 0.4 && < 0.7
, unliftio-core >= 0.2 && < 0.3


Expand Down
7 changes: 5 additions & 2 deletions src/Control/Carrier/Choose/Church.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
Expand All @@ -24,7 +25,9 @@ module Control.Carrier.Choose.Church
) where

import Control.Algebra
#if !MIN_VERSION_base(4,18,0)
import Control.Applicative (liftA2)
#endif
import Control.Effect.Choose
import Control.Monad.Fail as Fail
import Control.Monad.Fix
Expand Down Expand Up @@ -82,8 +85,8 @@ instance MonadFix m => MonadFix (ChooseC m) where
mfix f = ChooseC $ \ fork leaf ->
mfix (runChooseS (pure . pure) . f . head)
>>= \case
a:|[] -> leaf a
a:|_ -> leaf a `fork` runChoose fork leaf (mfix (liftAll . fmap tail . runChooseS (pure . pure) . f))
a :| [] -> leaf a
a :| _ -> leaf a `fork` runChoose fork leaf (mfix (liftAll . fmap tail . runChooseS (pure . pure) . f))
where
liftAll m = ChooseC $ \ fork leaf -> m >>= foldr1 fork . fmap leaf
{-# INLINE mfix #-}
Expand Down
2 changes: 1 addition & 1 deletion src/Control/Carrier/Cull/Church.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module Control.Carrier.Cull.Church
) where

import Control.Algebra
import Control.Applicative (liftA2)
import Control.Applicative
import Control.Carrier.NonDet.Church
import Control.Carrier.Reader
import Control.Effect.Cull
Expand Down
2 changes: 1 addition & 1 deletion src/Control/Carrier/Cut/Church.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module Control.Carrier.Cut.Church
) where

import Control.Algebra
import Control.Applicative (liftA2)
import Control.Applicative
import Control.Effect.Cut
import Control.Effect.NonDet
import Control.Monad.Fail as Fail
Expand Down
3 changes: 3 additions & 0 deletions src/Control/Carrier/Empty/Church.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
Expand All @@ -20,7 +21,9 @@ module Control.Carrier.Empty.Church
) where

import Control.Algebra
#if !MIN_VERSION_base(4,18,0)
import Control.Applicative (liftA2)
#endif
import Control.Effect.Empty
import Control.Monad.Fix
import Control.Monad.Fail as Fail
Expand Down
2 changes: 1 addition & 1 deletion src/Control/Carrier/Error/Church.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module Control.Carrier.Error.Church
) where

import Control.Algebra
import Control.Applicative (Alternative(..), liftA2)
import Control.Applicative
import Control.Effect.Error
import Control.Monad (MonadPlus)
import Control.Monad.Fail as Fail
Expand Down
2 changes: 1 addition & 1 deletion src/Control/Carrier/NonDet/Church.hs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module Control.Carrier.NonDet.Church
) where

import Control.Algebra
import Control.Applicative (liftA2)
import Control.Applicative
import Control.Effect.NonDet
import Control.Monad.Fail as Fail
import Control.Monad.Fix
Expand Down
2 changes: 1 addition & 1 deletion src/Control/Carrier/Reader.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module Control.Carrier.Reader
) where

import Control.Algebra
import Control.Applicative (Alternative(..), liftA2)
import Control.Applicative
import Control.Effect.Reader
import Control.Monad (MonadPlus)
import Control.Monad.Fail as Fail
Expand Down
2 changes: 1 addition & 1 deletion src/Control/Carrier/State/Church.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module Control.Carrier.State.Church
) where

import Control.Algebra
import Control.Applicative (Alternative(..), liftA2)
import Control.Applicative
import Control.Effect.State
import Control.Monad (MonadPlus)
import Control.Monad.Fail as Fail
Expand Down

0 comments on commit 616a5d2

Please sign in to comment.