Skip to content

Commit a940771

Browse files
authored
Merge pull request #4 from mmhat/reuse-process-effect
Reuse Process effect
2 parents 9ab8c60 + 4cd31b6 commit a940771

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
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: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ bug-reports:
2020
https://github.com/haskell-effectful/typed-process-effectful/issues
2121

2222
author: Dominik Peteler
23-
maintainer: Dominik Peteler
23+
maintainer: hackage+typed-process-effectful@with-h.at
2424
license: BSD-3-Clause
2525
build-type: Simple
26-
extra-source-files:
26+
extra-doc-files:
2727
CHANGELOG.md
2828
LICENSE.md
2929
README.md
@@ -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)