-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Shell escaping library.
--   
--   Shell escaping library, offering both Bourne shell and Bash style
--   escaping of ByteStrings.
@package shell-escape
@version 0.2.0


-- | Typed shell escaping for Bourne Shell and Bash.
module Data.ByteString.ShellEscape

-- | A type class for objects that represent an intermediate state of
--   escaping.
class Escape t

-- | Transform a <a>ByteString</a> into the escaped intermediate form.
escape :: Escape t => ByteString -> t

-- | Recover the original <a>ByteString</a>.
unescape :: Escape t => t -> ByteString

-- | Yield the escaped <a>ByteString</a>.
bytes :: Escape t => t -> ByteString

-- | A Bourne Shell escaped <a>ByteString</a>. An oddity of Bourne shell
--   escaping is the absence of escape codes for newline and other ASCII
--   control characters. These bytes are simply placed literally in single
--   quotes; the effect is that a Bourne Shell escaped string may cover
--   several lines and contain non-ASCII bytes. Runs of bytes that must be
--   escaped are wrapped in <tt>'...'</tt>; bytes that are acceptable as
--   literals in Bourne Shell are left as is.
data Sh

-- | Construct a Bourne Shell escaped intermediate form.
sh :: ByteString -> Sh

-- | A Bash escaped <a>ByteString</a>. The strings are wrapped in
--   <tt>$'...'</tt> if any bytes within them must be escaped; otherwise,
--   they are left as is. Newlines and other control characters are
--   represented as ANSI escape sequences. High bytes are represented as
--   hex codes. Thus Bash escaped strings will always fit on one line and
--   never contain non-ASCII bytes.
data Bash

-- | Construct a Bash escaped intermediate form.
bash :: ByteString -> Bash


-- | Typed shell escaping for Bourne Shell and Bash.
module Text.ShellEscape

-- | A type class for objects that represent an intermediate state of
--   escaping.
class Escape t

-- | Transform a <a>ByteString</a> into the escaped intermediate form.
escape :: Escape t => ByteString -> t

-- | Recover the original <a>ByteString</a>.
unescape :: Escape t => t -> ByteString

-- | Yield the escaped <a>ByteString</a>.
bytes :: Escape t => t -> ByteString

-- | A Bourne Shell escaped <a>ByteString</a>. An oddity of Bourne shell
--   escaping is the absence of escape codes for newline and other ASCII
--   control characters. These bytes are simply placed literally in single
--   quotes; the effect is that a Bourne Shell escaped string may cover
--   several lines and contain non-ASCII bytes. Runs of bytes that must be
--   escaped are wrapped in <tt>'...'</tt>; bytes that are acceptable as
--   literals in Bourne Shell are left as is.
data Sh

-- | Construct a Bourne Shell escaped intermediate form.
sh :: ByteString -> Sh

-- | A Bash escaped <a>ByteString</a>. The strings are wrapped in
--   <tt>$'...'</tt> if any bytes within them must be escaped; otherwise,
--   they are left as is. Newlines and other control characters are
--   represented as ANSI escape sequences. High bytes are represented as
--   hex codes. Thus Bash escaped strings will always fit on one line and
--   never contain non-ASCII bytes.
data Bash

-- | Construct a Bash escaped intermediate form.
bash :: ByteString -> Bash
