Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.3.1 #80

Merged
merged 5 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Benchmark/System/Process.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import qualified Streamly.Internal.System.Command as Cmd

-- Internal imports
import qualified Streamly.Internal.FileSystem.Handle as FH
import qualified Streamly.Internal.System.Process as Proc

-- XXX replace with streamly versions once they are fixed
{-# INLINE rights #-}
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 0.3.1 (Dec 2023)

* Allow streamly-0.10.0 and streamly-core-0.2.0
* Fix a bug in quote escaping in the Command module

## 0.3.0 (Apr 2023)

* Added a `Streamly.System.Command` module
Expand Down
4 changes: 2 additions & 2 deletions src/DocTestCommand.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

For APIs that have not been released yet.

>>> import qualified Streamly.Internal.Console.Stdio as Stdio
>>> import qualified Streamly.Internal.FileSystem.Dir as Dir
>>> import qualified Streamly.Internal.Console.Stdio as Stdio (putBytes, putChars, putChunks)
>>> import qualified Streamly.Internal.FileSystem.Dir as Dir (readFiles)
>>> import qualified Streamly.Internal.System.Process as Process
-}
7 changes: 3 additions & 4 deletions src/DocTestProcess.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@

For APIs that have not been released yet.

>>> import qualified Streamly.Internal.Console.Stdio as Stdio
>>> import qualified Streamly.Internal.Data.Stream as Stream
>>> import qualified Streamly.Internal.FileSystem.Dir as Dir
>>> import qualified Streamly.Internal.Console.Stdio as Stdio (putChars, putChunks)
>>> import qualified Streamly.Internal.FileSystem.Dir as Dir (readFiles)
>>> import qualified Streamly.Internal.System.Process as Process
>>> import qualified Streamly.Internal.Unicode.Stream as Unicode
>>> import qualified Streamly.Internal.Unicode.Stream as Unicode (lines)
-}
34 changes: 16 additions & 18 deletions src/Streamly/Internal/System/Command.hs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import qualified Streamly.Internal.System.Process as Process

#include "DocTestCommand.hs"

-- Posix compliant quote excaping:
-- | Posix compliant quote escaping:
--
-- $ echo 'hello\\"world'
-- hello\\"world
Expand Down Expand Up @@ -169,7 +169,7 @@ pipeWith f cmd input =
-- If the input stream throws an exception or if the output stream is garbage
-- collected before it could finish then the process is terminated with SIGTERM.
--
-- If the process terminates with a non-zero exit code then a 'ProcessFailure'
-- If the process terminates with a non-zero exit code then a 'Process.ProcessFailure'
-- exception is raised.
--
-- The following code is equivalent to the shell command @echo "hello world" |
Expand Down Expand Up @@ -224,10 +224,9 @@ pipeChars = pipeWith Process.pipeChars
-- Generation
-------------------------------------------------------------------------------

-- |
--
-- >>> toBytes = streamWith Process.toBytes
--

-- |
-- >>> toBytes "echo hello world" & Stdio.putBytes
--hello world
-- >>> toBytes "echo hello\\ world" & Stdio.putBytes
Expand All @@ -242,10 +241,9 @@ pipeChars = pipeWith Process.pipeChars
toBytes :: (MonadAsync m, MonadCatch m) => String -> Stream m Word8
toBytes = streamWith Process.toBytes

-- |
--
-- >>> toChunks = streamWith Process.toChunks
--

-- |
-- >>> toChunks "echo hello world" & Stdio.putChunks
--hello world
--
Expand All @@ -254,9 +252,9 @@ toBytes = streamWith Process.toBytes
toChunks :: (MonadAsync m, MonadCatch m) => String -> Stream m (Array Word8)
toChunks = streamWith Process.toChunks

-- |
-- >>> toChars = streamWith Process.toChars
--

-- |
-- >>> toChars "echo hello world" & Stdio.putChars
--hello world
--
Expand All @@ -265,9 +263,9 @@ toChunks = streamWith Process.toChunks
toChars :: (MonadAsync m, MonadCatch m) => String -> Stream m Char
toChars = streamWith Process.toChars

-- |
-- >>> toLines f = streamWith (Process.toLines f)
--

-- |
-- >>> toLines Fold.toList "echo -e hello\\\\nworld" & Stream.fold Fold.toList
-- ["hello","world"]
--
Expand All @@ -280,9 +278,9 @@ toLines ::
-> Stream m a -- ^ Output Stream
toLines f = streamWith (Process.toLines f)

-- |
-- >>> toString = runWith Process.toString
--

-- |
-- >>> toString "echo hello world"
--"hello world\n"
--
Expand All @@ -294,9 +292,9 @@ toString ::
-> m String
toString = runWith Process.toString

-- |
-- >>> toStdout = runWith Process.toStdout
--

-- |
-- >>> toStdout "echo hello world"
-- hello world
--
Expand All @@ -308,9 +306,9 @@ toStdout ::
-> m ()
toStdout = runWith Process.toStdout

-- |
-- >>> toNull = runWith Process.toNull
--

-- |
-- >>> toNull "echo hello world"
--
-- /Pre-release/
Expand Down
Loading
Loading