Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Coroutine interfaces for interpreters, like Bash and Sh.

branch: master

This branch is 0 commits ahead and 0 commits behind master

Fetching latest commit…

Cannot retrieve the latest commit at this time

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)

Something went wrong with that request. Please try again.