polysemy-process-0.6.0.1: Polysemy Effects for System Processes
Safe HaskellSafe-Inferred
LanguageHaskell2010

Polysemy.Process.SystemProcess

Description

The effect SystemProcess is a low-level abstraction of a native system process.

Synopsis

Documentation

data SystemProcess :: Effect where Source #

Low-level interface for a process, operating on raw chunks of bytes. Interface is modeled after System.Process.

Constructors

ReadStdout :: SystemProcess m ByteString

Read a chunk from stdout.

ReadStderr :: SystemProcess m ByteString

Read a chunk from stderr.

WriteStdin :: ByteString -> SystemProcess m ()

Write a ByteString to stdin.

Pid :: SystemProcess m Pid

Obtain the process ID.

Signal :: Signal -> SystemProcess m ()

Send a Signal to the process.

Wait :: SystemProcess m ExitCode

Wait for the process to terminate, returning its exit code.

Instances

Instances details
type DefiningModule SystemProcess Source # 
Instance details

Defined in Polysemy.Process.Effect.SystemProcess

type DefiningModule SystemProcess = "Polysemy.Process.Effect.SystemProcess"

withSystemProcess :: forall resource err r. Member (Scoped resource (SystemProcess !! err)) r => InterpreterFor (SystemProcess !! err) r Source #

Create a scoped resource for SystemProcess.

interrupt :: Member SystemProcess r => Sem r () Source #

Send signal INT(2) to the process.

interpretSystemProcessNativeSingle :: forall r. Members [Resource, Embed IO] r => ProcessConfig () () () -> InterpreterFor (SystemProcess !! SystemProcessError) r Source #

Interpret SystemProcess as a single global Process that's started immediately.

interpretSystemProcessNative :: forall r. Members [Resource, Embed IO] r => ProcessConfig () () () -> InterpreterFor (Scoped PipesProcess (SystemProcess !! SystemProcessError)) r Source #

Interpret SystemProcess as a scoped Process that's started wherever withSystemProcess is called and terminated when the wrapped action finishes.