Skip to content

Commit

Permalink
GHC-9.6 and mtl-2.3 support
Browse files Browse the repository at this point in the history
Bump version.
  • Loading branch information
coot committed Jun 4, 2023
1 parent d033616 commit 40d3282
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ghc: ["8.8.4", "8.10.7", "9.0.2", "9.2.4", "9.4.3"]
ghc: ["8.10.7", "9.0.2", "9.2.8", "9.4.5", "9.6.2"]
os: [ubuntu-latest]

steps:
Expand Down
3 changes: 3 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog for free-algebras

## Version 0.1.1.0
- Support `GHC-9.6` and `mtl-2.3`, drop support of `GHC-8.8`.

## Version 0.1.0.2
- Support `GHC-9.0`, `GHC-9.2` and `GHC-9.4`, drop support for `GHC-8.6` or earlier.

Expand Down
2 changes: 1 addition & 1 deletion cabal.project
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
index-state: 2022-09-05T00:00:00Z
index-state: 2023-06-04T00:00:00Z
packages: .
examples
8 changes: 4 additions & 4 deletions free-algebras.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 2.2
cabal-version: 3.0
name: free-algebras
version: 0.1.0.2
version: 0.1.1.0
synopsis: Free algebras
description:
Algebraic approach to free algebras, inspired by Univeral Algebra and
Expand All @@ -19,7 +19,7 @@ extra-source-files:
ChangeLog.md
README.md
stability: experimental
tested-with: GHC==8.8.4, GHC==8.10.4, GHC==9.0.2, GHC==9.2.4, GHC==9.4.2
tested-with: GHC == { 8.10, 9.0, 9.2, 9.4, 9.6 }

source-repository head
type: git
Expand Down Expand Up @@ -58,7 +58,7 @@ library
, groups >= 0.3 && <0.6
, kan-extensions >= 4.1 && <6.0
, mtl >= 2.2 && <2.4
, transformers >= 0.5 && <0.6
, transformers >= 0.5 && <0.7
default-language: Haskell2010

test-suite test-free-algebras
Expand Down
18 changes: 14 additions & 4 deletions src/Control/Algebra/Free.hs
Original file line number Diff line number Diff line change
Expand Up @@ -46,26 +46,34 @@ module Control.Algebra.Free
-- * Free construction in continuation passing style
, Free1 (..)
-- * Various classes (higher algebra types)
#if !MIN_VERSION_mtl(2,3,0)
, MonadList (..)
#endif
, MonadMaybe (..)

) where

import Control.Applicative ( Alternative (..)
, liftA2
)
import Control.Applicative ( Alternative (..) )
#if !MIN_VERSION_mtl(2,3,0)
import Control.Applicative ( liftA2 )
#endif
import Control.Applicative.Free (Ap)
import qualified Control.Applicative.Free as Ap
import qualified Control.Applicative.Free.Fast as Fast
import qualified Control.Applicative.Free.Final as Final
import Control.Alternative.Free (Alt (..))
import qualified Control.Alternative.Free as Alt
import Control.Monad ( MonadPlus (..), foldM, join)
import Control.Monad ( MonadPlus (..), join )
#if !MIN_VERSION_mtl(2,3,0)
import Control.Monad ( foldM )
#endif
import Control.Monad.Except (ExceptT (..), MonadError (..))
import Control.Monad.Free (Free)
import qualified Control.Monad.Free as Free
import qualified Control.Monad.Free.Church as Church
#if !MIN_VERSION_mtl(2,3,0)
import Control.Monad.List (ListT (..))
#endif
import Control.Monad.Reader (MonadReader (..), ReaderT (..))
import Control.Monad.RWS.Class (MonadRWS)
import Control.Monad.RWS.Lazy as L (RWST (..))
Expand Down Expand Up @@ -562,6 +570,7 @@ instance FreeAlgebra1 (S.RWST r w s) where
tell w
return a

#if !MIN_VERSION_mtl(2,3,0)
-- | Algebra type for @'ListT'@ monad transformer.
--
class Monad m => MonadList m where
Expand All @@ -584,6 +593,7 @@ instance FreeAlgebra1 ListT where
as <- nat mas
empty1 <- mempty1
foldM (\x y -> x `mappend1_` y) empty1 as
#endif

-- | Free construction for kinds @'Type' -> 'Type'@. @'Free1' 'Functor'@ is
-- isomorphic to @'Coyoneda'@ via @'hoistFreeH'@, and @'Free1' 'Applicative'@
Expand Down

0 comments on commit 40d3282

Please sign in to comment.