Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 25 additions & 51 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,26 +60,6 @@ jobs:
compilerVersion: 9.6.7
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.4.8
compilerKind: ghc
compilerVersion: 9.4.8
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.2.8
compilerKind: ghc
compilerVersion: 9.2.8
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.0.2
compilerKind: ghc
compilerVersion: 9.0.2
setup-method: ghcup
allow-failure: false
- compiler: ghc-8.10.7
compilerKind: ghc
compilerVersion: 8.10.7
setup-method: ghcup
allow-failure: false
fail-fast: false
steps:
- name: apt-get install
Expand Down Expand Up @@ -192,7 +172,7 @@ jobs:
run: |
touch cabal.project
echo "packages: $GITHUB_WORKSPACE/source/effectful-core" >> cabal.project
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "packages: $GITHUB_WORKSPACE/source/effectful-plugin" >> cabal.project ; fi
echo "packages: $GITHUB_WORKSPACE/source/effectful-plugin" >> cabal.project
echo "packages: $GITHUB_WORKSPACE/source/effectful-th" >> cabal.project
echo "packages: $GITHUB_WORKSPACE/source/effectful" >> cabal.project
cat cabal.project
Expand All @@ -218,44 +198,38 @@ jobs:
touch cabal.project
touch cabal.project.local
echo "packages: ${PKGDIR_effectful_core}" >> cabal.project
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "packages: ${PKGDIR_effectful_plugin}" >> cabal.project ; fi
echo "packages: ${PKGDIR_effectful_plugin}" >> cabal.project
echo "packages: ${PKGDIR_effectful_th}" >> cabal.project
echo "packages: ${PKGDIR_effectful}" >> cabal.project
echo "package effectful-core" >> cabal.project
echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "package effectful-plugin" >> cabal.project ; fi
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project ; fi
echo "package effectful-plugin" >> cabal.project
echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project
echo "package effectful-th" >> cabal.project
echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project
echo "package effectful" >> cabal.project
echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "package effectful-core" >> cabal.project ; fi
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo " ghc-options: -Werror=unused-packages" >> cabal.project ; fi
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "package effectful-plugin" >> cabal.project ; fi
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo " ghc-options: -Werror=unused-packages" >> cabal.project ; fi
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "package effectful-th" >> cabal.project ; fi
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo " ghc-options: -Werror=unused-packages" >> cabal.project ; fi
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "package effectful" >> cabal.project ; fi
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo " ghc-options: -Werror=unused-packages" >> cabal.project ; fi
if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo "package effectful-core" >> cabal.project ; fi
if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project ; fi
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "package effectful-plugin" >> cabal.project ; fi
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project ; fi
if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo "package effectful-th" >> cabal.project ; fi
if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project ; fi
if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo "package effectful" >> cabal.project ; fi
if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project ; fi
echo "package effectful-core" >> cabal.project
echo " ghc-options: -Werror=unused-packages" >> cabal.project
echo "package effectful-plugin" >> cabal.project
echo " ghc-options: -Werror=unused-packages" >> cabal.project
echo "package effectful-th" >> cabal.project
echo " ghc-options: -Werror=unused-packages" >> cabal.project
echo "package effectful" >> cabal.project
echo " ghc-options: -Werror=unused-packages" >> cabal.project
echo "package effectful-core" >> cabal.project
echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project
echo "package effectful-plugin" >> cabal.project
echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project
echo "package effectful-th" >> cabal.project
echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project
echo "package effectful" >> cabal.project
echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project
cat >> cabal.project <<EOF
allow-newer: cleff:*
allow-newer: freer-simple:*
allow-newer: fused-effects:*
allow-newer: polysemy:*
allow-newer: async:base
allow-newer: hashable:base
allow-newer: hashable:containers
allow-newer: hashable:ghc-bignum
allow-newer: tagged:template-haskell
allow-newer: th-abstraction:template-haskell

package effectful-core
ghc-options: -Werror
Expand Down Expand Up @@ -298,17 +272,17 @@ jobs:
- name: doctest
run: |
if [ $((HCNUMVER < 91200)) -ne 0 ] ; then cd ${PKGDIR_effectful_core} || false ; fi
if [ $((HCNUMVER < 91200)) -ne 0 ] ; then doctest -XHaskell2010 -XBangPatterns -XConstraintKinds -XDataKinds -XDeriveFunctor -XDeriveGeneric -XDerivingStrategies -XFlexibleContexts -XFlexibleInstances -XGADTs -XGeneralizedNewtypeDeriving -XImportQualifiedPost -XLambdaCase -XMultiParamTypeClasses -XNoStarIsType -XPolyKinds -XRankNTypes -XRoleAnnotations -XScopedTypeVariables -XStandaloneDeriving -XTupleSections -XTypeApplications -XTypeFamilies -XTypeOperators -XUndecidableInstances src ; fi
if [ $((HCNUMVER < 91200)) -ne 0 ] ; then doctest -XHaskell2010 -XBangPatterns -XConstraintKinds -XDataKinds -XDeriveFunctor -XDeriveGeneric -XDerivingStrategies -XFlexibleContexts -XFlexibleInstances -XGADTs -XGeneralizedNewtypeDeriving -XImportQualifiedPost -XLambdaCase -XMultiParamTypeClasses -XNoFieldSelectors -XNoStarIsType -XOverloadedRecordDot -XPolyKinds -XRankNTypes -XRoleAnnotations -XScopedTypeVariables -XStandaloneDeriving -XTupleSections -XTypeApplications -XTypeFamilies -XTypeOperators -XUndecidableInstances src ; fi
if [ $((HCNUMVER < 91200)) -ne 0 ] ; then cd ${PKGDIR_effectful_th} || false ; fi
if [ $((HCNUMVER < 91200)) -ne 0 ] ; then doctest -XHaskell2010 -XBangPatterns -XConstraintKinds -XDataKinds -XDeriveFunctor -XDeriveGeneric -XDerivingStrategies -XFlexibleContexts -XFlexibleInstances -XGADTs -XGeneralizedNewtypeDeriving -XImportQualifiedPost -XLambdaCase -XMultiParamTypeClasses -XNoStarIsType -XPolyKinds -XRankNTypes -XRecordWildCards -XRoleAnnotations -XScopedTypeVariables -XStandaloneDeriving -XTupleSections -XTypeApplications -XTypeFamilies -XTypeOperators -XUndecidableInstances src ; fi
if [ $((HCNUMVER < 91200)) -ne 0 ] ; then doctest -XHaskell2010 -XBangPatterns -XConstraintKinds -XDataKinds -XDeriveFunctor -XDeriveGeneric -XDerivingStrategies -XFlexibleContexts -XFlexibleInstances -XGADTs -XGeneralizedNewtypeDeriving -XImportQualifiedPost -XLambdaCase -XMultiParamTypeClasses -XNoFieldSelectors -XNoStarIsType -XOverloadedRecordDot -XPolyKinds -XRankNTypes -XRecordWildCards -XRoleAnnotations -XScopedTypeVariables -XStandaloneDeriving -XTupleSections -XTypeApplications -XTypeFamilies -XTypeOperators -XUndecidableInstances src ; fi
if [ $((HCNUMVER < 91200)) -ne 0 ] ; then cd ${PKGDIR_effectful} || false ; fi
if [ $((HCNUMVER < 91200)) -ne 0 ] ; then doctest -XHaskell2010 -XBangPatterns -XConstraintKinds -XDataKinds -XDeriveFunctor -XDeriveGeneric -XDerivingStrategies -XFlexibleContexts -XFlexibleInstances -XGADTs -XGeneralizedNewtypeDeriving -XImportQualifiedPost -XLambdaCase -XMultiParamTypeClasses -XNoStarIsType -XPolyKinds -XRankNTypes -XRecordWildCards -XRoleAnnotations -XScopedTypeVariables -XStandaloneDeriving -XTupleSections -XTypeApplications -XTypeFamilies -XTypeOperators -XUndecidableInstances src ; fi
if [ $((HCNUMVER < 91200)) -ne 0 ] ; then doctest -XHaskell2010 -XBangPatterns -XConstraintKinds -XDataKinds -XDeriveFunctor -XDeriveGeneric -XDerivingStrategies -XFlexibleContexts -XFlexibleInstances -XGADTs -XGeneralizedNewtypeDeriving -XImportQualifiedPost -XLambdaCase -XMultiParamTypeClasses -XNoFieldSelectors -XNoStarIsType -XOverloadedRecordDot -XPolyKinds -XRankNTypes -XRecordWildCards -XRoleAnnotations -XScopedTypeVariables -XStandaloneDeriving -XTupleSections -XTypeApplications -XTypeFamilies -XTypeOperators -XUndecidableInstances src ; fi
- name: cabal check
run: |
cd ${PKGDIR_effectful_core} || false
${CABAL} -vnormal check
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then cd ${PKGDIR_effectful_plugin} || false ; fi
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then ${CABAL} -vnormal check ; fi
cd ${PKGDIR_effectful_plugin} || false
${CABAL} -vnormal check
cd ${PKGDIR_effectful_th} || false
${CABAL} -vnormal check
cd ${PKGDIR_effectful} || false
Expand Down
2 changes: 1 addition & 1 deletion cabal.haskell-ci
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ doctest-version: ^>=0.24
tests: True
benchmarks: True

jobs-selection: any
jobs-selection: uniform

installed: -all

Expand Down
9 changes: 1 addition & 8 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,8 @@ packages:
effectful-th/*.cabal
effectful/*.cabal

-- Ignore dependencies of other effect libraries.
-- Ignore dependency bounds of other effect libraries.
allow-newer: cleff:*
, freer-simple:*
, fused-effects:*
, polysemy:*

-- ghc-9.14
allow-newer: *:base
, hashable:containers
, hashable:ghc-bignum
, tagged:template-haskell
, th-abstraction:template-haskell
2 changes: 2 additions & 0 deletions doctest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ run_doctest() {
-XImportQualifiedPost \
-XLambdaCase \
-XMultiParamTypeClasses \
-XNoFieldSelectors \
-XNoStarIsType \
-XOverloadedRecordDot \
-XPolyKinds \
-XRankNTypes \
-XRecordWildCards \
Expand Down
1 change: 1 addition & 0 deletions effectful-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# effectful-core-2.7.0.0 (2026-??-??)
* Drop support for GHC < 9.6.
* Add definitions of `rethrowM` to `MonadThrow` and `catchNoPropagate` to
`MonadCatch` instances for `Eff` when appropriate (`exceptions` >= 0.10.11).

Expand Down
5 changes: 0 additions & 5 deletions effectful-core/cbits/utils.c

This file was deleted.

9 changes: 4 additions & 5 deletions effectful-core/effectful-core.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ extra-source-files:
CHANGELOG.md
README.md

tested-with: GHC == { 8.10.7, 9.0.2, 9.2.8, 9.4.8, 9.6.7, 9.8.4, 9.10.2, 9.12.2, 9.14.1 }
tested-with: GHC == { 9.6.7, 9.8.4, 9.10.2, 9.12.2, 9.14.1 }

bug-reports: https://github.com/haskell-effectful/effectful/issues
source-repository head
Expand Down Expand Up @@ -50,7 +50,9 @@ common language
ImportQualifiedPost
LambdaCase
MultiParamTypeClasses
NoFieldSelectors
NoStarIsType
OverloadedRecordDot
PolyKinds
RankNTypes
RoleAnnotations
Expand All @@ -67,7 +69,7 @@ library

ghc-options: -O2

build-depends: base >= 4.14 && < 5
build-depends: base >= 4.18 && < 5
, containers >= 0.6
, deepseq >= 1.2
, exceptions >= 0.10.4
Expand All @@ -80,9 +82,6 @@ library

hs-source-dirs: src

if impl(ghc < 9)
c-sources: cbits/utils.c

exposed-modules: Effectful
Effectful.Dispatch.Dynamic
Effectful.Dispatch.Static
Expand Down
4 changes: 2 additions & 2 deletions effectful-core/src/Effectful/Dispatch/Dynamic.hs
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ passthrough
-> Eff es a
passthrough (LocalEnv les) op = unsafeEff $ \es -> do
Handler handlerEs (HandlerImpl handler) <- getEnv es
when (envStorage les /= envStorage handlerEs) $ do
when (les.storage /= handlerEs.storage) $ do
error "les and handlerEs point to different Storages"
-- Prevent the addition of unnecessary 'handler' stack frame to the call
-- stack. Note that functions 'interpret', 'reinterpret', 'interpose' and
Expand Down Expand Up @@ -1265,7 +1265,7 @@ copyRefs src@(Env soffset srefs _) dest@(Env doffset drefs storage) = do

requireMatchingStorages :: HasCallStack => Env es1 -> Env es2 -> IO ()
requireMatchingStorages es1 es2
| envStorage es1 /= envStorage es2 = error
| es1.storage /= es2.storage = error
$ "Env and LocalEnv point to different Storages.\n"
++ "If you passed LocalEnv to a different thread and tried to create an "
++ "unlifting function there, it's not allowed. You need to create it in "
Expand Down
1 change: 1 addition & 0 deletions effectful-core/src/Effectful/Dispatch/Static.hs
Original file line number Diff line number Diff line change
Expand Up @@ -214,4 +214,5 @@ unsafeConcUnliftIO persistence limit k = unsafeEff $ \es -> do
concUnliftIO es persistence limit k

-- $setup
-- >>> :seti -XFieldSelectors
-- >>> import Effectful
24 changes: 12 additions & 12 deletions effectful-core/src/Effectful/Internal/Env.hs
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ type role Env nominal
-- - Cloning: /@O(N)@/, where @N@ is the size of the 'Storage'.
--
data Env (es :: [Effect]) = Env
{ envOffset :: !Int
, envRefs :: !(PrimArray Ref)
, envStorage :: !(IORef' Storage)
{ offset :: !Int
, refs :: !(PrimArray Ref)
, storage :: !(IORef' Storage)
}

-- | Reference to the effect in 'Storage'.
Expand Down Expand Up @@ -142,8 +142,8 @@ newtype Version = Version Int

-- | A storage of effects.
data Storage = Storage
{ stVersion :: !Version
, stData :: {-# UNPACK #-} !StorageData
{ version :: !Version
, data_ :: {-# UNPACK #-} !StorageData
}

----------------------------------------
Expand All @@ -170,10 +170,10 @@ fromAnyRelinker (AnyRelinker f) = fromAny f
----------------------------------------

data StorageData = StorageData
{ sdSize :: !Int
, sdVersions :: !(MutablePrimArray RealWorld Version)
, sdEffects :: !(SmallMutableArray RealWorld AnyEffect)
, sdRelinkers :: !(SmallMutableArray RealWorld AnyRelinker)
{ size :: !Int
, versions :: !(MutablePrimArray RealWorld Version)
, effects :: !(SmallMutableArray RealWorld AnyEffect)
, relinkers :: !(SmallMutableArray RealWorld AnyRelinker)
}

-- | Make a shallow copy of the 'StorageData'.
Expand All @@ -200,9 +200,9 @@ copyStorageData (StorageData storageSize vs0 es0 fs0) = do
-- @since 2.5.0.0
restoreStorageData :: HasCallStack => StorageData -> Env es -> IO ()
restoreStorageData newStorageData env = do
modifyIORef' (envStorage env) $ \(Storage version oldStorageData) ->
let oldSize = sdSize oldStorageData
newSize = sdSize newStorageData
modifyIORef' env.storage $ \(Storage version oldStorageData) ->
let oldSize = oldStorageData.size
newSize = newStorageData.size
in if newSize /= oldSize
then error $ "newSize (" ++ show newSize ++ ") /= oldSize (" ++ show oldSize ++ ")"
else Storage version newStorageData
Expand Down
4 changes: 2 additions & 2 deletions effectful-core/src/Effectful/Internal/Monad.hs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ seqUnliftIO es k = do
tid0 <- myThreadId
k $ \m -> do
tid <- myThreadId
if tid `eqThreadId` tid0
if tid == tid0
then unEff m es
else error
$ "If you want to use the unlifting function to run Eff computations "
Expand Down Expand Up @@ -616,7 +616,7 @@ send
-> Eff es a
send op = unsafeEff $ \es -> do
Handler handlerEs (HandlerImpl handler) <- getEnv es
when (envStorage es /= envStorage handlerEs) $ do
when (es.storage /= handlerEs.storage) $ do
error "es and handlerEs point to different Storages"
-- Prevent the addition of unnecessary 'handler' stack frame to the call
-- stack. Note that functions 'interpret', 'reinterpret', 'interpose' and
Expand Down
Loading
Loading