You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use operating system (OS) commands in Haskell programs as if they were
native Haskell functions, by treating their inputs and outputs as
Haskell streams. This allows you to write high-level Haskell scripts
that can perform tasks similar to shell scripts, but with C-like
performance, and with strong safety guarantees, refactorability, and
modularity.
Use the following imports in the examples below:
>>>:set -XFlexibleContexts>>>:set -XScopedTypeVariables>>>:set -XQuasiQuotes>>> import Data.Function ((&))
>>> import Streamly.Unicode.String (str)
>>> import qualified Streamly.Data.Array as Array>>> import qualified Streamly.Console.Stdio as Stdio>>> import qualified Streamly.Data.Fold as Fold>>> import qualified Streamly.Data.Stream.Prelude as Stream>>> import qualified Streamly.System.Command as Command>>> import qualified Streamly.Internal.FileSystem.Dir as Dir
Commands as streaming functions
The shell command echo "hello world" | tr [a-z] [A-Z] can be written as
follows using this package: