Skip to content
Closed
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: 1 addition & 0 deletions src/DocTestCommand.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
>>> import Data.Char (toUpper)
>>> import Data.Function ((&))
>>> import Streamly.Unicode.String (str)
>>> import System.FilePath (FilePath)
>>> import qualified Streamly.Console.Stdio as Stdio
>>> import qualified Streamly.Data.Array as Array
>>> import qualified Streamly.Data.Fold as Fold
Expand Down
18 changes: 15 additions & 3 deletions src/Streamly/System/Command.hs
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,18 @@ import qualified Streamly.Internal.System.Process as Process -- (ProcessFailure
-- better efficiency and type safety.
--
-- Normally, you should not need the system shell but if you want to use shell
-- scripts in your program then you can take a look at the @streamly-shell@
-- package which provides convenient wrapper over "Streamly.System.Process" to
-- execute shell scripts, commands.
-- scripts in your program then you can use the following interpreter as a
-- helper for convenient wrappers.
--
-- >>> :{
-- interpreter :: (FilePath -> [String] -> a) -> String -> a
-- interpreter f cmd = f "/bin/sh" ["-c", cmd]
-- :}
--
-- >>> toBytes = interpreter Process.toBytes
-- >>> toChunks = interpreter Process.toChunks
-- >>> toChars = interpreter Process.toChars
-- >>> toLines f = interpreter (Process.toLines f)
-- >>> toString = interpreter Process.toString
-- >>> toStdout = interpreter Process.toStdout
-- >>> toNull = interpreter Process.toNull