on master help sign in
Split effectful package (#27)
f0bf1e4Mann mit Hut
.github/workflows/haskell-ci.yml+14−6
@@ -1,6 +1,6 @@
1# This GitHub workflow config has been generated by a script via
1# This GitHub workflow config has been generated by a script via
2#
2#
3−# haskell-ci 'github' '--config=cabal.haskell-ci' 'effectful.cabal'
3+# haskell-ci 'github' '--config=cabal.haskell-ci' 'cabal.project'
4#
4#
5# To regenerate the script (for example after adjusting tested-with) run
5# To regenerate the script (for example after adjusting tested-with) run
6#
6#
@@ -10,7 +10,7 @@
10#
10#
11# version: 0.13.20210621
11# version: 0.13.20210621
12#
12#
13−# REGENDATA ("0.13.20210621",["github","--config=cabal.haskell-ci","effectful.cabal"])
13+# REGENDATA ("0.13.20210621",["github","--config=cabal.haskell-ci","cabal.project"])
14#
14#
15name: Haskell-CI
15name: Haskell-CI
16on:
16on:
@@ -170,7 +170,8 @@ jobs:
170 - name: initial cabal.project for sdist
170 - name: initial cabal.project for sdist
171 run: |
171 run: |
172 touch cabal.project
172 touch cabal.project
173− echo "packages: $GITHUB_WORKSPACE/source/." >> cabal.project
173+ echo "packages: $GITHUB_WORKSPACE/source/effectful" >> cabal.project
174+ echo "packages: $GITHUB_WORKSPACE/source/effectful-core" >> cabal.project
174 cat cabal.project
175 cat cabal.project
175 - name: sdist
176 - name: sdist
176 run: |
177 run: |
@@ -184,12 +185,17 @@ jobs:
184 run: |
185 run: |
185 PKGDIR_effectful="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/effectful-[0-9.]*')"
186 PKGDIR_effectful="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/effectful-[0-9.]*')"
186 echo "PKGDIR_effectful=${PKGDIR_effectful}" >> "$GITHUB_ENV"
187 echo "PKGDIR_effectful=${PKGDIR_effectful}" >> "$GITHUB_ENV"
188+ PKGDIR_effectful_core="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/effectful-core-[0-9.]*')"
189+ echo "PKGDIR_effectful_core=${PKGDIR_effectful_core}" >> "$GITHUB_ENV"
187 rm -f cabal.project cabal.project.local
190 rm -f cabal.project cabal.project.local
188 touch cabal.project
191 touch cabal.project
189 touch cabal.project.local
192 touch cabal.project.local
190 echo "packages: ${PKGDIR_effectful}" >> cabal.project
193 echo "packages: ${PKGDIR_effectful}" >> cabal.project
194+ echo "packages: ${PKGDIR_effectful_core}" >> cabal.project
191 echo "package effectful" >> cabal.project
195 echo "package effectful" >> cabal.project
192 echo " ghc-options: -Werror=missing-methods" >> cabal.project
196 echo " ghc-options: -Werror=missing-methods" >> cabal.project
197+ echo "package effectful-core" >> cabal.project
198+ echo " ghc-options: -Werror=missing-methods" >> cabal.project
193 cat >> cabal.project <<EOF
199 cat >> cabal.project <<EOF
194 package effectful
200 package effectful
195 flags: +benchmark-foreign-libraries
201 flags: +benchmark-foreign-libraries
@@ -197,7 +203,7 @@ jobs:
197 if $HEADHACKAGE; then
203 if $HEADHACKAGE; then
198 echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1,/g')" >> cabal.project
204 echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1,/g')" >> cabal.project
199 fi
205 fi
200− $HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(effectful)$/; }' >> cabal.project.local
206+ $HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(effectful|effectful-core)$/; }' >> cabal.project.local
201 cat cabal.project
207 cat cabal.project
202 cat cabal.project.local
208 cat cabal.project.local
203 - name: dump install plan
209 - name: dump install plan
@@ -227,12 +233,14 @@ jobs:
227 run: |
233 run: |
228 if [ $((HCNUMVER < 90200)) -ne 0 ] ; then cd ${PKGDIR_effectful} || false ; fi
234 if [ $((HCNUMVER < 90200)) -ne 0 ] ; then cd ${PKGDIR_effectful} || false ; fi
229 if [ $((HCNUMVER < 90200)) -ne 0 ] ; then doctest -XBangPatterns -XConstraintKinds -XDataKinds -XDeriveFunctor -XFlexibleContexts -XFlexibleInstances -XGADTs -XGeneralizedNewtypeDeriving -XLambdaCase -XMultiParamTypeClasses -XNoStarIsType -XRankNTypes -XRecordWildCards -XRoleAnnotations -XScopedTypeVariables -XStandaloneDeriving -XStrictData -XTupleSections -XTypeApplications -XTypeFamilies -XTypeOperators src ; fi
235 if [ $((HCNUMVER < 90200)) -ne 0 ] ; then doctest -XBangPatterns -XConstraintKinds -XDataKinds -XDeriveFunctor -XFlexibleContexts -XFlexibleInstances -XGADTs -XGeneralizedNewtypeDeriving -XLambdaCase -XMultiParamTypeClasses -XNoStarIsType -XRankNTypes -XRecordWildCards -XRoleAnnotations -XScopedTypeVariables -XStandaloneDeriving -XStrictData -XTupleSections -XTypeApplications -XTypeFamilies -XTypeOperators src ; fi
230− if [ $((HCNUMVER < 90200)) -ne 0 ] ; then cd ${PKGDIR_effectful} || false ; fi
236+ if [ $((HCNUMVER < 90200)) -ne 0 ] ; then cd ${PKGDIR_effectful_core} || false ; fi
231− if [ $((HCNUMVER < 90200)) -ne 0 ] ; then doctest -XBangPatterns -XConstraintKinds -XDataKinds -XDeriveFunctor -XFlexibleContexts -XFlexibleInstances -XGADTs -XGeneralizedNewtypeDeriving -XLambdaCase -XMultiParamTypeClasses -XNoStarIsType -XRankNTypes -XRecordWildCards -XRoleAnnotations -XScopedTypeVariables -XStandaloneDeriving -XStrictData -XTupleSections -XTypeApplications -XTypeFamilies -XTypeOperators utils ; fi
237+ if [ $((HCNUMVER < 90200)) -ne 0 ] ; then doctest -XBangPatterns -XConstraintKinds -XDataKinds -XDeriveFunctor -XFlexibleContexts -XFlexibleInstances -XGADTs -XGeneralizedNewtypeDeriving -XLambdaCase -XMultiParamTypeClasses -XNoStarIsType -XRankNTypes -XRecordWildCards -XRoleAnnotations -XScopedTypeVariables -XStandaloneDeriving -XStrictData -XTupleSections -XTypeApplications -XTypeFamilies -XTypeOperators src ; fi
232 - name: cabal check
238 - name: cabal check
233 run: |
239 run: |
234 cd ${PKGDIR_effectful} || false
240 cd ${PKGDIR_effectful} || false
235 ${CABAL} -vnormal check
241 ${CABAL} -vnormal check
242+ cd ${PKGDIR_effectful_core} || false
243+ ${CABAL} -vnormal check
236 - name: haddock
244 - name: haddock
237 run: |
245 run: |
238 $CABAL v2-haddock $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
246 $CABAL v2-haddock $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
README.md+15−1
@@ -100,11 +100,25 @@ to "boring" transformer stacks, most of which are a dozen of newtype'd `StateT`
100or `ReaderT` transformers, each with a few associated operations (usually tied
100or `ReaderT` transformers, each with a few associated operations (usually tied
101to a type class), not to replace monad transformers altogether.
101to a type class), not to replace monad transformers altogether.
102
102
103+## Usage
104+
105+The effect system and its effects are split among several libraries:
106+
107+- The `effectful-core` library contains the main machinery of the effect system
108+ itself and a few basic effects.
109+ It aims for a small dependency footprint and provides the building blocks for
110+ more advanced effects.
111+
112+- _TBD_ `effectful-resource`, `effectful-process`, ...
113+
114+- Finally, the `effectful` library which comes with 'batteries included'. It is
115+ build on top of the other libraries and re-exports the functionality of those.
116+
103## Example
117## Example
104
118
105A `Filesystem` effect with two handlers, one that runs in `IO` and another that
119A `Filesystem` effect with two handlers, one that runs in `IO` and another that
106uses an in-memory virtual file system can be found
120uses an in-memory virtual file system can be found
107−[here](https://github.com/arybczak/effectful/blob/master/examples/FileSystem.hs).
121+[here](https://github.com/arybczak/effectful/blob/master/effectful/examples/FileSystem.hs).
108
122
109## Resources
123## Resources
110
124
cabal.projectnew file+3
@@ -0,0 +1,3 @@
1+packages:
2+ effectful/effectful.cabal
3+ effectful-core/effectful-core.cabal
doctest.sh+32−22
@@ -7,25 +7,35 @@
7# - Compile doctest with the same GHC version the project currently uses.
7# - Compile doctest with the same GHC version the project currently uses.
8#
8#
9
9
10+set -eu
11+
12+run_doctest() {
13+ pushd "${1}"
10−doctest src \
14+ doctest \
15+ "${2}" \
11− -XBangPatterns \
16+ -XBangPatterns \
12− -XConstraintKinds \
17+ -XConstraintKinds \
13− -XDataKinds \
18+ -XDataKinds \
14− -XDeriveFunctor \
19+ -XDeriveFunctor \
15− -XFlexibleContexts \
20+ -XFlexibleContexts \
16− -XFlexibleInstances \
21+ -XFlexibleInstances \
17− -XGADTs \
22+ -XGADTs \
18− -XGeneralizedNewtypeDeriving \
23+ -XGeneralizedNewtypeDeriving \
19− -XLambdaCase \
24+ -XLambdaCase \
20− -XMultiParamTypeClasses \
25+ -XMultiParamTypeClasses \
21− -XNoStarIsType \
26+ -XNoStarIsType \
22− -XRankNTypes \
27+ -XRankNTypes \
23− -XRecordWildCards \
28+ -XRecordWildCards \
24− -XRoleAnnotations \
29+ -XRoleAnnotations \
25− -XScopedTypeVariables \
30+ -XScopedTypeVariables \
26− -XStandaloneDeriving \
31+ -XStandaloneDeriving \
27− -XStrictData \
32+ -XStrictData \
28− -XTupleSections \
33+ -XTupleSections \
29− -XTypeApplications \
34+ -XTypeApplications \
30− -XTypeFamilies \
35+ -XTypeFamilies \
31− -XTypeOperators
36+ -XTypeOperators
37+ popd
38+}
39+
40+run_doctest effectful src
41+run_doctest effectful-core src
effectful-core/CHANGELOG.mdnew file+2
@@ -0,0 +1,2 @@
1+# effectful-core-0.0.0.0 (2021-06-13)
2+* Initial alpha release.
effectful-core/LICENSEnew file+30
@@ -0,0 +1,30 @@
1+Copyright (c) 2021, Andrzej Rybczak
2+
3+All rights reserved.
4+
5+Redistribution and use in source and binary forms, with or without
6+modification, are permitted provided that the following conditions are met:
7+
8+ * Redistributions of source code must retain the above copyright
9+ notice, this list of conditions and the following disclaimer.
10+
11+ * Redistributions in binary form must reproduce the above
12+ copyright notice, this list of conditions and the following
13+ disclaimer in the documentation and/or other materials provided
14+ with the distribution.
15+
16+ * Neither the name of Andrzej Rybczak nor the names of other
17+ contributors may be used to endorse or promote products derived
18+ from this software without specific prior written permission.
19+
20+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
effectful-core/effectful-core.cabalnew file+100
@@ -0,0 +1,100 @@
1+cabal-version: 2.4
2+build-type: Simple
3+name: effectful-core
4+version: 0.0.0.0
5+license: BSD-3-Clause
6+license-file: LICENSE
7+category: Control
8+maintainer: andrzej@rybczak.net
9+author: Andrzej Rybczak
10+synopsis: An easy to use, performant extensible effects library.
11+
12+description: An easy to use, performant extensible effects library with seamless
13+ integration with the existing Haskell ecosystem.
14+ .
15+ This library provides the core of the effect system and is quiet
16+ minimal. If you look for something more sophisticated have a look
17+ at the @<https://hackage.haskell.org/package/effectful effectful>@
18+ package.
19+
20+extra-source-files: CHANGELOG.md
21+
22+tested-with: GHC ==8.8.4 || ==8.10.4 || ==9.0.1 || ==9.2.0.20210422
23+
24+bug-reports: https://github.com/arybczak/effectful/issues
25+source-repository head
26+ type: git
27+ location: https://github.com/arybczak/effectful.git
28+
29+common language
30+ ghc-options: -Wall -Wcompat
31+
32+ default-language: Haskell2010
33+
34+ default-extensions: BangPatterns
35+ ConstraintKinds
36+ DataKinds
37+ DeriveFunctor
38+ FlexibleContexts
39+ FlexibleInstances
40+ GADTs
41+ GeneralizedNewtypeDeriving
42+ LambdaCase
43+ MultiParamTypeClasses
44+ NoStarIsType
45+ RankNTypes
46+ RecordWildCards
47+ RoleAnnotations
48+ ScopedTypeVariables
49+ StandaloneDeriving
50+ StrictData
51+ TupleSections
52+ TypeApplications
53+ TypeFamilies
54+ TypeOperators
55+
56+library effectful-internal-utils
57+ import: language
58+
59+ build-depends: base
60+
61+ hs-source-dirs: utils
62+ c-sources: utils/utils.c
63+
64+ exposed-modules: Effectful.Internal.Utils
65+
66+library
67+ import: language
68+
69+ ghc-options: -O2
70+
71+ build-depends: base >= 4.13 && <5
72+ , containers
73+ , effectful-internal-utils
74+ , exceptions
75+ , monad-control
76+ , primitive
77+ , transformers-base
78+ , unliftio-core
79+
80+ hs-source-dirs: src
81+
82+ exposed-modules: Effectful.Error
83+ Effectful.Error.Dynamic
84+ Effectful.Fail
85+ Effectful.Handler
86+ Effectful.Internal.Effect
87+ Effectful.Internal.Env
88+ Effectful.Internal.Monad
89+ Effectful.Internal.Unlift
90+ Effectful.Monad
91+ Effectful.Reader
92+ Effectful.Reader.Dynamic
93+ Effectful.State.Dynamic
94+ Effectful.State.Local
95+ Effectful.State.Shared
96+ Effectful.Writer.Dynamic
97+ Effectful.Writer.Local
98+ Effectful.Writer.Shared
99+
100+ reexported-modules: Effectful.Internal.Utils
src/Effectful/Error.hs → effectful-core/src/Effectful/Error.hsrenamed

The content is the same.

src/Effectful/Error/Dynamic.hs → effectful-core/src/Effectful/Error/Dynamic.hsrenamed

The content is the same.

src/Effectful/Fail.hs → effectful-core/src/Effectful/Fail.hsrenamed

The content is the same.

src/Effectful/Handler.hs → effectful-core/src/Effectful/Handler.hsrenamed−1
@@ -267,4 +267,3 @@ localLiftUnliftIO (LocalEnv les) strategy k = case strategy of
267
267
268-- $setup
268-- $setup
269-- >>> import Control.Concurrent
269-- >>> import Control.Concurrent
270−-- >>> import Effectful
src/Effectful/Internal/Effect.hs → effectful-core/src/Effectful/Internal/Effect.hsrenamed

The content is the same.

src/Effectful/Internal/Env.hs → effectful-core/src/Effectful/Internal/Env.hsrenamed

The content is the same.

src/Effectful/Internal/Monad.hs → effectful-core/src/Effectful/Internal/Monad.hsrenamed

The content is the same.

src/Effectful/Internal/Unlift.hs → effectful-core/src/Effectful/Internal/Unlift.hsrenamed

The content is the same.

src/Effectful/Monad.hs → effectful-core/src/Effectful/Monad.hsrenamed

The content is the same.

src/Effectful/Reader.hs → effectful-core/src/Effectful/Reader.hsrenamed

The content is the same.

src/Effectful/Reader/Dynamic.hs → effectful-core/src/Effectful/Reader/Dynamic.hsrenamed

The content is the same.

src/Effectful/State/Dynamic.hs → effectful-core/src/Effectful/State/Dynamic.hsrenamed

The content is the same.

src/Effectful/State/Local.hs → effectful-core/src/Effectful/State/Local.hsrenamed

The content is the same.

src/Effectful/State/Shared.hs → effectful-core/src/Effectful/State/Shared.hsrenamed

The content is the same.

src/Effectful/Writer/Dynamic.hs → effectful-core/src/Effectful/Writer/Dynamic.hsrenamed

The content is the same.

src/Effectful/Writer/Local.hs → effectful-core/src/Effectful/Writer/Local.hsrenamed

The content is the same.

src/Effectful/Writer/Shared.hs → effectful-core/src/Effectful/Writer/Shared.hsrenamed

The content is the same.

utils/Effectful/Internal/Utils.hs → effectful-core/utils/Effectful/Internal/Utils.hsrenamed

The content is the same.

utils/utils.c → effectful-core/utils/utils.crenamed

The content is the same.

effectful/CHANGELOG.mdnew file+2
@@ -0,0 +1,2 @@
1+# effectful-0.0.0.0 (2021-06-13)
2+* Initial alpha release.
effectful/LICENSEnew file+30
@@ -0,0 +1,30 @@
1+Copyright (c) 2021, Andrzej Rybczak
2+
3+All rights reserved.
4+
5+Redistribution and use in source and binary forms, with or without
6+modification, are permitted provided that the following conditions are met:
7+
8+ * Redistributions of source code must retain the above copyright
9+ notice, this list of conditions and the following disclaimer.
10+
11+ * Redistributions in binary form must reproduce the above
12+ copyright notice, this list of conditions and the following
13+ disclaimer in the documentation and/or other materials provided
14+ with the distribution.
15+
16+ * Neither the name of Andrzej Rybczak nor the names of other
17+ contributors may be used to endorse or promote products derived
18+ from this software without specific prior written permission.
19+
20+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
bench/Concurrency.hs → effectful/bench/Concurrency.hsrenamed

The content is the same.

bench/Countdown.hs → effectful/bench/Countdown.hsrenamed

The content is the same.

bench/FileSizes.hs → effectful/bench/FileSizes.hsrenamed

The content is the same.

bench/Main.hs → effectful/bench/Main.hsrenamed

The content is the same.

bench/Unlift.hs → effectful/bench/Unlift.hsrenamed

The content is the same.

bench/Utils.hs → effectful/bench/Utils.hsrenamed

The content is the same.

effectful.cabal → effectful/effectful.cabalrenamed+28−37
@@ -11,9 +11,13 @@ synopsis: An easy to use, performant extensible effects library.
11
11
12description: An easy to use, performant extensible effects library with seamless
12description: An easy to use, performant extensible effects library with seamless
13 integration with the existing Haskell ecosystem.
13 integration with the existing Haskell ecosystem.
14+ .
15+ This is the "batteries included" variant; See the
16+ @<https://hackage.haskell.org/package/effectful-core effectful-core>@
17+ package for the effect system itself as well as the various other
18+ @effectful-*@ packages if you need a smaller dependency footprint.
14
19
15extra-source-files: CHANGELOG.md
20extra-source-files: CHANGELOG.md
16− README.md
17
21
18tested-with: GHC ==8.8.4 || ==8.10.4 || ==9.0.1 || ==9.2.0.20210422
22tested-with: GHC ==8.8.4 || ==8.10.4 || ==9.0.1 || ==9.2.0.20210422
19
23
@@ -53,16 +57,6 @@ common language
53 TypeFamilies
57 TypeFamilies
54 TypeOperators
58 TypeOperators
55
59
56−library effectful-internal-utils
57− import: language
58−
59− build-depends: base
60−
61− hs-source-dirs: utils
62− c-sources: utils/utils.c
63−
64− exposed-modules: Effectful.Internal.Utils
65−
66library
60library
67 import: language
61 import: language
68
62
@@ -70,40 +64,34 @@ library
70
64
71 build-depends: base >= 4.13 && <5
65 build-depends: base >= 4.13 && <5
72 , async
66 , async
73− , containers
74− , effectful-internal-utils
67+ , effectful-core
75− , exceptions
76− , monad-control
77− , primitive
78 , resourcet
68 , resourcet
79− , transformers-base
80− , unliftio-core
81 , unliftio
69 , unliftio
82
70
83 hs-source-dirs: src
71 hs-source-dirs: src
84
72
85 exposed-modules: Effectful
73 exposed-modules: Effectful
86 Effectful.Async
74 Effectful.Async
87− Effectful.Error
88− Effectful.Error.Dynamic
89− Effectful.Fail
90− Effectful.Handler
91− Effectful.Internal.Effect
92− Effectful.Internal.Env
93− Effectful.Internal.Monad
94− Effectful.Internal.Unlift
95− Effectful.Monad
96− Effectful.Reader
97− Effectful.Reader.Dynamic
98 Effectful.Resource
75 Effectful.Resource
99− Effectful.State.Dynamic
100− Effectful.State.Local
101− Effectful.State.Shared
102− Effectful.Writer.Dynamic
103− Effectful.Writer.Local
104− Effectful.Writer.Shared
105
76
77+ reexported-modules: Effectful.Error
78+ , Effectful.Error.Dynamic
79+ , Effectful.Fail
80+ , Effectful.Handler
81+ , Effectful.Internal.Effect
82+ , Effectful.Internal.Env
83+ , Effectful.Internal.Monad
84+ , Effectful.Internal.Unlift
106− reexported-modules: Effectful.Internal.Utils
85+ , Effectful.Internal.Utils
86+ , Effectful.Monad
87+ , Effectful.Reader
88+ , Effectful.Reader.Dynamic
89+ , Effectful.State.Dynamic
90+ , Effectful.State.Local
91+ , Effectful.State.Shared
92+ , Effectful.Writer.Dynamic
93+ , Effectful.Writer.Local
94+ , Effectful.Writer.Shared
107
95
108test-suite test
96test-suite test
109 import: language
97 import: language
@@ -119,7 +107,7 @@ test-suite test
119 , tasty-hunit
107 , tasty-hunit
120 , unliftio
108 , unliftio
121
109
122− hs-source-dirs: tests
110+ hs-source-dirs: tests examples
123
111
124 type: exitcode-stdio-1.0
112 type: exitcode-stdio-1.0
125 main-is: Main.hs
113 main-is: Main.hs
@@ -129,6 +117,9 @@ test-suite test
129 ErrorTests
117 ErrorTests
130 StateTests
118 StateTests
131 Utils
119 Utils
120+ -- These are examples; We do not actually run them but list
121+ -- them here in order to check if they compile.
122+ FileSystem
132
123
133benchmark bench
124benchmark bench
134 import: language
125 import: language
examples/FileSystem.hs → effectful/examples/FileSystem.hsrenamed+2−2
@@ -44,7 +44,7 @@ runFileSystemIO
44 :: (IOE :> es, Error FsError :> es)
44 :: (IOE :> es, Error FsError :> es)
45 => Eff (FileSystem : es) a
45 => Eff (FileSystem : es) a
46 -> Eff es a
46 -> Eff es a
47−runFileSystemIO = interpret $ \case
47+runFileSystemIO = interpret $ \_ -> \case
48 ReadFile path -> adapt $ IO.readFile path
48 ReadFile path -> adapt $ IO.readFile path
49 WriteFile path contents -> adapt $ IO.writeFile path contents
49 WriteFile path contents -> adapt $ IO.writeFile path contents
50 where
50 where
@@ -55,7 +55,7 @@ runFileSystemPure
55 => M.Map FilePath String
55 => M.Map FilePath String
56 -> Eff (FileSystem : es) a
56 -> Eff (FileSystem : es) a
57 -> Eff es a
57 -> Eff es a
58−runFileSystemPure fs0 = reinterpret (evalState fs0) $ \case
58+runFileSystemPure fs0 = reinterpret (evalState fs0) $ \_ -> \case
59 ReadFile path -> gets (M.lookup path) >>= \case
59 ReadFile path -> gets (M.lookup path) >>= \case
60 Just contents -> pure contents
60 Just contents -> pure contents
61 Nothing -> throwError . FsError $ "File not found: " ++ show path
61 Nothing -> throwError . FsError $ "File not found: " ++ show path
src/Effectful.hs → effectful/src/Effectful.hsrenamed

The content is the same.

src/Effectful/Async.hs → effectful/src/Effectful/Async.hsrenamed

The content is the same.

src/Effectful/Resource.hs → effectful/src/Effectful/Resource.hsrenamed

The content is the same.

tests/AsyncTests.hs → effectful/tests/AsyncTests.hsrenamed

The content is the same.

tests/ConcurrencyTests.hs → effectful/tests/ConcurrencyTests.hsrenamed

The content is the same.

tests/ErrorTests.hs → effectful/tests/ErrorTests.hsrenamed

The content is the same.

tests/Main.hs → effectful/tests/Main.hsrenamed

The content is the same.

tests/StateTests.hs → effectful/tests/StateTests.hsrenamed

The content is the same.

tests/Utils.hs → effectful/tests/Utils.hsrenamed

The content is the same.