on master help sign in
Haddock improvements
commit3294d3b844812ead3a6e57531cb7ab1a5296541e authorAndrzej Rybczak <andrzej@rybczak.net> dateSun 19 Dec 2021, 01:05 (5 years ago) parent62ac970
10 files changed+30−36
effectful-core/src/Effectful/Error.hs+3−4 effectful-core/src/Effectful/Internal/Effect.hs+6−6 effectful-core/src/Effectful/Internal/Monad.hs+2−2 effectful-core/src/Effectful/Internal/Unlift.hs+3−2 effectful-core/src/Effectful/Reader.hs+1−1 effectful-core/src/Effectful/State/Dynamic.hs+1−1 effectful-core/src/Effectful/State/Local.hs+3−5 effectful-core/src/Effectful/State/Shared.hs+4−5 effectful-core/src/Effectful/Writer/Local.hs+3−5 effectful-core/src/Effectful/Writer/Shared.hs+4−5
effectful-core/src/Effectful/Error.hs+3−4
@@ -6,8 +6,8 @@
66-- exceptions, that's what functions from the @exceptions@ library are for (see
77-- "Control.Monad.Catch" for more information).
88--
9−-- In particular, exceptions of type @e@ are distinct from errors of type @e@
10−-- and will __not__ be caught by functions from this module:
9+-- In particular, regular exceptions of type @e@ are distinct from errors of
10+-- type @e@ and will __not__ be caught by functions from this module:
1111--
1212-- >>> import qualified Control.Monad.Catch as E
1313-- >>> let boom = error "BOOM!"
@@ -38,8 +38,7 @@
3838-- Left "oops"
3939--
4040module Effectful.Error
41− ( -- * The effect
42− Error
41+ ( Error
4342 , runError
4443 , throwError
4544 , catchError
effectful-core/src/Effectful/Internal/Effect.hs+6−6
@@ -27,13 +27,13 @@ type Effect = (Type -> Type) -> Type -> Type
2727newtype IdE :: Effect -> Type where
2828 IdE :: (forall m r. e m r) -> IdE e
2929
30−-- | A constraint that requires that a particular effect, @e@, is a member of
31−-- the type-level list @es@. This is used to parameterize an
32−-- 'Effectful.Monad.Eff' operation over an arbitrary list of effects, so long as
33−-- @e@ is /somewhere/ in the list.
30+-- | A constraint that requires that a particular effect @e@ is a member of the
31+-- type-level list @es@. This is used to parameterize an 'Effectful.Monad.Eff'
32+-- operation over an arbitrary list of effects, so long as @e@ is /somewhere/ in
33+-- the list.
3434--
35−-- For example, an operation that only needs access to a cell of mutable state
36−-- containing an 'Integer' would likely use the following type:
35+-- For example, an operation that only needs access to a mutable value of type
36+-- 'Integer' would likely use the following type:
3737--
3838-- @
3939-- 'Effectful.State.State' 'Integer' ':>' es => 'Effectful.Monad.Eff' es ()
effectful-core/src/Effectful/Internal/Monad.hs+2−2
@@ -88,8 +88,8 @@ type role Eff nominal representational
8888-- an arbitrary set of effects. In @'Eff' es a@, @es@ is a type-level list that
8989-- contains all the effects that the operation may perform. For example, an
9090-- operation that produces an 'Integer' by consuming a 'String' from the global
91−-- environment and acting upon a single mutable cell containing a 'Bool' would
92−-- have the following type:
91+-- environment and acting upon a single mutable value of type 'Bool' would have
92+-- the following type:
9393--
9494-- @
9595-- 'Eff' '['Effectful.Reader.Reader' 'String', 'Effectful.State.State' 'Bool'] 'Integer'
effectful-core/src/Effectful/Internal/Unlift.hs+3−2
@@ -35,8 +35,9 @@ import Effectful.Internal.Utils
3535----------------------------------------
3636-- Unlift strategies
3737
38−-- | The strategy to use when unlifting 'Eff' operations via 'withRunInIO' or
39−-- the 'Effectful.Interpreter.localUnlift' family.
38+-- | The strategy to use when unlifting 'Eff' operations via 'withRunInIO',
39+-- 'Effectful.Monad.withEffToIO' or the 'Effectful.Dispatch.Dynamic.localUnlift'
40+-- family.
4041data UnliftStrategy
4142 = SeqUnlift
4243 -- ^ The fastest strategy and a default setting for 'IOE'. An attempt to call
effectful-core/src/Effectful/Reader.hs+1−1
@@ -1,4 +1,4 @@
1−-- | The 'Reader' effect.
1+-- | Support for access to a read only value of a particular type.
22module Effectful.Reader
33 ( Reader
44 , runReader
effectful-core/src/Effectful/State/Dynamic.hs+1−1
@@ -27,7 +27,7 @@ import Effectful.Monad
2727import qualified Effectful.State.Local as L
2828import qualified Effectful.State.Shared as S
2929
30−-- | Provide access to a mutable state of type @s@.
30+-- | Provide access to a mutable value of type @s@.
3131data State s :: Effect where
3232 Get :: State s m s
3333 Put :: s -> State s m ()
effectful-core/src/Effectful/State/Local.hs+3−5
@@ -1,8 +1,6 @@
1−-- | The 'State' effect.
1+-- | Support for access to a mutable value of a particular type, which is:
22--
3−-- Represented as a pure value underneath, therefore:
4−--
5−-- - thread local (if you need the state to be shared between threads, have a
3+-- - thread local (if you want the value to be shared between threads, have a
64-- look at "Effectful.State.Shared"),
75--
86-- - very fast.
@@ -24,7 +22,7 @@ module Effectful.State.Local
2422import Effectful.Dispatch.Static
2523import Effectful.Monad
2624
27−-- | Provide access to a strict (WHNF), thread local, mutable state of type @s@.
25+-- | Provide access to a strict (WHNF), thread local, mutable value of type @s@.
2826newtype State s :: Effect where
2927 State :: s -> State s m r
3028
effectful-core/src/Effectful/State/Shared.hs+4−5
@@ -1,8 +1,7 @@
1−-- | The 'State' effect.
1+-- | Support for access to a mutable value of a particular type, which is:
22--
3−-- Represented as an 'MVar' underneath, therefore:
4−--
5−-- - shareable between multiple threads,
3+-- - shareable between multiple threads (if you want each thead to manage their
4+-- own version of the value, see "Effectful.State.Local").
65--
76-- - slower than "Effectful.State.Local".
87--
@@ -25,7 +24,7 @@ import Control.Concurrent.MVar
2524import Effectful.Dispatch.Static
2625import Effectful.Monad
2726
28−-- | Provide access to a strict (WHNF), shareable, mutable state of type @s@.
27+-- | Provide access to a strict (WHNF), shareable, mutable value of type @s@.
2928newtype State s :: Effect where
3029 State :: MVar s -> State s m r
3130
effectful-core/src/Effectful/Writer/Local.hs+3−5
@@ -1,8 +1,6 @@
1−-- | The 'Writer' effect.
1+-- | Support for access to a write only value of a particular type, which is:
22--
3−-- Represented as a pure value underneath, therefore:
4−--
5−-- - thread local (if you need the state to be shared between threads, have a
3+-- - thread local (if you want the value to be shared between threads, have a
64-- look at "Effectful.Writer.Shared"),
75--
86-- - very fast.
@@ -16,7 +14,7 @@
1614-- @transformers@ package includes additional operations
1715-- 'Control.Monad.Trans.Writer.Strict.pass' and
1816-- 'Control.Monad.Trans.Writer.Strict.censor', they don't cooperate with runtime
19−-- exceptions very well, so they're deliberately omitted.
17+-- exceptions very well, so they're deliberately omitted here.
2018module Effectful.Writer.Local
2119 ( Writer
2220 , runWriter
effectful-core/src/Effectful/Writer/Shared.hs+4−5
@@ -1,8 +1,7 @@
1−-- | The 'Writer' effect.
1+-- | Support for access to a write only value of a particular type, which is:
22--
3−-- Represented as an 'MVar' underneath, therefore:
4−--
5−-- - shareable between multiple threads,
3+-- - shareable between multiple threads (if you want each thead to manage their
4+-- own version of the value, see "Effectful.Writer.Local").
65--
76-- - slower than "Effectful.Writer.Local".
87--
@@ -15,7 +14,7 @@
1514-- @transformers@ package includes additional operations
1615-- 'Control.Monad.Trans.Writer.Strict.pass' and
1716-- 'Control.Monad.Trans.Writer.Strict.censor', they don't cooperate with runtime
18−-- exceptions very well, so they're deliberately omitted.
17+-- exceptions very well, so they're deliberately omitted here.
1918module Effectful.Writer.Shared
2019 ( Writer
2120 , runWriter