mirror of
https://github.com/haskell-effectful/effectful.git
synced 2024-11-23 06:22:28 +03:00
Make use of ImportQualifiedPost everywhere
This commit is contained in:
parent
fa24ccaa68
commit
0e6d596919
@ -199,8 +199,8 @@ import Effectful.Internal.Monad
|
||||
--
|
||||
-- As an example, consider the following monad:
|
||||
--
|
||||
-- >>> import qualified Control.Monad.State as T
|
||||
-- >>> import qualified Control.Monad.Except as T
|
||||
-- >>> import Control.Monad.State qualified as T
|
||||
-- >>> import Control.Monad.Except qualified as T
|
||||
--
|
||||
-- >>> data HandlerState
|
||||
-- >>> data HandlerError
|
||||
|
@ -153,10 +153,9 @@ import Effectful.Internal.Utils
|
||||
-- The following defines an 'EffectHandler' that reads and writes files from the
|
||||
-- drive:
|
||||
--
|
||||
-- >>> import qualified System.IO as IO
|
||||
--
|
||||
-- >>> import Effectful.Error.Static
|
||||
-- >>> import Effectful.Exception
|
||||
-- >>> import System.IO qualified as IO
|
||||
--
|
||||
-- >>> newtype FsError = FsError String deriving Show
|
||||
--
|
||||
@ -178,8 +177,7 @@ import Effectful.Internal.Utils
|
||||
-- On the other hand, maybe there is a situation in which instead of interacting
|
||||
-- with the outside world, a pure, in-memory storage is preferred:
|
||||
--
|
||||
-- >>> import qualified Data.Map.Strict as M
|
||||
--
|
||||
-- >>> import Data.Map.Strict qualified as M
|
||||
-- >>> import Effectful.State.Static.Local
|
||||
--
|
||||
-- >>> :{
|
||||
|
@ -7,7 +7,7 @@
|
||||
-- In particular, regular exceptions of type @e@ are distinct from errors of
|
||||
-- type @e@ and will __not__ be caught by functions from this module:
|
||||
--
|
||||
-- >>> import qualified Effectful.Exception as E
|
||||
-- >>> import Effectful.Exception qualified as E
|
||||
--
|
||||
-- >>> boom = error "BOOM!"
|
||||
--
|
||||
@ -43,8 +43,8 @@
|
||||
-- effect with regard to other stateful effects does not matter. Consider the
|
||||
-- following:
|
||||
--
|
||||
-- >>> import qualified Control.Monad.State.Strict as T
|
||||
-- >>> import qualified Control.Monad.Except as T
|
||||
-- >>> import Control.Monad.State.Strict qualified as T
|
||||
-- >>> import Control.Monad.Except qualified as T
|
||||
--
|
||||
-- >>> m1 = (T.modify (++ " there!") >> T.throwError "oops") `T.catchError` \_ -> pure ()
|
||||
--
|
||||
|
@ -37,9 +37,9 @@ import Effectful.Internal.Utils
|
||||
-- $example
|
||||
--
|
||||
-- >>> import Control.Monad.IO.Class
|
||||
-- >>> import Data.Map.Strict qualified as M
|
||||
-- >>> import Effectful.Dispatch.Dynamic
|
||||
-- >>> import Effectful.State.Static.Local
|
||||
-- >>> import qualified Data.Map.Strict as M
|
||||
--
|
||||
-- Given an effect:
|
||||
--
|
||||
|
@ -7,7 +7,7 @@
|
||||
-- the @transformers@ library, the 'State' effect doesn't discard state updates
|
||||
-- when an exception is received:
|
||||
--
|
||||
-- >>> import qualified Control.Monad.Trans.State.Strict as S
|
||||
-- >>> import Control.Monad.Trans.State.Strict qualified as S
|
||||
--
|
||||
-- >>> :{
|
||||
-- (`S.execStateT` "Hi") . handle (\(_::ErrorCall) -> pure ()) $ do
|
||||
|
@ -7,7 +7,7 @@
|
||||
-- the @transformers@ library, the 'State' effect doesn't discard state updates
|
||||
-- when an exception is received:
|
||||
--
|
||||
-- >>> import qualified Control.Monad.Trans.State.Strict as S
|
||||
-- >>> import Control.Monad.Trans.State.Strict qualified as S
|
||||
--
|
||||
-- >>> :{
|
||||
-- (`S.execStateT` "Hi") . handle (\(_::ErrorCall) -> pure ()) $ do
|
||||
|
@ -17,7 +17,7 @@ import Effectful.Dispatch.Static
|
||||
-- it possible to escape the scope of any scoped effect operation. Consider the
|
||||
-- following:
|
||||
--
|
||||
-- >>> import qualified Effectful.Reader.Static as R
|
||||
-- >>> import Effectful.Reader.Static qualified as R
|
||||
--
|
||||
-- >>> printAsk msg = liftIO . putStrLn . (msg ++) . (": " ++) =<< R.ask
|
||||
--
|
||||
@ -54,14 +54,14 @@ import Effectful.Dispatch.Static
|
||||
-- a mutable state. That's why statically dispatched @State@ and @Writer@
|
||||
-- effects come in two flavors, local and shared:
|
||||
--
|
||||
-- >>> import qualified Effectful.State.Static.Local as SL
|
||||
-- >>> import Effectful.State.Static.Local qualified as SL
|
||||
-- >>> :{
|
||||
-- runEff . SL.execState "Hi" . runConcurrent $ do
|
||||
-- replicateConcurrently_ 3 $ SL.modify (++ "!")
|
||||
-- :}
|
||||
-- "Hi"
|
||||
--
|
||||
-- >>> import qualified Effectful.State.Static.Shared as SS
|
||||
-- >>> import Effectful.State.Static.Shared qualified as SS
|
||||
-- >>> :{
|
||||
-- runEff . SS.execState "Hi" . runConcurrent $ do
|
||||
-- replicateConcurrently_ 3 $ SS.modify (++ "!")
|
||||
|
@ -4,9 +4,9 @@
|
||||
-- to avoid name clashes with the functions provided by "Prelude", e.g.:
|
||||
--
|
||||
-- > import Data.ByteString (ByteString)
|
||||
-- > import qualified Data.ByteString.Char8 as BS8
|
||||
-- > import Data.ByteString.Char8 qualified as BS8
|
||||
-- > import Effectful.Console.ByteString (Console)
|
||||
-- > import qualified Effectful.Console.ByteString as Console
|
||||
-- > import Effectful.Console.ByteString qualified as Console
|
||||
--
|
||||
module Effectful.Console.ByteString
|
||||
( -- * Effect
|
||||
|
@ -4,9 +4,9 @@
|
||||
-- to avoid name clashes with the functions provided by "Prelude", e.g.:
|
||||
--
|
||||
-- > import Data.ByteString.Lazy.Char8 (ByteString)
|
||||
-- > import qualified Data.ByteString.Lazy.Char8 as LBS8
|
||||
-- > import Data.ByteString.Lazy.Char8 qualified as LBS8
|
||||
-- > import Effectful.Console.ByteString.Lazy (Console)
|
||||
-- > import qualified Effectful.Console.ByteString.Lazy as Console
|
||||
-- > import Effectful.Console.ByteString.Lazy qualified as Console
|
||||
--
|
||||
module Effectful.Console.ByteString.Lazy
|
||||
( -- * Effect
|
||||
|
@ -5,8 +5,8 @@
|
||||
-- to avoid name clashes with the functions provided by "Prelude", e.g.:
|
||||
--
|
||||
-- > import Data.ByteString (ByteString)
|
||||
-- > import qualified Data.ByteString as BS
|
||||
-- > import qualified Effectful.FileSystem.IO.ByteString as EBS
|
||||
-- > import Data.ByteString qualified as BS
|
||||
-- > import Effectful.FileSystem.IO.ByteString qualified as EBS
|
||||
--
|
||||
module Effectful.FileSystem.IO.ByteString
|
||||
#if MIN_VERSION_bytestring(0,11,2)
|
||||
|
@ -5,8 +5,8 @@
|
||||
-- to avoid name clashes with the functions provided by "Prelude", e.g.:
|
||||
--
|
||||
-- > import Data.ByteString.Builder (Builder)
|
||||
-- > import qualified Data.ByteString.Builder as BSB
|
||||
-- > import qualified Effectful.FileSystem.IO.ByteString.Builder as EBSB
|
||||
-- > import Data.ByteString.Builder qualified as BSB
|
||||
-- > import Effectful.FileSystem.IO.ByteString.Builder qualified as EBSB
|
||||
--
|
||||
module Effectful.FileSystem.IO.ByteString.Builder
|
||||
( -- * Executing Builders
|
||||
|
@ -3,8 +3,8 @@
|
||||
-- to avoid name clashes with the functions provided by "Prelude", e.g.:
|
||||
--
|
||||
-- > import Data.ByteString.Lazy (ByteString)
|
||||
-- > import qualified Data.ByteString.Lazy.Char8 as LBS8
|
||||
-- > import qualified Effectful.FileSystem.IO.ByteString.Lazy as ELBS
|
||||
-- > import Data.ByteString.Lazy.Char8 qualified as LBS8
|
||||
-- > import Effectful.FileSystem.IO.ByteString.Lazy qualified as ELBS
|
||||
--
|
||||
module Effectful.FileSystem.IO.ByteString.Lazy
|
||||
( -- * Files
|
||||
|
Loading…
Reference in New Issue
Block a user