on master help sign in
Change name to effectful
commit36b5a1f317e962714b9cd64b4d48aeb0f9e0ea8a authorAndrzej Rybczak <andrzej@rybczak.net> dateSun 13 Jun 2021, 19:57 (5 years ago) parent4dbb829
23 files changed+141−143
CHANGELOG.md+1−1 README.md+12−12 bench/Countdown.hs+41−41 bench/Main.hs+8−8 effective.cabal → effectful.cabal+24−26 examples/FileSystem.hs+2−2 src/Effective.hs → src/Effectful.hs+3−3 src/Effective/Class/Reader.hs → src/Effectful/Class/Reader.hs+4−4 src/Effective/Class/State.hs → src/Effectful/Class/State.hs+4−4 src/Effective/Class/Writer.hs → src/Effectful/Class/Writer.hs+4−4 src/Effective/Coroutine.hs → src/Effectful/Coroutine.hs+4−4 src/Effective/Error.hs → src/Effectful/Error.hs+5−5 src/Effective/Internal/Env.hs → src/Effectful/Internal/Env.hs+2−2 src/Effective/Internal/Has.hs → src/Effectful/Internal/Has.hs+1−1 src/Effective/Internal/Monad.hs → src/Effectful/Internal/Monad.hs+3−3 src/Effective/Internal/Utils.hs → src/Effectful/Internal/Utils.hs+1−1 src/Effective/Reader.hs → src/Effectful/Reader.hs+3−3 src/Effective/Resource.hs → src/Effectful/Resource.hs+4−4 src/Effective/State.hs → src/Effectful/State.hs+3−3 src/Effective/State/Dynamic.hs → src/Effectful/State/Dynamic.hs+3−3 src/Effective/State/MVar.hs → src/Effectful/State/MVar.hs+3−3 src/Effective/Writer.hs → src/Effectful/Writer.hs+3−3 tests/Main.hs+3−3
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)
22* Initial alpha release.
README.md+12−12
@@ -1,12 +1,12 @@
1−# effective
1+# effectful
22
3−[![Build Status](https://github.com/arybczak/effective/workflows/Haskell-CI/badge.svg?branch=master)](https://github.com/arybczak/effective/actions?query=branch%3Amaster)
4−[![Hackage](https://img.shields.io/hackage/v/effective.svg)](https://hackage.haskell.org/package/effective)
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/effectful.svg)](https://hackage.haskell.org/package/effectful)
55
66*Note:* this is a pre-release.
77
8−A performant, easy to reason about extensible effects library with seamless
9−integration with the existing Haskell ecosystem.
8+A simple, performant extensible effects library with seamless integration with
9+the existing ecosystem.
1010
1111Main features:
1212
@@ -36,10 +36,10 @@ Do we really need yet another library for handling effects? There's
3636[polysemy](https://hackage.haskell.org/package/polysemy),
3737[eff](https://github.com/hasura/eff) and probably a few more.
3838
39−Unfortunately, of all of them only `eff` is a promising proposition because
40−of reasonable performance characteristics (see the talk "Effects for Less"
41−linked below for more information) and potential for good interoperability with
42−the existing ecosystem.
39+Unfortunately, of all of them only `eff` is a promising proposition because of
40+reasonable performance characteristics (see the talk "Effects for Less" linked
41+below for more information) and potential for good interoperability with the
42+existing ecosystem.
4343
4444The second point is arguably the most important, because it allows focusing on
4545things that matter instead of reinventing all kinds of wheels and is crucial for
@@ -69,7 +69,7 @@ dedicated, well established solution such as
6969[list-t](https://hackage.haskell.org/package/list-t) or
7070[logict](https://hackage.haskell.org/package/logict) can be used.
7171
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
7373`ReaderT` over `IO` on steroids, allowing us to dynamically extend its
7474environment with data types that represent effects.
7575
@@ -93,7 +93,7 @@ What is more:
9393- If an advanced effect with non-linear control flow is needed, you can always
9494 stick a transformer that implements it on top of `Eff` in a local context.
9595
96−In conclusion, `effective` aims to reduce duplication and bring back performance
96+In conclusion, `effectful` aims to reduce duplication and bring back performance
9797to "boring" transformer stacks, most of which are a dozen of newtype'd `StateT`
9898or `ReaderT` transformers, each with a few associated operations (usually tied
9999to a type class), not to replace monad transformers altogether.
@@ -102,7 +102,7 @@ to a type class), not to replace monad transformers altogether.
102102
103103A `Filesystem` effect with two handlers, one that runs in `IO` and another that
104104uses 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).
106106
107107## Resources
108108
bench/Countdown.hs+41−41
@@ -8,12 +8,12 @@ import Data.Functor.Identity
88import qualified Control.Effect as L
99#endif
1010
11−-- effective
12−import qualified Effective as E
13−import qualified Effective.Reader as E
14−import qualified Effective.State as E
15−import qualified Effective.State.MVar as ME
16−import qualified Effective.State.Dynamic as DE
11+-- effectful
12+import qualified Effectful as E
13+import qualified Effectful.Reader as E
14+import qualified Effectful.State as E
15+import qualified Effectful.State.MVar as ME
16+import qualified Effectful.State.Dynamic as DE
1717
1818-- freer-simple
1919#ifdef VERSION_freer_simple
@@ -73,89 +73,89 @@ countdownMtlDeep n = runIdentity
7373 runR = flip M.runReaderT ()
7474
7575----------------------------------------
76−-- effective (pure)
76+-- effectful (pure)
7777
78−programEffectiveStatic :: E.State Integer E.:> es => E.Eff es Integer
79−programEffectiveStatic = do
78+programEffectfulStatic :: E.State Integer E.:> es => E.Eff es Integer
79+programEffectfulStatic = do
8080 n <- E.get @Integer
8181 if n <= 0
8282 then pure n
8383 else do
8484 E.put (n - 1)
85− programEffectiveStatic
86−{-# NOINLINE programEffectiveStatic #-}
85+ programEffectfulStatic
86+{-# NOINLINE programEffectfulStatic #-}
8787
88−countdownEffectiveStatic :: Integer -> IO (Integer, Integer)
89−countdownEffectiveStatic n = E.runEff . E.runState n $ programEffectiveStatic
88+countdownEffectfulStatic :: Integer -> IO (Integer, Integer)
89+countdownEffectfulStatic n = E.runEff . E.runState n $ programEffectfulStatic
9090
91−countdownEffectiveStaticDeep :: Integer -> IO (Integer, Integer)
92−countdownEffectiveStaticDeep n = E.runEff
91+countdownEffectfulStaticDeep :: Integer -> IO (Integer, Integer)
92+countdownEffectfulStaticDeep n = E.runEff
9393 . runR . runR . runR . runR . runR . runR . runR . runR . runR . runR
9494 . E.runState n
9595 . runR . runR . runR . runR . runR . runR . runR . runR . runR . runR
96− $ programEffectiveStatic
96+ $ programEffectfulStatic
9797 where
9898 runR = E.runReader ()
9999
100100----------------------------------------
101−-- effective (mvar)
101+-- effectful (mvar)
102102
103−programEffectiveMVar :: ME.State Integer E.:> es => E.Eff es Integer
104−programEffectiveMVar = do
103+programEffectfulMVar :: ME.State Integer E.:> es => E.Eff es Integer
104+programEffectfulMVar = do
105105 n <- ME.get @Integer
106106 if n <= 0
107107 then pure n
108108 else do
109109 ME.put (n - 1)
110− programEffectiveMVar
111−{-# NOINLINE programEffectiveMVar #-}
110+ programEffectfulMVar
111+{-# NOINLINE programEffectfulMVar #-}
112112
113−countdownEffectiveMVar :: Integer -> IO (Integer, Integer)
114−countdownEffectiveMVar n = E.runEff . ME.runState n $ programEffectiveMVar
113+countdownEffectfulMVar :: Integer -> IO (Integer, Integer)
114+countdownEffectfulMVar n = E.runEff . ME.runState n $ programEffectfulMVar
115115
116−countdownEffectiveMVarDeep :: Integer -> IO (Integer, Integer)
117−countdownEffectiveMVarDeep n = E.runEff
116+countdownEffectfulMVarDeep :: Integer -> IO (Integer, Integer)
117+countdownEffectfulMVarDeep n = E.runEff
118118 . runR . runR . runR . runR . runR . runR . runR . runR . runR . runR
119119 . ME.runState n
120120 . runR . runR . runR . runR . runR . runR . runR . runR . runR . runR
121− $ programEffectiveMVar
121+ $ programEffectfulMVar
122122 where
123123 runR = E.runReader ()
124124
125125----------------------------------------
126−-- effective (dynamic)
126+-- effectful (dynamic)
127127
128−programEffectiveDynamic :: DE.State Integer E.:> es => E.Eff es Integer
129−programEffectiveDynamic = do
128+programEffectfulDynamic :: DE.State Integer E.:> es => E.Eff es Integer
129+programEffectfulDynamic = do
130130 n <- DE.get @Integer
131131 if n <= 0
132132 then pure n
133133 else do
134134 DE.put (n - 1)
135− programEffectiveDynamic
136−{-# NOINLINE programEffectiveDynamic #-}
135+ programEffectfulDynamic
136+{-# NOINLINE programEffectfulDynamic #-}
137137
138−countdownEffectiveDynPure :: Integer -> IO (Integer, Integer)
139−countdownEffectiveDynPure n = E.runEff . DE.runState n $ programEffectiveDynamic
138+countdownEffectfulDynPure :: Integer -> IO (Integer, Integer)
139+countdownEffectfulDynPure n = E.runEff . DE.runState n $ programEffectfulDynamic
140140
141−countdownEffectiveDynMVar :: Integer -> IO (Integer, Integer)
142−countdownEffectiveDynMVar n = E.runEff . DE.runStateMVar n $ programEffectiveDynamic
141+countdownEffectfulDynMVar :: Integer -> IO (Integer, Integer)
142+countdownEffectfulDynMVar n = E.runEff . DE.runStateMVar n $ programEffectfulDynamic
143143
144−countdownEffectiveDynPureDeep :: Integer -> IO (Integer, Integer)
145−countdownEffectiveDynPureDeep n = E.runEff
144+countdownEffectfulDynPureDeep :: Integer -> IO (Integer, Integer)
145+countdownEffectfulDynPureDeep n = E.runEff
146146 . runR . runR . runR . runR . runR . runR . runR . runR . runR . runR
147147 . DE.runState n
148148 . runR . runR . runR . runR . runR . runR . runR . runR . runR . runR
149− $ programEffectiveDynamic
149+ $ programEffectfulDynamic
150150 where
151151 runR = E.runReader ()
152152
153−countdownEffectiveDynMVarDeep :: Integer -> IO (Integer, Integer)
154−countdownEffectiveDynMVarDeep n = E.runEff
153+countdownEffectfulDynMVarDeep :: Integer -> IO (Integer, Integer)
154+countdownEffectfulDynMVarDeep n = E.runEff
155155 . runR . runR . runR . runR . runR . runR . runR . runR . runR . runR
156156 . DE.runStateMVar n
157157 . runR . runR . runR . runR . runR . runR . runR . runR . runR . runR
158− $ programEffectiveDynamic
158+ $ programEffectfulDynamic
159159 where
160160 runR = E.runReader ()
161161
bench/Main.hs+8−8
@@ -10,10 +10,10 @@ main = defaultMain
1010 [ bgroup "countdown"
1111 [ bgroup "reference" $ mkCountdown nf countdownRef
1212 , bgroup "shallow"
13− [ bgroup "effective (SP)" $ mkCountdown nfAppIO countdownEffectiveStatic
14− , bgroup "effective (SM)" $ mkCountdown nfAppIO countdownEffectiveMVar
15− , bgroup "effective (DP)" $ mkCountdown nfAppIO countdownEffectiveDynPure
16− , bgroup "effective (DM)" $ mkCountdown nfAppIO countdownEffectiveDynMVar
13+ [ bgroup "efectful (SP)" $ mkCountdown nfAppIO countdownEffectfulStatic
14+ , bgroup "efectful (SM)" $ mkCountdown nfAppIO countdownEffectfulMVar
15+ , bgroup "efectful (DP)" $ mkCountdown nfAppIO countdownEffectfulDynPure
16+ , bgroup "efectful (DM)" $ mkCountdown nfAppIO countdownEffectfulDynMVar
1717#ifdef VERSION_freer_simple
1818 , bgroup "freer-simple" $ mkCountdown nf countdownFreerSimple
1919#endif
@@ -29,10 +29,10 @@ main = defaultMain
2929#endif
3030 ]
3131 , bgroup "deep"
32− [ bgroup "effective (SP)" $ mkCountdown nfAppIO countdownEffectiveStaticDeep
33− , bgroup "effective (SM)" $ mkCountdown nfAppIO countdownEffectiveMVarDeep
34− , bgroup "effective (DP)" $ mkCountdown nfAppIO countdownEffectiveDynPureDeep
35− , bgroup "effective (DM)" $ mkCountdown nfAppIO countdownEffectiveDynMVarDeep
32+ [ bgroup "efectful (SP)" $ mkCountdown nfAppIO countdownEffectfulStaticDeep
33+ , bgroup "efectful (SM)" $ mkCountdown nfAppIO countdownEffectfulMVarDeep
34+ , bgroup "efectful (DP)" $ mkCountdown nfAppIO countdownEffectfulDynPureDeep
35+ , bgroup "efectful (DM)" $ mkCountdown nfAppIO countdownEffectfulDynMVarDeep
3636#ifdef VERSION_eff
3737 , bgroup "eff" $ mkCountdown nf countdownEffDeep
3838#endif
effective.cabal → effectful.cabalrenamed+24−26
@@ -1,6 +1,6 @@
11cabal-version: 2.4
22build-type: Simple
3−name: effective
3+name: effectful
44version: 0.0.0.0
55license: BSD-3-Clause
66license-file: LICENSE
@@ -9,18 +9,18 @@ maintainer: andrzej@rybczak.net
99author: Andrzej Rybczak
1010synopsis: A simple, yet powerful extensible effects library.
1111
12−description: A performant, easy to reason about extensible effects library with
13− seamless integration with the existing Haskell ecosystem.
12+description: A simple, performant extensible effects library with seamless
13+ integration with the existing Haskell ecosystem.
1414
1515extra-source-files: CHANGELOG.md
1616
1717tested-with: GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.4
1818 || ==9.0.1 || ==9.2.0.20210422
1919
20−bug-reports: https://github.com/arybczak/effective/issues
20+bug-reports: https://github.com/arybczak/effectful/issues
2121source-repository head
2222 type: git
23− location: https://github.com/arybczak/effective.git
23+ location: https://github.com/arybczak/effectful.git
2424
2525common language
2626 ghc-options: -Wall
@@ -34,17 +34,15 @@ common language
3434 DeriveFunctor
3535 FlexibleContexts
3636 FlexibleInstances
37− FunctionalDependencies
3837 GADTs
3938 GeneralizedNewtypeDeriving
40− InstanceSigs
4139 LambdaCase
4240 NamedFieldPuns
41+ MultiParamTypeClasses
4342 RankNTypes
4443 RecordWildCards
4544 RoleAnnotations
4645 ScopedTypeVariables
47− StandaloneDeriving
4846 StrictData
4947 TupleSections
5048 TypeApplications
@@ -68,22 +66,22 @@ library
6866
6967 hs-source-dirs: src
7068
71− exposed-modules: Effective
72− Effective.Class.Reader
73− Effective.Class.State
74− Effective.Class.Writer
75− Effective.Coroutine
76− Effective.Error
77− Effective.Internal.Env
78− Effective.Internal.Has
79− Effective.Internal.Monad
80− Effective.Internal.Utils
81− Effective.Reader
82− Effective.Resource
83− Effective.State
84− Effective.State.Dynamic
85− Effective.State.MVar
86− Effective.Writer
69+ exposed-modules: Effectful
70+ Effectful.Class.Reader
71+ Effectful.Class.State
72+ Effectful.Class.Writer
73+ Effectful.Coroutine
74+ Effectful.Error
75+ Effectful.Internal.Env
76+ Effectful.Internal.Has
77+ Effectful.Internal.Monad
78+ Effectful.Internal.Utils
79+ Effectful.Reader
80+ Effectful.Resource
81+ Effectful.State
82+ Effectful.State.Dynamic
83+ Effectful.State.MVar
84+ Effectful.Writer
8785
8886test-suite test
8987 import: language
@@ -91,7 +89,7 @@ test-suite test
9189 ghc-options: -threaded -rtsopts
9290
9391 build-depends: base <5
94− , effective
92+ , effectful
9593 , exceptions
9694 , lifted-async
9795 , lifted-base
@@ -119,7 +117,7 @@ benchmark bench
119117 build-depends: polysemy
120118
121119 build-depends: base <5
122− , effective
120+ , effectful
123121 , mtl
124122 , tasty-bench
125123
examples/FileSystem.hs+2−2
@@ -13,8 +13,8 @@ import qualified Control.Exception as E
1313import qualified Data.Map.Strict as M
1414import qualified System.IO as IO
1515
16−import Effective
17−import Effective.Error
16+import Effectful
17+import Effectful.Error
1818
1919-- | Effect for reading and writing files.
2020data FileSystem = forall fs. FileSystem
src/Effective.hs → src/Effectful.hsrenamed+3−3
@@ -1,4 +1,4 @@
1−module Effective
1+module Effectful
22 ( -- * The 'Eff' monad
33 Eff
44 , runEff
@@ -30,5 +30,5 @@ module Effective
3030 , stateEffectM
3131 ) where
3232
33−import Effective.Internal.Has
34−import Effective.Internal.Monad
33+import Effectful.Internal.Has
34+import Effectful.Internal.Monad
src/Effective/Class/Reader.hs → src/Effectful/Class/Reader.hsrenamed+4−4
@@ -1,5 +1,5 @@
11{-# LANGUAGE UndecidableInstances #-}
2−module Effective.Class.Reader
2+module Effectful.Class.Reader
33 ( MonadReader(..)
44 , asks
55 ) where
@@ -7,9 +7,9 @@ module Effective.Class.Reader
77import Control.Monad.Trans.Class
88import Control.Monad.Trans.Control
99
10−import Effective.Internal.Has
11−import Effective.Internal.Monad
12−import qualified Effective.Reader as R
10+import Effectful.Internal.Has
11+import Effectful.Internal.Monad
12+import qualified Effectful.Reader as R
1313
1414-- | Compatiblity layer for a transition period from MTL-style effect handling
1515-- to 'Effective.Eff'.
src/Effective/Class/State.hs → src/Effectful/Class/State.hsrenamed+4−4
@@ -1,11 +1,11 @@
11{-# LANGUAGE UndecidableInstances #-}
2−module Effective.Class.State where
2+module Effectful.Class.State where
33
44import Control.Monad.Trans.Class
55
6−import Effective.Internal.Has
7−import Effective.Internal.Monad
8−import qualified Effective.State.Dynamic as S
6+import Effectful.Internal.Has
7+import Effectful.Internal.Monad
8+import qualified Effectful.State.Dynamic as S
99
1010-- | Compatiblity layer for a transition period from MTL-style effect handling
1111-- to 'Effective.Eff'.
src/Effective/Class/Writer.hs → src/Effectful/Class/Writer.hsrenamed+4−4
@@ -1,12 +1,12 @@
11{-# LANGUAGE UndecidableInstances #-}
2−module Effective.Class.Writer where
2+module Effectful.Class.Writer where
33
44import Control.Monad.Trans.Class
55import Control.Monad.Trans.Control
66
7−import Effective.Internal.Has
8−import Effective.Internal.Monad
9−import qualified Effective.Writer as W
7+import Effectful.Internal.Has
8+import Effectful.Internal.Monad
9+import qualified Effectful.Writer as W
1010
1111-- | Compatiblity layer for a transition period from MTL-style effect handling
1212-- to 'Effective.Eff'.
src/Effective/Coroutine.hs → src/Effectful/Coroutine.hsrenamed+4−4
@@ -1,5 +1,5 @@
11-- | Experimental support for coroutines.
2−module Effective.Coroutine
2+module Effectful.Coroutine
33 ( Coroutine
44 , Status(..)
55 , runCoroutine
@@ -11,9 +11,9 @@ import Control.Exception
1111import Data.Function
1212import qualified Control.Concurrent as C
1313
14−import Effective.Internal.Env
15−import Effective.Internal.Has
16−import Effective.Internal.Monad
14+import Effectful.Internal.Env
15+import Effectful.Internal.Has
16+import Effectful.Internal.Monad
1717
1818data Coroutine o i = forall es r. Coroutine
1919 { crInput :: MVar (i, Env es)
src/Effective/Error.hs → src/Effectful/Error.hsrenamed+5−5
@@ -1,5 +1,5 @@
11-- | Support for checked exceptions.
2−module Effective.Error
2+module Effectful.Error
33 ( Error
44 , runError
55 , throwError
@@ -11,10 +11,10 @@ import Control.Exception
1111import Data.Typeable
1212import GHC.Stack
1313
14−import Effective.Internal.Env
15−import Effective.Internal.Has
16−import Effective.Internal.Monad
17−import Effective.Internal.Utils
14+import Effectful.Internal.Env
15+import Effectful.Internal.Has
16+import Effectful.Internal.Monad
17+import Effectful.Internal.Utils
1818
1919type role Error nominal
2020data Error e = Error
src/Effective/Internal/Env.hs → src/Effectful/Internal/Env.hsrenamed+2−2
@@ -3,7 +3,7 @@
33--
44-- This module is intended for internal use only, and may change without warning
55-- in subsequent releases.
6−module Effective.Internal.Env
6+module Effectful.Internal.Env
77 ( Env
88
99 -- * Safe operations
@@ -34,7 +34,7 @@ import GHC.Exts (Any)
3434import GHC.Stack
3535import Unsafe.Coerce
3636
37−import Effective.Internal.Has
37+import Effectful.Internal.Has
3838
3939type role Env nominal
4040
src/Effective/Internal/Has.hs → src/Effectful/Internal/Has.hsrenamed+1−1
@@ -5,7 +5,7 @@
55--
66-- This module is intended for internal use only, and may change without warning
77-- in subsequent releases.
8−module Effective.Internal.Has
8+module Effectful.Internal.Has
99 ( Effect
1010 , (:>)
1111 , ixEnv
src/Effective/Internal/Monad.hs → src/Effectful/Internal/Monad.hsrenamed+3−3
@@ -4,7 +4,7 @@
44--
55-- This module is intended for internal use only, and may change without warning
66-- in subsequent releases.
7−module Effective.Internal.Monad
7+module Effectful.Internal.Monad
88 ( -- * Monad
99 Eff(..)
1010 , runEff
@@ -36,8 +36,8 @@ import Control.Monad.IO.Unlift
3636import Control.Monad.Trans.Control
3737import GHC.Magic (oneShot)
3838
39−import Effective.Internal.Env
40−import Effective.Internal.Has
39+import Effectful.Internal.Env
40+import Effectful.Internal.Has
4141
4242type role Eff nominal representational
4343
src/Effective/Internal/Utils.hs → src/Effectful/Internal/Utils.hsrenamed+1−1
@@ -3,7 +3,7 @@
33--
44-- This module is intended for internal use only, and may change without warning
55-- in subsequent releases.
6−module Effective.Internal.Utils
6+module Effectful.Internal.Utils
77 ( ppCallStack
88 ) where
99
src/Effective/Reader.hs → src/Effectful/Reader.hsrenamed+3−3
@@ -1,5 +1,5 @@
11-- | The 'Reader' as an effect.
2−module Effective.Reader
2+module Effectful.Reader
33 ( Reader
44 , runReader
55 , ask
@@ -8,8 +8,8 @@ module Effective.Reader
88 , asks
99 ) where
1010
11−import Effective.Internal.Has
12−import Effective.Internal.Monad
11+import Effectful.Internal.Has
12+import Effectful.Internal.Monad
1313
1414-- | Provide access to a read only value of type @r@.
1515newtype Reader r = Reader { unReader :: r }
src/Effective/Resource.hs → src/Effectful/Resource.hsrenamed+4−4
@@ -1,7 +1,7 @@
11{-# LANGUAGE UndecidableInstances #-}
22{-# OPTIONS_GHC -Wno-orphans #-}
33-- | Resource management via 'R.MonadResource'.
4−module Effective.Resource
4+module Effectful.Resource
55 ( Resource
66 , runResource
77
@@ -17,9 +17,9 @@ import Control.Exception
1717import qualified Control.Monad.Trans.Resource as R
1818import qualified Control.Monad.Trans.Resource.Internal as RI
1919
20−import Effective.Internal.Env
21−import Effective.Internal.Has
22−import Effective.Internal.Monad
20+import Effectful.Internal.Env
21+import Effectful.Internal.Has
22+import Effectful.Internal.Monad
2323
2424-- | Data tag for a resource effect.
2525newtype Resource = Resource R.InternalState
src/Effective/State.hs → src/Effectful/State.hsrenamed+3−3
@@ -9,7 +9,7 @@
99-- If you plan to do the latter, have a look at "Effective.State.MVar" or
1010-- "Effective.State.Dynamic".
1111--
12−module Effective.State
12+module Effectful.State
1313 ( State
1414 , runState
1515 , evalState
@@ -24,8 +24,8 @@ module Effective.State
2424
2525import Data.Coerce
2626
27−import Effective.Internal.Has
28−import Effective.Internal.Monad
27+import Effectful.Internal.Has
28+import Effectful.Internal.Monad
2929
3030-- | Provide access to a pure, mutable state of type @s@.
3131newtype State s = State { unState :: s }
src/Effective/State/Dynamic.hs → src/Effectful/State/Dynamic.hsrenamed+3−3
@@ -10,7 +10,7 @@
1010--
1111-- However, let's include this for now.
1212--
13−module Effective.State.Dynamic
13+module Effectful.State.Dynamic
1414 ( State
1515
1616 -- * Pure
@@ -34,8 +34,8 @@ module Effective.State.Dynamic
3434
3535import Control.Concurrent.MVar
3636
37−import Effective.Internal.Has
38−import Effective.Internal.Monad
37+import Effectful.Internal.Has
38+import Effectful.Internal.Monad
3939
4040-- | Provide access to a mutable state of type @s@.
4141--
src/Effective/State/MVar.hs → src/Effectful/State/MVar.hsrenamed+3−3
@@ -6,7 +6,7 @@
66--
77-- - suitable for sharing between multiple threads.
88--
9−module Effective.State.MVar
9+module Effectful.State.MVar
1010 ( State
1111 , runState
1212 , evalState
@@ -21,8 +21,8 @@ module Effective.State.MVar
2121
2222import Control.Concurrent.MVar
2323
24−import Effective.Internal.Has
25−import Effective.Internal.Monad
24+import Effectful.Internal.Has
25+import Effectful.Internal.Monad
2626
2727-- | Provide access to a synchronized, mutable state of type @s@.
2828newtype State s = State (MVar s)
src/Effective/Writer.hs → src/Effectful/Writer.hsrenamed+3−3
@@ -1,5 +1,5 @@
11-- | The 'Writer' as an effect.
2−module Effective.Writer
2+module Effectful.Writer
33 ( Writer
44 , runWriter
55 , execWriter
@@ -12,8 +12,8 @@ module Effective.Writer
1212import Data.Coerce
1313import qualified Data.Semigroup as S
1414
15−import Effective.Internal.Has
16−import Effective.Internal.Monad
15+import Effectful.Internal.Has
16+import Effectful.Internal.Monad
1717
1818-- | Provide access to a write only value of type @w@.
1919newtype Writer w = Writer w
tests/Main.hs+3−3
@@ -8,11 +8,11 @@ import qualified Control.Monad.Catch as E
88import qualified Control.Exception.Lifted as LE
99import qualified UnliftIO.Exception as UE
1010
11−import Effective
12−import Effective.State
11+import Effectful
12+import Effectful.State
1313
1414main :: IO ()
15−main = defaultMain $ testGroup "effective"
15+main = defaultMain $ testGroup "effectful"
1616 [ testGroup "state"
1717 [ testCase "runState & execState" test_runState
1818 , testCase "evalState" test_evalState