module Polysemy.Process.Interpreter.ProcessIO where
import Polysemy.Process.Effect.ProcessInput (ProcessInput)
import Polysemy.Process.Effect.ProcessOutput (OutputPipe (Stderr, Stdout), ProcessOutput)
import Polysemy.Process.Interpreter.ProcessInput (interpretProcessInputId, interpretProcessInputText)
import Polysemy.Process.Interpreter.ProcessOutput (
interpretProcessOutputId,
interpretProcessOutputIgnore,
interpretProcessOutputLines,
interpretProcessOutputText,
interpretProcessOutputTextLines,
)
type ProcessIO i o =
[
ProcessInput i,
ProcessOutput 'Stdout o,
ProcessOutput 'Stderr o
]
interpretProcessByteString ::
InterpretersFor (ProcessIO ByteString ByteString) r
interpretProcessByteString :: forall (r :: [Effect]).
InterpretersFor (ProcessIO ByteString ByteString) r
interpretProcessByteString =
forall (p :: OutputPipe) a (r :: [Effect]).
InterpreterFor (ProcessOutput p a) r
interpretProcessOutputIgnore @'Stderr (Sem (ProcessOutput 'Stderr ByteString : r) a -> Sem r a)
-> (Sem
(ProcessInput ByteString
: ProcessOutput 'Stdout ByteString
: ProcessOutput 'Stderr ByteString : r)
a
-> Sem (ProcessOutput 'Stderr ByteString : r) a)
-> Sem
(ProcessInput ByteString
: ProcessOutput 'Stdout ByteString
: ProcessOutput 'Stderr ByteString : r)
a
-> Sem r a
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
forall (p :: OutputPipe) (r :: [Effect]).
InterpreterFor (ProcessOutput p ByteString) r
interpretProcessOutputId @'Stdout (Sem
(ProcessOutput 'Stdout ByteString
: ProcessOutput 'Stderr ByteString : r)
a
-> Sem (ProcessOutput 'Stderr ByteString : r) a)
-> (Sem
(ProcessInput ByteString
: ProcessOutput 'Stdout ByteString
: ProcessOutput 'Stderr ByteString : r)
a
-> Sem
(ProcessOutput 'Stdout ByteString
: ProcessOutput 'Stderr ByteString : r)
a)
-> Sem
(ProcessInput ByteString
: ProcessOutput 'Stdout ByteString
: ProcessOutput 'Stderr ByteString : r)
a
-> Sem (ProcessOutput 'Stderr ByteString : r) a
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
Sem
(ProcessInput ByteString
: ProcessOutput 'Stdout ByteString
: ProcessOutput 'Stderr ByteString : r)
a
-> Sem
(ProcessOutput 'Stdout ByteString
: ProcessOutput 'Stderr ByteString : r)
a
forall (r :: [Effect]). InterpreterFor (ProcessInput ByteString) r
interpretProcessInputId
interpretProcessByteStringLines ::
InterpretersFor (ProcessIO ByteString ByteString) r
interpretProcessByteStringLines :: forall (r :: [Effect]).
InterpretersFor (ProcessIO ByteString ByteString) r
interpretProcessByteStringLines =
forall (p :: OutputPipe) a (r :: [Effect]).
InterpreterFor (ProcessOutput p a) r
interpretProcessOutputIgnore @'Stderr (Sem (ProcessOutput 'Stderr ByteString : r) a -> Sem r a)
-> (Sem
(ProcessInput ByteString
: ProcessOutput 'Stdout ByteString
: ProcessOutput 'Stderr ByteString : r)
a
-> Sem (ProcessOutput 'Stderr ByteString : r) a)
-> Sem
(ProcessInput ByteString
: ProcessOutput 'Stdout ByteString
: ProcessOutput 'Stderr ByteString : r)
a
-> Sem r a
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
forall (p :: OutputPipe) (r :: [Effect]).
InterpreterFor (ProcessOutput p ByteString) r
interpretProcessOutputLines @'Stdout (Sem
(ProcessOutput 'Stdout ByteString
: ProcessOutput 'Stderr ByteString : r)
a
-> Sem (ProcessOutput 'Stderr ByteString : r) a)
-> (Sem
(ProcessInput ByteString
: ProcessOutput 'Stdout ByteString
: ProcessOutput 'Stderr ByteString : r)
a
-> Sem
(ProcessOutput 'Stdout ByteString
: ProcessOutput 'Stderr ByteString : r)
a)
-> Sem
(ProcessInput ByteString
: ProcessOutput 'Stdout ByteString
: ProcessOutput 'Stderr ByteString : r)
a
-> Sem (ProcessOutput 'Stderr ByteString : r) a
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
Sem
(ProcessInput ByteString
: ProcessOutput 'Stdout ByteString
: ProcessOutput 'Stderr ByteString : r)
a
-> Sem
(ProcessOutput 'Stdout ByteString
: ProcessOutput 'Stderr ByteString : r)
a
forall (r :: [Effect]). InterpreterFor (ProcessInput ByteString) r
interpretProcessInputId
interpretProcessText ::
InterpretersFor (ProcessIO Text Text) r
interpretProcessText :: forall (r :: [Effect]). InterpretersFor (ProcessIO Text Text) r
interpretProcessText =
forall (p :: OutputPipe) a (r :: [Effect]).
InterpreterFor (ProcessOutput p a) r
interpretProcessOutputIgnore @'Stderr (Sem (ProcessOutput 'Stderr Text : r) a -> Sem r a)
-> (Sem
(ProcessInput Text
: ProcessOutput 'Stdout Text : ProcessOutput 'Stderr Text : r)
a
-> Sem (ProcessOutput 'Stderr Text : r) a)
-> Sem
(ProcessInput Text
: ProcessOutput 'Stdout Text : ProcessOutput 'Stderr Text : r)
a
-> Sem r a
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
forall (p :: OutputPipe) (r :: [Effect]).
InterpreterFor (ProcessOutput p Text) r
interpretProcessOutputText @'Stdout (Sem
(ProcessOutput 'Stdout Text : ProcessOutput 'Stderr Text : r) a
-> Sem (ProcessOutput 'Stderr Text : r) a)
-> (Sem
(ProcessInput Text
: ProcessOutput 'Stdout Text : ProcessOutput 'Stderr Text : r)
a
-> Sem
(ProcessOutput 'Stdout Text : ProcessOutput 'Stderr Text : r) a)
-> Sem
(ProcessInput Text
: ProcessOutput 'Stdout Text : ProcessOutput 'Stderr Text : r)
a
-> Sem (ProcessOutput 'Stderr Text : r) a
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
Sem
(ProcessInput Text
: ProcessOutput 'Stdout Text : ProcessOutput 'Stderr Text : r)
a
-> Sem
(ProcessOutput 'Stdout Text : ProcessOutput 'Stderr Text : r) a
forall (r :: [Effect]). InterpreterFor (ProcessInput Text) r
interpretProcessInputText
interpretProcessTextLines ::
InterpretersFor (ProcessIO Text Text) r
interpretProcessTextLines :: forall (r :: [Effect]). InterpretersFor (ProcessIO Text Text) r
interpretProcessTextLines =
forall (p :: OutputPipe) a (r :: [Effect]).
InterpreterFor (ProcessOutput p a) r
interpretProcessOutputIgnore @'Stderr (Sem (ProcessOutput 'Stderr Text : r) a -> Sem r a)
-> (Sem
(ProcessInput Text
: ProcessOutput 'Stdout Text : ProcessOutput 'Stderr Text : r)
a
-> Sem (ProcessOutput 'Stderr Text : r) a)
-> Sem
(ProcessInput Text
: ProcessOutput 'Stdout Text : ProcessOutput 'Stderr Text : r)
a
-> Sem r a
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
forall (p :: OutputPipe) (r :: [Effect]).
InterpreterFor (ProcessOutput p Text) r
interpretProcessOutputTextLines @'Stdout (Sem
(ProcessOutput 'Stdout Text : ProcessOutput 'Stderr Text : r) a
-> Sem (ProcessOutput 'Stderr Text : r) a)
-> (Sem
(ProcessInput Text
: ProcessOutput 'Stdout Text : ProcessOutput 'Stderr Text : r)
a
-> Sem
(ProcessOutput 'Stdout Text : ProcessOutput 'Stderr Text : r) a)
-> Sem
(ProcessInput Text
: ProcessOutput 'Stdout Text : ProcessOutput 'Stderr Text : r)
a
-> Sem (ProcessOutput 'Stderr Text : r) a
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
Sem
(ProcessInput Text
: ProcessOutput 'Stdout Text : ProcessOutput 'Stderr Text : r)
a
-> Sem
(ProcessOutput 'Stdout Text : ProcessOutput 'Stderr Text : r) a
forall (r :: [Effect]). InterpreterFor (ProcessInput Text) r
interpretProcessInputText