on master help sign in
Adjust documentation of State effects
6cf8c66Andrzej Rybczak
src/Effectful/State.hs+4−4
@@ -1,10 +1,10 @@
1−-- | The 'State' as an effect.
1+-- | The 'State' effect.
2--
2--
3-- Represented as a pure value underneath, therefore:
3-- Represented as a pure value underneath, therefore:
4--
4--
5−-- - very fast,
5+-- - thread local (if you need sharing, have a look at "Effectful.State.MVar"),
6--
6--
7−-- - thread local (if you need sharing, have a look at "Effectful.State.MVar").
7+-- - very fast.
8--
8--
9module Effectful.State
9module Effectful.State
10 ( State
10 ( State
@@ -23,7 +23,7 @@ module Effectful.State
23import Effectful.Internal.Effect
23import Effectful.Internal.Effect
24import Effectful.Internal.Monad
24import Effectful.Internal.Monad
25
25
26−-- | Provide access to a pure, mutable state of type @s@.
26+-- | Provide access to a strict, thread local, mutable state of type @s@.
27newtype State s :: Effect where
27newtype State s :: Effect where
28 State :: s -> State s m r
28 State :: s -> State s m r
29
29
src/Effectful/State/Dynamic.hs+1−1
@@ -1,4 +1,4 @@
1−-- | The 'State' as an effect with dynamic dispatch.
1+-- | The 'State' effect with dynamic dispatch.
2--
2--
3-- It's not clear in which situation it's beneficial to use this instead of
3-- It's not clear in which situation it's beneficial to use this instead of
4-- "Effectful.State" or "Effectful.State.MVar" as you either:
4-- "Effectful.State" or "Effectful.State.MVar" as you either:
src/Effectful/State/MVar.hs+4−4
@@ -1,8 +1,8 @@
1−-- | The 'State' as an effect.
1+-- | The 'State' effect.
2--
2--
3−-- Represented as an MVar underneath, therefore:
3+-- Represented as an 'MVar' underneath, therefore:
4--
4--
5−-- - suitable for sharing between multiple threads,
5+-- - shareable between multiple threads,
6--
6--
7-- - slower than "Effectful.State".
7-- - slower than "Effectful.State".
8--
8--
@@ -25,7 +25,7 @@ import Control.Concurrent.MVar
25import Effectful.Internal.Effect
25import Effectful.Internal.Effect
26import Effectful.Internal.Monad
26import Effectful.Internal.Monad
27
27
28−-- | Provide access to a synchronized, mutable state of type @s@.
28+-- | Provide access to a strict, shareable, mutable state of type @s@.
29newtype State s :: Effect where
29newtype State s :: Effect where
30 State :: MVar s -> State s m r
30 State :: MVar s -> State s m r
31
31