Skip to content

Commit

Permalink
Make use of ImportQualifiedPost everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
arybczak committed Oct 5, 2024
1 parent fa24cca commit 0e6d596
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 25 deletions.
4 changes: 2 additions & 2 deletions effectful-core/src/Effectful.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions effectful-core/src/Effectful/Dispatch/Dynamic.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
--
Expand All @@ -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
--
-- >>> :{
Expand Down
6 changes: 3 additions & 3 deletions effectful-core/src/Effectful/Error/Static.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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!"
--
Expand Down Expand Up @@ -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 ()
--
Expand Down
2 changes: 1 addition & 1 deletion effectful-core/src/Effectful/Provider.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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:
--
Expand Down
2 changes: 1 addition & 1 deletion effectful-core/src/Effectful/State/Static/Local.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion effectful-core/src/Effectful/State/Static/Shared.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions effectful/src/Effectful/Concurrent/Effect.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
--
Expand Down Expand Up @@ -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 (++ "!")
Expand Down
4 changes: 2 additions & 2 deletions effectful/src/Effectful/Console/ByteString.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions effectful/src/Effectful/Console/ByteString/Lazy.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions effectful/src/Effectful/FileSystem/IO/ByteString.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions effectful/src/Effectful/FileSystem/IO/ByteString/Builder.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions effectful/src/Effectful/FileSystem/IO/ByteString/Lazy.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0e6d596

Please sign in to comment.