polysemy-process 0.11.1.0 → 0.12.0.0
raw patch · 10 files changed
+32/−35 lines, 10 filesdep ~incipit-coredep ~polysemydep ~polysemy-concPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: incipit-core, polysemy, polysemy-conc, polysemy-resume, polysemy-time
API changes (from Hackage documentation)
Files
- lib/Polysemy/Process/Data/ProcessOutputParseResult.hs +0/−2
- lib/Polysemy/Process/Effect/Process.hs +1/−1
- lib/Polysemy/Process/Effect/Pty.hs +1/−1
- lib/Polysemy/Process/Effect/SystemProcess.hs +1/−1
- lib/Polysemy/Process/Interpreter/Process.hs +9/−7
- lib/Polysemy/Process/Interpreter/ProcessOneshot.hs +3/−4
- lib/Polysemy/Process/Interpreter/Pty.hs +2/−3
- lib/Polysemy/Process/Interpreter/SystemProcess.hs +4/−5
- polysemy-process.cabal +10/−10
- test/Polysemy/Process/Test/ProcessTest.hs +1/−1
lib/Polysemy/Process/Data/ProcessOutputParseResult.hs view
@@ -1,8 +1,6 @@ -- |A data type encoding the result of an incremental parser for process output. module Polysemy.Process.Data.ProcessOutputParseResult where -import Text.Show (showParen, showString, showsPrec)- -- |An incremental parse result, potentially a partial result containing a continuation function. data ProcessOutputParseResult a = Done { value :: a, leftover :: ByteString }
lib/Polysemy/Process/Effect/Process.hs view
@@ -3,7 +3,7 @@ -- |Description: Process Effect, Internal module Polysemy.Process.Effect.Process where -import Polysemy.Conc.Effect.Scoped (Scoped, Scoped_, scoped, scoped_)+import Polysemy.Scoped (Scoped, Scoped_, scoped, scoped_) import Polysemy.Input (Input (Input)) import Polysemy.Output (Output (Output)) import Polysemy.Resume (interpretResumable, restop, type (!!))
lib/Polysemy/Process/Effect/Pty.hs view
@@ -3,7 +3,7 @@ -- |Description: Pty Effect, Internal module Polysemy.Process.Effect.Pty where -import Polysemy.Conc.Effect.Scoped (Scoped_, scoped_)+import Polysemy.Scoped (Scoped_, scoped_) import System.IO (Handle) -- |Horizontal size of a pseudo terminal in characters.
lib/Polysemy/Process/Effect/SystemProcess.hs view
@@ -3,7 +3,7 @@ -- |Description: SystemProcess Effect, Internal module Polysemy.Process.Effect.SystemProcess where -import Polysemy.Conc.Effect.Scoped (Scoped, Scoped_, scoped, scoped_)+import Polysemy.Scoped (Scoped, Scoped_, scoped, scoped_) import Polysemy.Resume (type (!!)) import System.Exit (ExitCode) import qualified System.Posix as Signal
lib/Polysemy/Process/Interpreter/Process.hs view
@@ -10,18 +10,18 @@ import qualified Polysemy.Conc.Effect.Queue as Queue import Polysemy.Conc.Effect.Queue (Queue) import Polysemy.Conc.Effect.Race (Race)-import Polysemy.Conc.Effect.Scoped (Scoped, Scoped_) import qualified Polysemy.Conc.Effect.Sync as Sync import Polysemy.Conc.Effect.Sync (Sync) import Polysemy.Conc.Interpreter.Queue.TBM (interpretQueueTBMWith, withTBMQueue)-import Polysemy.Conc.Interpreter.Scoped (interpretScopedResumableWith_) import Polysemy.Conc.Interpreter.Sync (interpretSync) import qualified Polysemy.Conc.Race as Conc (timeout_) import Polysemy.Input (Input (Input))+import Polysemy.Opaque (Opaque) import Polysemy.Output (Output (Output)) import Polysemy.Resume ( Stop, interpretResumable,+ interpretScopedResumableWith_, mapStop, restop, resumeHoist,@@ -31,6 +31,7 @@ stopNote, type (!!), )+import Polysemy.Scoped (Scoped, Scoped_) import Prelude hiding (fromException) import System.IO (BufferMode (NoBuffering), Handle, hSetBuffering, stdin, stdout) @@ -262,12 +263,13 @@ interpretScopedResumableWith_ @(ScopeEffects i o SystemProcessError) acq (handleProcessWithQueues terminated) where acq ::+ ∀ e a . param ->- Sem (ScopeEffects i o SystemProcessError ++ Stop ProcessError : r) a ->- Sem (Stop ProcessError : r) a+ Sem (ScopeEffects i o SystemProcessError ++ Stop ProcessError : Opaque e : r) a ->+ Sem (Stop ProcessError : Opaque e : r) a acq p sem = mapStop ProcessError.StartFailed do- pscope @SystemProcessScopeError options (raise . proc) p (insertAt @4 sem)+ pscope @SystemProcessScopeError options (raise . raiseUnder . proc) p (insertAt @4 sem) -- |Interpret 'Process' with a system process resource whose file descriptors are connected to three 'TBMQueue's, -- deferring decoding of stdout and stderr to the interpreters of two 'ProcessOutput' effects.@@ -286,8 +288,8 @@ where acq :: () ->- Sem (ScopeEffects i o SystemProcessError ++ Stop ProcessError : r) a ->- Sem (Stop ProcessError : r) a+ Sem (ScopeEffects i o SystemProcessError ++ Stop ProcessError : Opaque e : r) a ->+ Sem (Stop ProcessError : Opaque e : r) a acq () sem = mapStop ProcessError.StartFailed do scope @SystemProcessScopeError options (insertAt @4 sem)
lib/Polysemy/Process/Interpreter/ProcessOneshot.hs view
@@ -2,9 +2,8 @@ module Polysemy.Process.Interpreter.ProcessOneshot where import Polysemy.Conc.Effect.Race (Race)-import Polysemy.Conc.Effect.Scoped (Scoped, Scoped_)-import Polysemy.Conc.Interpreter.Scoped (interpretScopedRWith_)-import Polysemy.Resume (Stop, type (!!))+import Polysemy.Resume (Stop, interpretScopedRWith_, type (!!))+import Polysemy.Scoped (Scoped, Scoped_) import Polysemy.Process.Data.ProcessError (ProcessError) import Polysemy.Process.Data.ProcessOptions (ProcessOptions)@@ -33,7 +32,7 @@ InterpreterFor (Scoped param (Process i o !! ProcessError) !! SystemProcessScopeError) r interpretProcessOneshot options proc = interpretScopedRWith_ @(ScopeEffects i o SystemProcessError)- (\ p -> pscope @SystemProcessScopeError options proc p)+ (\ p -> pscope @SystemProcessScopeError options (raiseUnder . proc) p) (handleProcessWithQueues terminated) -- |Variant of 'interpretProcessOneshot' that takes a static 'SysProcConf'.
lib/Polysemy/Process/Interpreter/Pty.hs view
@@ -3,9 +3,8 @@ -- |Description: Pty Interpreters, Internal module Polysemy.Process.Interpreter.Pty where -import Polysemy.Conc.Effect.Scoped (Scoped_)-import Polysemy.Conc.Interpreter.Scoped (interpretScopedResumable)-import Polysemy.Resume (Stop, stopEitherWith, stopNote, type (!!))+import Polysemy.Resume (Stop, interpretScopedResumable, stopEitherWith, stopNote, type (!!))+import Polysemy.Scoped (Scoped_) import System.Posix (closeFd, fdToHandle, openPseudoTerminal) import System.Posix.Pty (closePty, createPty, ptyDimensions, resizePty)
lib/Polysemy/Process/Interpreter/SystemProcess.hs view
@@ -4,9 +4,8 @@ module Polysemy.Process.Interpreter.SystemProcess where import Data.ByteString (hGetSome, hPut)-import Polysemy.Conc.Effect.Scoped (Scoped, Scoped_)-import Polysemy.Conc.Interpreter.Scoped (interpretScopedR, runScoped)-import Polysemy.Resume (Stop, interpretResumable, stop, stopNote, stopTryIOError, type (!!))+import Polysemy.Resume (Stop, interpretResumable, interpretScopedR, stop, stopNote, stopTryIOError, type (!!))+import Polysemy.Scoped (Scoped, Scoped_, runScopedNew) import Prelude hiding (fromException) import System.IO (BufferMode (NoBuffering), Handle, hSetBuffering) import qualified System.Posix as Signal@@ -174,7 +173,7 @@ (param -> Sem r (Either Text SysProcConf)) -> InterpreterFor (Scoped param (SystemProcess !! SystemProcessError) !! SystemProcessScopeError) r interpretSystemProcessNative config =- interpretScopedR (\ p u -> raise (config p) >>= withProcConf u) handleSystemProcessWithProcess+ interpretScopedR (\ p u -> raise (raise (config p)) >>= withProcConf u) handleSystemProcessWithProcess -- |Interpret 'SystemProcess' as a scoped 'System.Process' that's started wherever 'Polysemy.Process.withSystemProcess' -- is called and terminated when the wrapped action finishes.@@ -227,4 +226,4 @@ ProcessConfig i o e -> InterpreterFor (Scoped_ (SystemProcess !! SystemProcessError)) r interpretSystemProcessNativeOpaque config =- runScoped (const (withProcessOpaque config)) interpretSystemProcessWithProcessOpaque+ runScopedNew \ () -> interpretSystemProcessNativeOpaqueSingle config
polysemy-process.cabal view
@@ -1,15 +1,15 @@ cabal-version: 2.2 --- This file has been generated from package.yaml by hpack version 0.34.7.+-- This file has been generated from package.yaml by hpack version 0.35.0. -- -- see: https://github.com/sol/hpack name: polysemy-process-version: 0.11.1.0+version: 0.12.0.0 synopsis: Polysemy effects for system processes description: See https://hackage.haskell.org/package/polysemy-process/docs/Polysemy-Process.html category: Concurrency-homepage: https://github.com/tek/polysemy-conc#readme+homepage: https://git.tryp.io/tek/polysemy-conc bug-reports: https://github.com/tek/polysemy-conc/issues author: Torsten Schmits maintainer: hackage@tryp.io@@ -23,7 +23,7 @@ source-repository head type: git- location: https://github.com/tek/polysemy-conc+ location: https://git.tryp.io/tek/polysemy-conc library exposed-modules:@@ -120,13 +120,13 @@ ghc-options: -Wall -Wredundant-constraints -Wincomplete-uni-patterns -Wmissing-deriving-strategies -Widentities -Wunused-packages build-depends: base >=4.12 && <5- , incipit-core >=0.3+ , incipit-core >=0.4 , path ==0.9.* , path-io ==1.7.*- , polysemy >=1.6- , polysemy-conc >=0.11- , polysemy-resume >=0.5- , polysemy-time >=0.5+ , polysemy ==1.9.*+ , polysemy-conc ==0.12.*+ , polysemy-resume ==0.7.*+ , polysemy-time ==0.6.* , posix-pty >=0.2 , process , stm-chans >=3 && <3.1@@ -210,7 +210,7 @@ ghc-options: -Wall -Wredundant-constraints -Wincomplete-uni-patterns -Wmissing-deriving-strategies -Widentities -Wunused-packages -threaded -rtsopts -with-rtsopts=-N build-depends: base >=4.12 && <5- , incipit-core >=0.3+ , incipit-core >=0.4 , polysemy , polysemy-conc , polysemy-plugin
test/Polysemy/Process/Test/ProcessTest.hs view
@@ -5,7 +5,7 @@ import qualified Data.ByteString as ByteString import qualified Polysemy.Conc.Effect.Race as Conc (timeout) import Polysemy.Conc.Effect.Race (Race)-import Polysemy.Conc.Effect.Scoped (Scoped)+import Polysemy.Scoped (Scoped) import Polysemy.Conc.Interpreter.Race (interpretRace) import qualified Polysemy.Conc.Race as Race import Polysemy.Resume (resumeEither, resumeHoistAs, resumeHoistError, resuming, runStop, type (!!), (<!))