on master help sign in
Change name to effectful
36b5a1fAndrzej Rybczak
CHANGELOG.md+1−1
@@ -1,2 +1,2 @@
1−# effective-0.0.0.0 (2021-06-12)
1+# effectful-0.0.0.0 (2021-06-13)
2* Initial alpha release.
2* Initial alpha release.
README.md+12−12
@@ -1,12 +1,12 @@
1−# effective
1+# effectful
2
2
3−[![Build Status](https://github.com/arybczak/effective/workflows/Haskell-CI/badge.svg?branch=master)](https://github.com/arybczak/effective/actions?query=branch%3Amaster)
3+[![Build Status](https://github.com/arybczak/effectful/workflows/Haskell-CI/badge.svg?branch=master)](https://github.com/arybczak/effectful/actions?query=branch%3Amaster)
4−[![Hackage](https://img.shields.io/hackage/v/effective.svg)](https://hackage.haskell.org/package/effective)
4+[![Hackage](https://img.shields.io/hackage/v/effectful.svg)](https://hackage.haskell.org/package/effectful)
5
5
6*Note:* this is a pre-release.
6*Note:* this is a pre-release.
7
7
8−A performant, easy to reason about extensible effects library with seamless
8+A simple, performant extensible effects library with seamless integration with
9−integration with the existing Haskell ecosystem.
9+the existing ecosystem.
10
10
11Main features:
11Main features:
12
12
@@ -36,10 +36,10 @@ Do we really need yet another library for handling effects? There's
36[polysemy](https://hackage.haskell.org/package/polysemy),
36[polysemy](https://hackage.haskell.org/package/polysemy),
37[eff](https://github.com/hasura/eff) and probably a few more.
37[eff](https://github.com/hasura/eff) and probably a few more.
38
38
39−Unfortunately, of all of them only `eff` is a promising proposition because
39+Unfortunately, of all of them only `eff` is a promising proposition because of
40−of reasonable performance characteristics (see the talk "Effects for Less"
40+reasonable performance characteristics (see the talk "Effects for Less" linked
41−linked below for more information) and potential for good interoperability with
41+below for more information) and potential for good interoperability with the
42−the existing ecosystem.
42+existing ecosystem.
43
43
44The second point is arguably the most important, because it allows focusing on
44The second point is arguably the most important, because it allows focusing on
45things that matter instead of reinventing all kinds of wheels and is crucial for
45things that matter instead of reinventing all kinds of wheels and is crucial for
@@ -69,7 +69,7 @@ dedicated, well established solution such as
69[list-t](https://hackage.haskell.org/package/list-t) or
69[list-t](https://hackage.haskell.org/package/list-t) or
70[logict](https://hackage.haskell.org/package/logict) can be used.
70[logict](https://hackage.haskell.org/package/logict) can be used.
71
71
72−This is where `effective` comes in. The `Eff` monad it uses is essentially a
72+This is where `effectful` comes in. The `Eff` monad it uses is essentially a
73`ReaderT` over `IO` on steroids, allowing us to dynamically extend its
73`ReaderT` over `IO` on steroids, allowing us to dynamically extend its
74environment with data types that represent effects.
74environment with data types that represent effects.
75
75
@@ -93,7 +93,7 @@ What is more:
93- If an advanced effect with non-linear control flow is needed, you can always
93- If an advanced effect with non-linear control flow is needed, you can always
94 stick a transformer that implements it on top of `Eff` in a local context.
94 stick a transformer that implements it on top of `Eff` in a local context.
95
95
96−In conclusion, `effective` aims to reduce duplication and bring back performance
96+In conclusion, `effectful` aims to reduce duplication and bring back performance
97to "boring" transformer stacks, most of which are a dozen of newtype'd `StateT`
97to "boring" transformer stacks, most of which are a dozen of newtype'd `StateT`
98or `ReaderT` transformers, each with a few associated operations (usually tied
98or `ReaderT` transformers, each with a few associated operations (usually tied
99to a type class), not to replace monad transformers altogether.
99to a type class), not to replace monad transformers altogether.
@@ -102,7 +102,7 @@ to a type class), not to replace monad transformers altogether.
102
102
103A `Filesystem` effect with two handlers, one that runs in `IO` and another that
103A `Filesystem` effect with two handlers, one that runs in `IO` and another that
104uses an in-memory virtual file system can be found
104uses an in-memory virtual file system can be found
105−[here](https://github.com/arybczak/effective/blob/master/examples/FileSystem.hs).
105+[here](https://github.com/arybczak/effectful/blob/master/examples/FileSystem.hs).
106
106
107## Resources
107## Resources
108
108
bench/Countdown.hs+41−41
@@ -8,12 +8,12 @@ import Data.Functor.Identity
8import qualified Control.Effect as L
8import qualified Control.Effect as L
9#endif
9#endif
10
10
11−-- effective
11+-- effectful
12−import qualified Effective as E
12+import qualified Effectful as E
13−import qualified Effective.Reader as E
13+import qualified Effectful.Reader as E
14−import qualified Effective.State as E
14+import qualified Effectful.State as E
15−import qualified Effective.State.MVar as ME
15+import qualified Effectful.State.MVar as ME
16−import qualified Effective.State.Dynamic as DE
16+import qualified Effectful.State.Dynamic as DE
17
17
18-- freer-simple
18-- freer-simple
19#ifdef VERSION_freer_simple
19#ifdef VERSION_freer_simple
@@ -73,89 +73,89 @@ countdownMtlDeep n = runIdentity
73 runR = flip M.runReaderT ()
73 runR = flip M.runReaderT ()
74
74
75----------------------------------------
75----------------------------------------
76−-- effective (pure)
76+-- effectful (pure)
77
77
78−programEffectiveStatic :: E.State Integer E.:> es => E.Eff es Integer
78+programEffectfulStatic :: E.State Integer E.:> es => E.Eff es Integer
79−programEffectiveStatic = do
79+programEffectfulStatic = do
80 n <- E.get @Integer
80 n <- E.get @Integer
81 if n <= 0
81 if n <= 0
82 then pure n
82 then pure n
83 else do
83 else do
84 E.put (n - 1)
84 E.put (n - 1)
85− programEffectiveStatic
85+ programEffectfulStatic
86−{-# NOINLINE programEffectiveStatic #-}
86+{-# NOINLINE programEffectfulStatic #-}
87
87
88−countdownEffectiveStatic :: Integer -> IO (Integer, Integer)
88+countdownEffectfulStatic :: Integer -> IO (Integer, Integer)
89−countdownEffectiveStatic n = E.runEff . E.runState n $ programEffectiveStatic
89+countdownEffectfulStatic n = E.runEff . E.runState n $ programEffectfulStatic
90
90
91−countdownEffectiveStaticDeep :: Integer -> IO (Integer, Integer)
91+countdownEffectfulStaticDeep :: Integer -> IO (Integer, Integer)
92−countdownEffectiveStaticDeep n = E.runEff
92+countdownEffectfulStaticDeep n = E.runEff
93 . runR . runR . runR . runR . runR . runR . runR . runR . runR . runR
93 . runR . runR . runR . runR . runR . runR . runR . runR . runR . runR
94 . E.runState n
94 . E.runState n
95 . runR . runR . runR . runR . runR . runR . runR . runR . runR . runR
95 . runR . runR . runR . runR . runR . runR . runR . runR . runR . runR
96− $ programEffectiveStatic
96+ $ programEffectfulStatic
97 where
97 where
98 runR = E.runReader ()
98 runR = E.runReader ()
99
99
100----------------------------------------
100----------------------------------------
101−-- effective (mvar)
101+-- effectful (mvar)
102
102
103−programEffectiveMVar :: ME.State Integer E.:> es => E.Eff es Integer
103+programEffectfulMVar :: ME.State Integer E.:> es => E.Eff es Integer
104−programEffectiveMVar = do
104+programEffectfulMVar = do
105 n <- ME.get @Integer
105 n <- ME.get @Integer
106 if n <= 0
106 if n <= 0
107 then pure n
107 then pure n
108 else do
108 else do
109 ME.put (n - 1)
109 ME.put (n - 1)
110− programEffectiveMVar
110+ programEffectfulMVar
111−{-# NOINLINE programEffectiveMVar #-}
111+{-# NOINLINE programEffectfulMVar #-}
112
112
113−countdownEffectiveMVar :: Integer -> IO (Integer, Integer)
113+countdownEffectfulMVar :: Integer -> IO (Integer, Integer)
114−countdownEffectiveMVar n = E.runEff . ME.runState n $ programEffectiveMVar
114+countdownEffectfulMVar n = E.runEff . ME.runState n $ programEffectfulMVar
115
115
116−countdownEffectiveMVarDeep :: Integer -> IO (Integer, Integer)
116+countdownEffectfulMVarDeep :: Integer -> IO (Integer, Integer)
117−countdownEffectiveMVarDeep n = E.runEff
117+countdownEffectfulMVarDeep n = E.runEff
118 . runR . runR . runR . runR . runR . runR . runR . runR . runR . runR
118 . runR . runR . runR . runR . runR . runR . runR . runR . runR . runR
119 . ME.runState n
119 . ME.runState n
120 . runR . runR . runR . runR . runR . runR . runR . runR . runR . runR
120 . runR . runR . runR . runR . runR . runR . runR . runR . runR . runR
121− $ programEffectiveMVar
121+ $ programEffectfulMVar
122 where
122 where
123 runR = E.runReader ()
123 runR = E.runReader ()
124
124
125----------------------------------------
125----------------------------------------
126−-- effective (dynamic)
126+-- effectful (dynamic)
127
127
128−programEffectiveDynamic :: DE.State Integer E.:> es => E.Eff es Integer
128+programEffectfulDynamic :: DE.State Integer E.:> es => E.Eff es Integer
129−programEffectiveDynamic = do
129+programEffectfulDynamic = do
130 n <- DE.get @Integer
130 n <- DE.get @Integer
131 if n <= 0
131 if n <= 0
132 then pure n
132 then pure n
133 else do
133 else do
134 DE.put (n - 1)
134 DE.put (n - 1)
135− programEffectiveDynamic
135+ programEffectfulDynamic
136−{-# NOINLINE programEffectiveDynamic #-}
136+{-# NOINLINE programEffectfulDynamic #-}
137
137
138−countdownEffectiveDynPure :: Integer -> IO (Integer, Integer)
138+countdownEffectfulDynPure :: Integer -> IO (Integer, Integer)
139−countdownEffectiveDynPure n = E.runEff . DE.runState n $ programEffectiveDynamic
139+countdownEffectfulDynPure n = E.runEff . DE.runState n $ programEffectfulDynamic
140
140
141−countdownEffectiveDynMVar :: Integer -> IO (Integer, Integer)
141+countdownEffectfulDynMVar :: Integer -> IO (Integer, Integer)
142−countdownEffectiveDynMVar n = E.runEff . DE.runStateMVar n $ programEffectiveDynamic
142+countdownEffectfulDynMVar n = E.runEff . DE.runStateMVar n $ programEffectfulDynamic
143
143
144−countdownEffectiveDynPureDeep :: Integer -> IO (Integer, Integer)
144+countdownEffectfulDynPureDeep :: Integer -> IO (Integer, Integer)
145−countdownEffectiveDynPureDeep n = E.runEff
145+countdownEffectfulDynPureDeep n = E.runEff
146 . runR . runR . runR . runR . runR . runR . runR . runR . runR . runR
146 . runR . runR . runR . runR . runR . runR . runR . runR . runR . runR
147 . DE.runState n
147 . DE.runState n
148 . runR . runR . runR . runR . runR . runR . runR . runR . runR . runR
148 . runR . runR . runR . runR . runR . runR . runR . runR . runR . runR
149− $ programEffectiveDynamic
149+ $ programEffectfulDynamic
150 where
150 where
151 runR = E.runReader ()
151 runR = E.runReader ()
152
152
153−countdownEffectiveDynMVarDeep :: Integer -> IO (Integer, Integer)
153+countdownEffectfulDynMVarDeep :: Integer -> IO (Integer, Integer)
154−countdownEffectiveDynMVarDeep n = E.runEff
154+countdownEffectfulDynMVarDeep n = E.runEff
155 . runR . runR . runR . runR . runR . runR . runR . runR . runR . runR
155 . runR . runR . runR . runR . runR . runR . runR . runR . runR . runR
156 . DE.runStateMVar n
156 . DE.runStateMVar n
157 . runR . runR . runR . runR . runR . runR . runR . runR . runR . runR
157 . runR . runR . runR . runR . runR . runR . runR . runR . runR . runR
158− $ programEffectiveDynamic
158+ $ programEffectfulDynamic
159 where
159 where
160 runR = E.runReader ()
160 runR = E.runReader ()
161
161
bench/Main.hs+8−8
@@ -10,10 +10,10 @@ main = defaultMain
10 [ bgroup "countdown"
10 [ bgroup "countdown"
11 [ bgroup "reference" $ mkCountdown nf countdownRef
11 [ bgroup "reference" $ mkCountdown nf countdownRef
12 , bgroup "shallow"
12 , bgroup "shallow"
13− [ bgroup "effective (SP)" $ mkCountdown nfAppIO countdownEffectiveStatic
13+ [ bgroup "efectful (SP)" $ mkCountdown nfAppIO countdownEffectfulStatic
14− , bgroup "effective (SM)" $ mkCountdown nfAppIO countdownEffectiveMVar
14+ , bgroup "efectful (SM)" $ mkCountdown nfAppIO countdownEffectfulMVar
15− , bgroup "effective (DP)" $ mkCountdown nfAppIO countdownEffectiveDynPure
15+ , bgroup "efectful (DP)" $ mkCountdown nfAppIO countdownEffectfulDynPure
16− , bgroup "effective (DM)" $ mkCountdown nfAppIO countdownEffectiveDynMVar
16+ , bgroup "efectful (DM)" $ mkCountdown nfAppIO countdownEffectfulDynMVar
17#ifdef VERSION_freer_simple
17#ifdef VERSION_freer_simple
18 , bgroup "freer-simple" $ mkCountdown nf countdownFreerSimple
18 , bgroup "freer-simple" $ mkCountdown nf countdownFreerSimple
19#endif
19#endif
@@ -29,10 +29,10 @@ main = defaultMain
29#endif
29#endif
30 ]
30 ]
31 , bgroup "deep"
31 , bgroup "deep"
32− [ bgroup "effective (SP)" $ mkCountdown nfAppIO countdownEffectiveStaticDeep
32+ [ bgroup "efectful (SP)" $ mkCountdown nfAppIO countdownEffectfulStaticDeep
33− , bgroup "effective (SM)" $ mkCountdown nfAppIO countdownEffectiveMVarDeep
33+ , bgroup "efectful (SM)" $ mkCountdown nfAppIO countdownEffectfulMVarDeep
34− , bgroup "effective (DP)" $ mkCountdown nfAppIO countdownEffectiveDynPureDeep
34+ , bgroup "efectful (DP)" $ mkCountdown nfAppIO countdownEffectfulDynPureDeep
35− , bgroup "effective (DM)" $ mkCountdown nfAppIO countdownEffectiveDynMVarDeep
35+ , bgroup "efectful (DM)" $ mkCountdown nfAppIO countdownEffectfulDynMVarDeep
36#ifdef VERSION_eff
36#ifdef VERSION_eff
37 , bgroup "eff" $ mkCountdown nf countdownEffDeep
37 , bgroup "eff" $ mkCountdown nf countdownEffDeep
38#endif
38#endif
effective.cabal → effectful.cabalrenamed+24−26
@@ -1,6 +1,6 @@
1cabal-version: 2.4
1cabal-version: 2.4
2build-type: Simple
2build-type: Simple
3−name: effective
3+name: effectful
4version: 0.0.0.0
4version: 0.0.0.0
5license: BSD-3-Clause
5license: BSD-3-Clause
6license-file: LICENSE
6license-file: LICENSE
@@ -9,18 +9,18 @@ maintainer: andrzej@rybczak.net
9author: Andrzej Rybczak
9author: Andrzej Rybczak
10synopsis: A simple, yet powerful extensible effects library.
10synopsis: A simple, yet powerful extensible effects library.
11
11
12−description: A performant, easy to reason about extensible effects library with
12+description: A simple, performant extensible effects library with seamless
13− seamless integration with the existing Haskell ecosystem.
13+ integration with the existing Haskell ecosystem.
14
14
15extra-source-files: CHANGELOG.md
15extra-source-files: CHANGELOG.md
16
16
17tested-with: GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.4
17tested-with: GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.4
18 || ==9.0.1 || ==9.2.0.20210422
18 || ==9.0.1 || ==9.2.0.20210422
19
19
20−bug-reports: https://github.com/arybczak/effective/issues
20+bug-reports: https://github.com/arybczak/effectful/issues
21source-repository head
21source-repository head
22 type: git
22 type: git
23− location: https://github.com/arybczak/effective.git
23+ location: https://github.com/arybczak/effectful.git
24
24
25common language
25common language
26 ghc-options: -Wall
26 ghc-options: -Wall
@@ -34,17 +34,15 @@ common language
34 DeriveFunctor
34 DeriveFunctor
35 FlexibleContexts
35 FlexibleContexts
36 FlexibleInstances
36 FlexibleInstances
37− FunctionalDependencies
38 GADTs
37 GADTs
39 GeneralizedNewtypeDeriving
38 GeneralizedNewtypeDeriving
40− InstanceSigs
41 LambdaCase
39 LambdaCase
42 NamedFieldPuns
40 NamedFieldPuns
41+ MultiParamTypeClasses
43 RankNTypes
42 RankNTypes
44 RecordWildCards
43 RecordWildCards
45 RoleAnnotations
44 RoleAnnotations
46 ScopedTypeVariables
45 ScopedTypeVariables
47− StandaloneDeriving
48 StrictData
46 StrictData
49 TupleSections
47 TupleSections
50 TypeApplications
48 TypeApplications
@@ -68,22 +66,22 @@ library
68
66
69 hs-source-dirs: src
67 hs-source-dirs: src
70
68
71− exposed-modules: Effective
69+ exposed-modules: Effectful
72− Effective.Class.Reader
70+ Effectful.Class.Reader
73− Effective.Class.State
71+ Effectful.Class.State
74− Effective.Class.Writer
72+ Effectful.Class.Writer
75− Effective.Coroutine
73+ Effectful.Coroutine
76− Effective.Error
74+ Effectful.Error
77− Effective.Internal.Env
75+ Effectful.Internal.Env
78− Effective.Internal.Has
76+ Effectful.Internal.Has
79− Effective.Internal.Monad
77+ Effectful.Internal.Monad
80− Effective.Internal.Utils
78+ Effectful.Internal.Utils
81− Effective.Reader
79+ Effectful.Reader
82− Effective.Resource
80+ Effectful.Resource
83− Effective.State
81+ Effectful.State
84− Effective.State.Dynamic
82+ Effectful.State.Dynamic
85− Effective.State.MVar
83+ Effectful.State.MVar
86− Effective.Writer
84+ Effectful.Writer
87
85
88test-suite test
86test-suite test
89 import: language
87 import: language
@@ -91,7 +89,7 @@ test-suite test
91 ghc-options: -threaded -rtsopts
89 ghc-options: -threaded -rtsopts
92
90
93 build-depends: base <5
91 build-depends: base <5
94− , effective
92+ , effectful
95 , exceptions
93 , exceptions
96 , lifted-async
94 , lifted-async
97 , lifted-base
95 , lifted-base
@@ -119,7 +117,7 @@ benchmark bench
119 build-depends: polysemy
117 build-depends: polysemy
120
118
121 build-depends: base <5
119 build-depends: base <5
122− , effective
120+ , effectful
123 , mtl
121 , mtl
124 , tasty-bench
122 , tasty-bench
125
123
examples/FileSystem.hs+2−2
@@ -13,8 +13,8 @@ import qualified Control.Exception as E
13import qualified Data.Map.Strict as M
13import qualified Data.Map.Strict as M
14import qualified System.IO as IO
14import qualified System.IO as IO
15
15
16−import Effective
16+import Effectful
17−import Effective.Error
17+import Effectful.Error
18
18
19-- | Effect for reading and writing files.
19-- | Effect for reading and writing files.
20data FileSystem = forall fs. FileSystem
20data FileSystem = forall fs. FileSystem
src/Effective.hs → src/Effectful.hsrenamed+3−3
@@ -1,4 +1,4 @@
1−module Effective
1+module Effectful
2 ( -- * The 'Eff' monad
2 ( -- * The 'Eff' monad
3 Eff
3 Eff
4 , runEff
4 , runEff
@@ -30,5 +30,5 @@ module Effective
30 , stateEffectM
30 , stateEffectM
31 ) where
31 ) where
32
32
33−import Effective.Internal.Has
33+import Effectful.Internal.Has
34−import Effective.Internal.Monad
34+import Effectful.Internal.Monad
src/Effective/Class/Reader.hs → src/Effectful/Class/Reader.hsrenamed+4−4
@@ -1,5 +1,5 @@
1{-# LANGUAGE UndecidableInstances #-}
1{-# LANGUAGE UndecidableInstances #-}
2−module Effective.Class.Reader
2+module Effectful.Class.Reader
3 ( MonadReader(..)
3 ( MonadReader(..)
4 , asks
4 , asks
5 ) where
5 ) where
@@ -7,9 +7,9 @@ module Effective.Class.Reader
7import Control.Monad.Trans.Class
7import Control.Monad.Trans.Class
8import Control.Monad.Trans.Control
8import Control.Monad.Trans.Control
9
9
10−import Effective.Internal.Has
10+import Effectful.Internal.Has
11−import Effective.Internal.Monad
11+import Effectful.Internal.Monad
12−import qualified Effective.Reader as R
12+import qualified Effectful.Reader as R
13
13
14-- | Compatiblity layer for a transition period from MTL-style effect handling
14-- | Compatiblity layer for a transition period from MTL-style effect handling
15-- to 'Effective.Eff'.
15-- to 'Effective.Eff'.
src/Effective/Class/State.hs → src/Effectful/Class/State.hsrenamed+4−4
@@ -1,11 +1,11 @@
1{-# LANGUAGE UndecidableInstances #-}
1{-# LANGUAGE UndecidableInstances #-}
2−module Effective.Class.State where
2+module Effectful.Class.State where
3
3
4import Control.Monad.Trans.Class
4import Control.Monad.Trans.Class
5
5
6−import Effective.Internal.Has
6+import Effectful.Internal.Has
7−import Effective.Internal.Monad
7+import Effectful.Internal.Monad
8−import qualified Effective.State.Dynamic as S
8+import qualified Effectful.State.Dynamic as S
9
9
10-- | Compatiblity layer for a transition period from MTL-style effect handling
10-- | Compatiblity layer for a transition period from MTL-style effect handling
11-- to 'Effective.Eff'.
11-- to 'Effective.Eff'.
src/Effective/Class/Writer.hs → src/Effectful/Class/Writer.hsrenamed+4−4
@@ -1,12 +1,12 @@
1{-# LANGUAGE UndecidableInstances #-}
1{-# LANGUAGE UndecidableInstances #-}
2−module Effective.Class.Writer where
2+module Effectful.Class.Writer where
3
3
4import Control.Monad.Trans.Class
4import Control.Monad.Trans.Class
5import Control.Monad.Trans.Control
5import Control.Monad.Trans.Control
6
6
7−import Effective.Internal.Has
7+import Effectful.Internal.Has
8−import Effective.Internal.Monad
8+import Effectful.Internal.Monad
9−import qualified Effective.Writer as W
9+import qualified Effectful.Writer as W
10
10
11-- | Compatiblity layer for a transition period from MTL-style effect handling
11-- | Compatiblity layer for a transition period from MTL-style effect handling
12-- to 'Effective.Eff'.
12-- to 'Effective.Eff'.
src/Effective/Coroutine.hs → src/Effectful/Coroutine.hsrenamed+4−4
@@ -1,5 +1,5 @@
1-- | Experimental support for coroutines.
1-- | Experimental support for coroutines.
2−module Effective.Coroutine
2+module Effectful.Coroutine
3 ( Coroutine
3 ( Coroutine
4 , Status(..)
4 , Status(..)
5 , runCoroutine
5 , runCoroutine
@@ -11,9 +11,9 @@ import Control.Exception
11import Data.Function
11import Data.Function
12import qualified Control.Concurrent as C
12import qualified Control.Concurrent as C
13
13
14−import Effective.Internal.Env
14+import Effectful.Internal.Env
15−import Effective.Internal.Has
15+import Effectful.Internal.Has
16−import Effective.Internal.Monad
16+import Effectful.Internal.Monad
17
17
18data Coroutine o i = forall es r. Coroutine
18data Coroutine o i = forall es r. Coroutine
19 { crInput :: MVar (i, Env es)
19 { crInput :: MVar (i, Env es)
src/Effective/Error.hs → src/Effectful/Error.hsrenamed+5−5
@@ -1,5 +1,5 @@
1-- | Support for checked exceptions.
1-- | Support for checked exceptions.
2−module Effective.Error
2+module Effectful.Error
3 ( Error
3 ( Error
4 , runError
4 , runError
5 , throwError
5 , throwError
@@ -11,10 +11,10 @@ import Control.Exception
11import Data.Typeable
11import Data.Typeable
12import GHC.Stack
12import GHC.Stack
13
13
14−import Effective.Internal.Env
14+import Effectful.Internal.Env
15−import Effective.Internal.Has
15+import Effectful.Internal.Has
16−import Effective.Internal.Monad
16+import Effectful.Internal.Monad
17−import Effective.Internal.Utils
17+import Effectful.Internal.Utils
18
18
19type role Error nominal
19type role Error nominal
20data Error e = Error
20data Error e = Error
src/Effective/Internal/Env.hs → src/Effectful/Internal/Env.hsrenamed+2−2
@@ -3,7 +3,7 @@
3--
3--
4-- This module is intended for internal use only, and may change without warning
4-- This module is intended for internal use only, and may change without warning
5-- in subsequent releases.
5-- in subsequent releases.
6−module Effective.Internal.Env
6+module Effectful.Internal.Env
7 ( Env
7 ( Env
8
8
9 -- * Safe operations
9 -- * Safe operations
@@ -34,7 +34,7 @@ import GHC.Exts (Any)
34import GHC.Stack
34import GHC.Stack
35import Unsafe.Coerce
35import Unsafe.Coerce
36
36
37−import Effective.Internal.Has
37+import Effectful.Internal.Has
38
38
39type role Env nominal
39type role Env nominal
40
40
src/Effective/Internal/Has.hs → src/Effectful/Internal/Has.hsrenamed+1−1
@@ -5,7 +5,7 @@
5--
5--
6-- This module is intended for internal use only, and may change without warning
6-- This module is intended for internal use only, and may change without warning
7-- in subsequent releases.
7-- in subsequent releases.
8−module Effective.Internal.Has
8+module Effectful.Internal.Has
9 ( Effect
9 ( Effect
10 , (:>)
10 , (:>)
11 , ixEnv
11 , ixEnv
src/Effective/Internal/Monad.hs → src/Effectful/Internal/Monad.hsrenamed+3−3
@@ -4,7 +4,7 @@
4--
4--
5-- This module is intended for internal use only, and may change without warning
5-- This module is intended for internal use only, and may change without warning
6-- in subsequent releases.
6-- in subsequent releases.
7−module Effective.Internal.Monad
7+module Effectful.Internal.Monad
8 ( -- * Monad
8 ( -- * Monad
9 Eff(..)
9 Eff(..)
10 , runEff
10 , runEff
@@ -36,8 +36,8 @@ import Control.Monad.IO.Unlift
36import Control.Monad.Trans.Control
36import Control.Monad.Trans.Control
37import GHC.Magic (oneShot)
37import GHC.Magic (oneShot)
38
38
39−import Effective.Internal.Env
39+import Effectful.Internal.Env
40−import Effective.Internal.Has
40+import Effectful.Internal.Has
41
41
42type role Eff nominal representational
42type role Eff nominal representational
43
43
src/Effective/Internal/Utils.hs → src/Effectful/Internal/Utils.hsrenamed+1−1
@@ -3,7 +3,7 @@
3--
3--
4-- This module is intended for internal use only, and may change without warning
4-- This module is intended for internal use only, and may change without warning
5-- in subsequent releases.
5-- in subsequent releases.
6−module Effective.Internal.Utils
6+module Effectful.Internal.Utils
7 ( ppCallStack
7 ( ppCallStack
8 ) where
8 ) where
9
9
src/Effective/Reader.hs → src/Effectful/Reader.hsrenamed+3−3
@@ -1,5 +1,5 @@
1-- | The 'Reader' as an effect.
1-- | The 'Reader' as an effect.
2−module Effective.Reader
2+module Effectful.Reader
3 ( Reader
3 ( Reader
4 , runReader
4 , runReader
5 , ask
5 , ask
@@ -8,8 +8,8 @@ module Effective.Reader
8 , asks
8 , asks
9 ) where
9 ) where
10
10
11−import Effective.Internal.Has
11+import Effectful.Internal.Has
12−import Effective.Internal.Monad
12+import Effectful.Internal.Monad
13
13
14-- | Provide access to a read only value of type @r@.
14-- | Provide access to a read only value of type @r@.
15newtype Reader r = Reader { unReader :: r }
15newtype Reader r = Reader { unReader :: r }
src/Effective/Resource.hs → src/Effectful/Resource.hsrenamed+4−4
@@ -1,7 +1,7 @@
1{-# LANGUAGE UndecidableInstances #-}
1{-# LANGUAGE UndecidableInstances #-}
2{-# OPTIONS_GHC -Wno-orphans #-}
2{-# OPTIONS_GHC -Wno-orphans #-}
3-- | Resource management via 'R.MonadResource'.
3-- | Resource management via 'R.MonadResource'.
4−module Effective.Resource
4+module Effectful.Resource
5 ( Resource
5 ( Resource
6 , runResource
6 , runResource
7
7
@@ -17,9 +17,9 @@ import Control.Exception
17import qualified Control.Monad.Trans.Resource as R
17import qualified Control.Monad.Trans.Resource as R
18import qualified Control.Monad.Trans.Resource.Internal as RI
18import qualified Control.Monad.Trans.Resource.Internal as RI
19
19
20−import Effective.Internal.Env
20+import Effectful.Internal.Env
21−import Effective.Internal.Has
21+import Effectful.Internal.Has
22−import Effective.Internal.Monad
22+import Effectful.Internal.Monad
23
23
24-- | Data tag for a resource effect.
24-- | Data tag for a resource effect.
25newtype Resource = Resource R.InternalState
25newtype Resource = Resource R.InternalState
src/Effective/State.hs → src/Effectful/State.hsrenamed+3−3
@@ -9,7 +9,7 @@
9-- If you plan to do the latter, have a look at "Effective.State.MVar" or
9-- If you plan to do the latter, have a look at "Effective.State.MVar" or
10-- "Effective.State.Dynamic".
10-- "Effective.State.Dynamic".
11--
11--
12−module Effective.State
12+module Effectful.State
13 ( State
13 ( State
14 , runState
14 , runState
15 , evalState
15 , evalState
@@ -24,8 +24,8 @@ module Effective.State
24
24
25import Data.Coerce
25import Data.Coerce
26
26
27−import Effective.Internal.Has
27+import Effectful.Internal.Has
28−import Effective.Internal.Monad
28+import Effectful.Internal.Monad
29
29
30-- | Provide access to a pure, mutable state of type @s@.
30-- | Provide access to a pure, mutable state of type @s@.
31newtype State s = State { unState :: s }
31newtype State s = State { unState :: s }
src/Effective/State/Dynamic.hs → src/Effectful/State/Dynamic.hsrenamed+3−3
@@ -10,7 +10,7 @@
10--
10--
11-- However, let's include this for now.
11-- However, let's include this for now.
12--
12--
13−module Effective.State.Dynamic
13+module Effectful.State.Dynamic
14 ( State
14 ( State
15
15
16 -- * Pure
16 -- * Pure
@@ -34,8 +34,8 @@ module Effective.State.Dynamic
34
34
35import Control.Concurrent.MVar
35import Control.Concurrent.MVar
36
36
37−import Effective.Internal.Has
37+import Effectful.Internal.Has
38−import Effective.Internal.Monad
38+import Effectful.Internal.Monad
39
39
40-- | Provide access to a mutable state of type @s@.
40-- | Provide access to a mutable state of type @s@.
41--
41--
src/Effective/State/MVar.hs → src/Effectful/State/MVar.hsrenamed+3−3
@@ -6,7 +6,7 @@
6--
6--
7-- - suitable for sharing between multiple threads.
7-- - suitable for sharing between multiple threads.
8--
8--
9−module Effective.State.MVar
9+module Effectful.State.MVar
10 ( State
10 ( State
11 , runState
11 , runState
12 , evalState
12 , evalState
@@ -21,8 +21,8 @@ module Effective.State.MVar
21
21
22import Control.Concurrent.MVar
22import Control.Concurrent.MVar
23
23
24−import Effective.Internal.Has
24+import Effectful.Internal.Has
25−import Effective.Internal.Monad
25+import Effectful.Internal.Monad
26
26
27-- | Provide access to a synchronized, mutable state of type @s@.
27-- | Provide access to a synchronized, mutable state of type @s@.
28newtype State s = State (MVar s)
28newtype State s = State (MVar s)
src/Effective/Writer.hs → src/Effectful/Writer.hsrenamed+3−3
@@ -1,5 +1,5 @@
1-- | The 'Writer' as an effect.
1-- | The 'Writer' as an effect.
2−module Effective.Writer
2+module Effectful.Writer
3 ( Writer
3 ( Writer
4 , runWriter
4 , runWriter
5 , execWriter
5 , execWriter
@@ -12,8 +12,8 @@ module Effective.Writer
12import Data.Coerce
12import Data.Coerce
13import qualified Data.Semigroup as S
13import qualified Data.Semigroup as S
14
14
15−import Effective.Internal.Has
15+import Effectful.Internal.Has
16−import Effective.Internal.Monad
16+import Effectful.Internal.Monad
17
17
18-- | Provide access to a write only value of type @w@.
18-- | Provide access to a write only value of type @w@.
19newtype Writer w = Writer w
19newtype Writer w = Writer w
tests/Main.hs+3−3
@@ -8,11 +8,11 @@ import qualified Control.Monad.Catch as E
8import qualified Control.Exception.Lifted as LE
8import qualified Control.Exception.Lifted as LE
9import qualified UnliftIO.Exception as UE
9import qualified UnliftIO.Exception as UE
10
10
11−import Effective
11+import Effectful
12−import Effective.State
12+import Effectful.State
13
13
14main :: IO ()
14main :: IO ()
15−main = defaultMain $ testGroup "effective"
15+main = defaultMain $ testGroup "effectful"
16 [ testGroup "state"
16 [ testGroup "state"
17 [ testCase "runState & execState" test_runState
17 [ testCase "runState & execState" test_runState
18 , testCase "evalState" test_evalState
18 , testCase "evalState" test_evalState