polysemy-process 0.12.1.0 → 0.13.0.0
raw patch · 4 files changed
+39/−93 lines, 4 filesdep ~basedep ~incipit-coredep ~path-ioPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base, incipit-core, path-io, polysemy-conc, polysemy-plugin, polysemy-resume, polysemy-test, polysemy-time, posix-pty, tasty, tasty-expected-failure
API changes (from Hackage documentation)
+ Polysemy.Process.Effect.ProcessInput: encode :: forall a_adtN r_adxC. Member (ProcessInput a_adtN) r_adxC => a_adtN -> Sem r_adxC ByteString
+ Polysemy.Process.Effect.ProcessOutput: chunk :: forall p_adBL a_adBM r_adE5. Member (ProcessOutput p_adBL a_adBM) r_adE5 => ByteString -> ByteString -> Sem r_adE5 ([a_adBM], ByteString)
+ Polysemy.Process.Effect.Pty: handle :: forall r_agZD. Member Pty r_agZD => Sem r_agZD Handle
+ Polysemy.Process.Effect.Pty: resize :: forall r_agZE. Member Pty r_agZE => Rows -> Cols -> Sem r_agZE ()
+ Polysemy.Process.Effect.Pty: size :: forall r_agZH. Member Pty r_agZH => Sem r_agZH (Rows, Cols)
+ Polysemy.Process.Effect.SystemProcess: pid :: forall r_ai3i. Member SystemProcess r_ai3i => Sem r_ai3i Pid
+ Polysemy.Process.Effect.SystemProcess: readStderr :: forall r_ai3f. Member SystemProcess r_ai3f => Sem r_ai3f ByteString
+ Polysemy.Process.Effect.SystemProcess: readStdout :: forall r_ai3e. Member SystemProcess r_ai3e => Sem r_ai3e ByteString
+ Polysemy.Process.Effect.SystemProcess: signal :: forall r_ai3j. Member SystemProcess r_ai3j => Signal -> Sem r_ai3j ()
+ Polysemy.Process.Effect.SystemProcess: wait :: forall r_ai3l. Member SystemProcess r_ai3l => Sem r_ai3l ExitCode
+ Polysemy.Process.Effect.SystemProcess: writeStdin :: forall r_ai3g. Member SystemProcess r_ai3g => ByteString -> Sem r_ai3g ()
+ Polysemy.Process.ProcessOutput: chunk :: forall p_adBL a_adBM r_adE5. Member (ProcessOutput p_adBL a_adBM) r_adE5 => ByteString -> ByteString -> Sem r_adE5 ([a_adBM], ByteString)
+ Polysemy.Process.Pty: handle :: forall r_agZD. Member Pty r_agZD => Sem r_agZD Handle
+ Polysemy.Process.Pty: resize :: forall r_agZE. Member Pty r_agZE => Rows -> Cols -> Sem r_agZE ()
+ Polysemy.Process.Pty: size :: forall r_agZH. Member Pty r_agZH => Sem r_agZH (Rows, Cols)
+ Polysemy.Process.SystemProcess: pid :: forall r_ai3i. Member SystemProcess r_ai3i => Sem r_ai3i Pid
+ Polysemy.Process.SystemProcess: readStderr :: forall r_ai3f. Member SystemProcess r_ai3f => Sem r_ai3f ByteString
+ Polysemy.Process.SystemProcess: readStdout :: forall r_ai3e. Member SystemProcess r_ai3e => Sem r_ai3e ByteString
+ Polysemy.Process.SystemProcess: signal :: forall r_ai3j. Member SystemProcess r_ai3j => Signal -> Sem r_ai3j ()
+ Polysemy.Process.SystemProcess: wait :: forall r_ai3l. Member SystemProcess r_ai3l => Sem r_ai3l ExitCode
+ Polysemy.Process.SystemProcess: writeStdin :: forall r_ai3g. Member SystemProcess r_ai3g => ByteString -> Sem r_ai3g ()
Files
- LICENSE +1/−1
- changelog.md +1/−1
- polysemy-process.cabal +31/−85
- test/Polysemy/Process/Test/ProcessTest.hs +6/−6
LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2020 Torsten Schmits+Copyright (c) 2023 Torsten Schmits Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
changelog.md view
@@ -1,4 +1,4 @@-# Unreleased+# 0.10.0.0 * Add `oneshot` variants of `Process` interpreters that send `Stop` to the individual actions inside the scope, modeling a process that is expected to terminate.
polysemy-process.cabal view
@@ -1,29 +1,29 @@ cabal-version: 2.2 --- This file has been generated from package.yaml by hpack version 0.35.0.+-- This file has been generated from package.yaml by hpack version 0.35.2. -- -- see: https://github.com/sol/hpack name: polysemy-process-version: 0.12.1.0+version: 0.13.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://git.tryp.io/tek/polysemy-conc+category: Process+homepage: https://github.com/tek/polysemy-conc#readme bug-reports: https://github.com/tek/polysemy-conc/issues author: Torsten Schmits maintainer: hackage@tryp.io-copyright: 2022 Torsten Schmits+copyright: 2023 Torsten Schmits license: BSD-2-Clause-Patent license-file: LICENSE build-type: Simple extra-source-files:- changelog.md readme.md+ changelog.md source-repository head type: git- location: https://git.tryp.io/tek/polysemy-conc+ location: https://github.com/tek/polysemy-conc library exposed-modules:@@ -58,76 +58,49 @@ default-extensions: AllowAmbiguousTypes ApplicativeDo- BangPatterns- BinaryLiterals BlockArguments- ConstraintKinds DataKinds DefaultSignatures DeriveAnyClass- DeriveDataTypeable- DeriveFoldable- DeriveFunctor- DeriveGeneric- DeriveLift- DeriveTraversable DerivingStrategies DerivingVia DisambiguateRecordFields- DoAndIfThenElse DuplicateRecordFields- EmptyCase- EmptyDataDecls- ExistentialQuantification- FlexibleContexts- FlexibleInstances FunctionalDependencies GADTs- GeneralizedNewtypeDeriving- InstanceSigs- KindSignatures LambdaCase LiberalTypeSynonyms- MultiParamTypeClasses MultiWayIf- NamedFieldPuns OverloadedLabels OverloadedLists OverloadedStrings PackageImports PartialTypeSignatures- PatternGuards PatternSynonyms- PolyKinds QuantifiedConstraints QuasiQuotes- RankNTypes RecordWildCards RecursiveDo RoleAnnotations- ScopedTypeVariables- StandaloneDeriving TemplateHaskell- TupleSections- TypeApplications TypeFamilies TypeFamilyDependencies- TypeOperators- TypeSynonymInstances UndecidableInstances UnicodeSyntax ViewPatterns- ghc-options: -Wall -Wredundant-constraints -Wincomplete-uni-patterns -Wmissing-deriving-strategies -Widentities -Wunused-packages+ OverloadedRecordDot+ NoFieldSelectors+ ghc-options: -Wall -Widentities -Wincomplete-uni-patterns -Wmissing-deriving-strategies -Wredundant-constraints -Wunused-type-patterns -Wunused-packages build-depends:- base >=4.12 && <5- , incipit-core >=0.4.1+ base ==4.*+ , incipit-core ==0.5.* , path ==0.9.*- , path-io ==1.7.*+ , path-io >=1.7 && <1.9 , polysemy ==1.9.*- , polysemy-conc ==0.12.*- , polysemy-resume ==0.7.*+ , polysemy-conc >=0.13.0.0 && <0.14+ , polysemy-resume >=0.7 && <0.9 , polysemy-time ==0.6.*- , posix-pty >=0.2+ , posix-pty ==0.2.* , process , stm-chans >=3 && <3.1 , typed-process >=0.2.6 && <0.3@@ -136,9 +109,9 @@ base hiding (Prelude) , incipit-core (IncipitCore as Prelude) , incipit-core hiding (IncipitCore)- default-language: Haskell2010+ default-language: GHC2021 -test-suite polysemy-process-unit+test-suite polysemy-process-test type: exitcode-stdio-1.0 main-is: Main.hs other-modules:@@ -148,81 +121,54 @@ default-extensions: AllowAmbiguousTypes ApplicativeDo- BangPatterns- BinaryLiterals BlockArguments- ConstraintKinds DataKinds DefaultSignatures DeriveAnyClass- DeriveDataTypeable- DeriveFoldable- DeriveFunctor- DeriveGeneric- DeriveLift- DeriveTraversable DerivingStrategies DerivingVia DisambiguateRecordFields- DoAndIfThenElse DuplicateRecordFields- EmptyCase- EmptyDataDecls- ExistentialQuantification- FlexibleContexts- FlexibleInstances FunctionalDependencies GADTs- GeneralizedNewtypeDeriving- InstanceSigs- KindSignatures LambdaCase LiberalTypeSynonyms- MultiParamTypeClasses MultiWayIf- NamedFieldPuns OverloadedLabels OverloadedLists OverloadedStrings PackageImports PartialTypeSignatures- PatternGuards PatternSynonyms- PolyKinds QuantifiedConstraints QuasiQuotes- RankNTypes RecordWildCards RecursiveDo RoleAnnotations- ScopedTypeVariables- StandaloneDeriving TemplateHaskell- TupleSections- TypeApplications TypeFamilies TypeFamilyDependencies- TypeOperators- TypeSynonymInstances UndecidableInstances UnicodeSyntax ViewPatterns- ghc-options: -Wall -Wredundant-constraints -Wincomplete-uni-patterns -Wmissing-deriving-strategies -Widentities -Wunused-packages -threaded -rtsopts -with-rtsopts=-N+ OverloadedRecordDot+ NoFieldSelectors+ ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall -Widentities -Wincomplete-uni-patterns -Wmissing-deriving-strategies -Wredundant-constraints -Wunused-type-patterns -Wunused-packages build-depends:- base >=4.12 && <5- , incipit-core >=0.4.1+ base ==4.*+ , incipit-core ==0.5.* , polysemy- , polysemy-conc- , polysemy-plugin+ , polysemy-conc >=0.13.0.0 && <0.14+ , polysemy-plugin >=0.4.4 && <0.5 , polysemy-process- , polysemy-resume- , polysemy-test >=0.6- , polysemy-time- , tasty- , tasty-expected-failure+ , polysemy-resume >=0.7 && <0.9+ , polysemy-test >=0.6 && <0.9+ , polysemy-time ==0.6.*+ , tasty ==1.4.*+ , tasty-expected-failure ==0.12.* , typed-process mixins: base hiding (Prelude) , incipit-core (IncipitCore as Prelude) , incipit-core hiding (IncipitCore)- default-language: Haskell2010+ default-language: GHC2021
test/Polysemy/Process/Test/ProcessTest.hs view
@@ -47,25 +47,25 @@ test_process :: UnitTest test_process = runTestAuto $ interpretRace $ asyncToIOFinal $ interpretProcessByteString $ interpretProcessNative_ def config do- response <- resumeHoistError @ProcessError @(Scoped _ _) show do+ response <- resumeHoistError @ProcessError @(Scoped _ _) (TestError . show) do withProcess_ do Process.send (encodeUtf8 message)- Race.timeout_ (throw "timed out") (Seconds 5) Process.recv+ Race.timeout_ (throw (TestError "timed out")) (Seconds 5) Process.recv message === decodeUtf8 response test_processLines :: UnitTest test_processLines = runTestAuto $ interpretRace $ asyncToIOFinal $ interpretProcessTextLines $ interpretProcessNative_ def config do- response <- resumeHoistError @ProcessError @(Scoped _ _) show do+ response <- resumeHoistError @ProcessError @(Scoped _ _) (TestError . show) do withProcess_ do Process.send message- Race.timeout_ (throw "timed out") (Seconds 5) (replicateM 4 Process.recv)+ Race.timeout_ (throw (TestError "timed out")) (Seconds 5) (replicateM 4 Process.recv) messageLines === response test_processKillNever :: UnitTest test_processKillNever = runTestAuto $ interpretRace $ asyncToIOFinal $ interpretProcessTextLines $ interpretProcessNative_ def { kill = KillNever } config do- result <- resumeHoistError @ProcessError @(Scoped _ _) show do+ result <- resumeHoistError @ProcessError @(Scoped _ _) (TestError . show) do Conc.timeout unit (MilliSeconds 100) do withProcess_ do Process.send message@@ -110,7 +110,7 @@ test_processOneshot = runTestAuto $ interpretRace $ asyncToIOFinal $ interpretOneshot conf do num <- runStop @Int $ withProcessOneshot message do- Race.timeout_ (throw "timed out") (Seconds 5) do+ Race.timeout_ (throw (TestError "timed out")) (Seconds 5) do for_ @[] [1..5] \ i -> resumeHoistAs i Process.recv unit