Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/solidsnack/coproc
Coroutine interfaces for interpreters, like Bash and Sh.
https://github.com/solidsnack/coproc
Last synced: about 1 month ago
JSON representation
Coroutine interfaces for interpreters, like Bash and Sh.
- Host: GitHub
- URL: https://github.com/solidsnack/coproc
- Owner: solidsnack
- License: other
- Created: 2012-10-22T09:03:40.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2015-01-14T23:05:28.000Z (almost 10 years ago)
- Last Synced: 2023-04-09T12:18:34.458Z (over 1 year ago)
- Language: Haskell
- Size: 125 KB
- Stars: 2
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: LICENSE
Awesome Lists containing this project
README
A coroutine interface for interactive interpreters. One use case is extracting
shell function definitions from source relying on the Bash's parser:ghci> import System.Posix.CoProc
ghci> b <- start Bash
b :: Session Bash
ghci> print b
Session pid=30591 interpreter=bash [lock] [handles]
it :: ()
ghci> query b "function echo_x { echo x ;}"
("","")
it :: (ByteString, ByteString)
ghci> query b "declare -F"
("declare -f echo_x\n","")
it :: (ByteString, ByteString)
ghci> query b "declare -f echo_x"
("echo_x () \n{ \n echo x\n}\n","")
it :: (ByteString, ByteString)