{"id":20761987,"url":"https://github.com/composewell/streamly-process","last_synced_at":"2025-10-09T20:45:59.568Z","repository":{"id":38189780,"uuid":"270221571","full_name":"composewell/streamly-process","owner":"composewell","description":"Streaming interfaces for system processes","archived":false,"fork":false,"pushed_at":"2025-09-19T10:12:46.000Z","size":251,"stargazers_count":12,"open_issues_count":21,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-09-30T05:47:35.884Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://streamly.composewell.com","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/composewell.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-07T06:56:10.000Z","updated_at":"2025-09-03T18:04:53.000Z","dependencies_parsed_at":"2024-11-17T10:28:40.327Z","dependency_job_id":"3d34a5e3-8ea2-43fe-a1aa-f5bbce47778c","html_url":"https://github.com/composewell/streamly-process","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/composewell/streamly-process","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/composewell%2Fstreamly-process","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/composewell%2Fstreamly-process/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/composewell%2Fstreamly-process/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/composewell%2Fstreamly-process/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/composewell","download_url":"https://codeload.github.com/composewell/streamly-process/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/composewell%2Fstreamly-process/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001984,"owners_count":26083259,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T10:28:34.357Z","updated_at":"2025-10-09T20:45:59.537Z","avatar_url":"https://github.com/composewell.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OS processes as streams\n\nUse operating system (OS) commands in Haskell programs as if they were\nnative Haskell functions, by treating their inputs and outputs as\nHaskell streams. This allows you to write high-level Haskell scripts\nthat can perform tasks similar to shell scripts, but with C-like\nperformance, and with strong safety guarantees, refactorability, and\nmodularity.\n\nUse the following imports in the examples below:\n\n```haskell\n\u003e\u003e\u003e :set -XFlexibleContexts\n\u003e\u003e\u003e :set -XScopedTypeVariables\n\u003e\u003e\u003e :set -XQuasiQuotes\n\u003e\u003e\u003e import Data.Function ((\u0026))\n\u003e\u003e\u003e import Streamly.Unicode.String (str)\n\u003e\u003e\u003e import qualified Streamly.Data.Array as Array\n\u003e\u003e\u003e import qualified Streamly.Console.Stdio as Stdio\n\u003e\u003e\u003e import qualified Streamly.Data.Fold as Fold\n\u003e\u003e\u003e import qualified Streamly.Data.Stream.Prelude as Stream\n\u003e\u003e\u003e import qualified Streamly.System.Command as Command\n\u003e\u003e\u003e import qualified Streamly.Internal.FileSystem.Dir as Dir\n```\n\n## Commands as streaming functions\n\nThe shell command `echo \"hello world\" | tr [a-z] [A-Z]` can be written as\nfollows using this package:\n\n```haskell\n\u003e\u003e\u003e :{\n   Command.toBytes [str|echo \"hello world\"|] -- Stream IO Word8\n \u0026 Command.pipeBytes [str|tr [a-z] [A-Z]|]   -- Stream IO Word8\n \u0026 Stream.fold Stdio.write                   -- IO ()\n:}\nHELLO WORLD\n```\n\n## Shell commands as streaming functions\n\nIf you want to execute the same command using the shell pipe syntax:\n\n```haskell\n\u003e\u003e\u003e :{\n   Command.toBytes [str|sh \"-c\" \"echo 'hello world' | tr [a-z] [A-Z]\"|] -- Stream IO Word8\n \u0026 Stream.fold Stdio.write                                              -- IO ()\n:}\nHELLO WORLD\n```\n\n## Running Commands Concurrently\n\nYou can run commands concurrently by using streamly's concurrent combinators.\n\nRunning @grep@ concurrently on many files:\n\n```haskell\n\u003e\u003e\u003e :{\ngrep file =\n   Command.toBytes [str|grep -H \"pattern\" #{file}|]             -- Stream IO Word8\n \u0026 Stream.handle (\\(_ :: Command.ProcessFailure) -\u003e Stream.nil) -- Stream IO Word8\n \u0026 Stream.foldMany (Fold.takeEndBy (== 10) Array.write)         -- Stream IO (Array Word8)\n:}\n\n\u003e\u003e\u003e :{\npgrep =\n   Dir.readFiles \".\"             -- Stream IO FilePath\n \u0026 Stream.parConcatMap id grep   -- Stream IO (Array Word8)\n \u0026 Stream.fold Stdio.writeChunks -- IO ()\n:}\n```\n\n## Streamly\n\nPlease visit [Streamly homepage](https://streamly.composewell.com) for more\ndetails about streamly.\n\n# Licensing\n\nAvailable under [Apache-2.0 license](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomposewell%2Fstreamly-process","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcomposewell%2Fstreamly-process","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomposewell%2Fstreamly-process/lists"}