Skip to content

Commit 72c5002

Browse files
committed
Made TypedProcess/runTypedProcess aliases of Process/runProcess provided by Effectful.Process
Also adjusted version bounds.
1 parent 9ab8c60 commit 72c5002

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

src/Effectful/Process/Typed.hs

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,23 +71,27 @@ import System.Process.Typed as Reexport hiding
7171
import Data.ByteString.Lazy (ByteString)
7272
import qualified System.Process.Typed as PT
7373

74-
import Effectful.Internal.Effect
75-
import Effectful.Internal.Monad
76-
import Effectful (Dispatch(..), DispatchOf)
77-
import Effectful.Dispatch.Static (SideEffects(..))
74+
import Effectful
75+
import qualified Effectful.Process
76+
import Effectful.Dispatch.Static
7877

7978
#if ! MIN_VERSION_typed_process(0,2,8)
8079
import System.Exit (ExitCode(..))
8180
#endif
8281

83-
-- | An effect for running child processes using the @typed-process@ library.
84-
data TypedProcess :: Effect
82+
----------------------------------------
83+
-- Effect & Handler
8584

86-
type instance DispatchOf TypedProcess = 'Static 'WithSideEffects
87-
data instance StaticRep TypedProcess = TypedProcess
85+
-- | We provide a type synonym for the 'Effectful.Process.Process' effect since
86+
-- it clashes with 'PT.Process' type of @typed-process@.
87+
type TypedProcess = Effectful.Process.Process
8888

89+
-- | This is merely an alias for 'Effectful.Process.runProcess' since that name
90+
-- clashes with 'runProcess', i.e.:
91+
--
92+
-- > runTypedProcess = Effectful.Process.runProcess
8993
runTypedProcess :: IOE :> es => Eff (TypedProcess : es) a -> Eff es a
90-
runTypedProcess = evalStaticRep TypedProcess
94+
runTypedProcess = Effectful.Process.runProcess
9195

9296
----------------------------------------
9397
-- Launch a process

typed-process-effectful.cabal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ library
5353
build-depends:
5454
, base >=4.14 && <5
5555
, bytestring <0.12
56+
, effectful >=2.0 && <2.3
5657
, effectful-core >=2.0 && <2.3
5758
, typed-process >=0.2.5 && <0.3
5859

0 commit comments

Comments
 (0)