-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A "noDSL" approach to mixing shell scripting with Haskell programs using Template Haskell -- -- A "noDSL" approach to mixing shell scripting with Haskell programs -- using Template Haskell @package THSH @version 0.0.0.2 module THSH.Funclet -- | A funclet is an IO process that communicates through handles and -- returns an exit code. class Funclet f runFunclet :: Funclet f => f -> (ExitCode -> IO ()) -> IO (Handle, Handle, Handle) -- | Existential wrapper of any funclet. data AnyFunclet MkAnyFunclet :: f -> AnyFunclet -- | Run a funclet with standard handles runFuncletWithStdHandles :: Funclet f => f -> IO ExitCode instance THSH.Funclet.Funclet THSH.Funclet.AnyFunclet module THSH.Fn -- | A Fn that converts the entire input content to another as -- String. data ContentFn m s MkContentFn :: (s -> m s) -> (Handle -> m s) -> (Handle -> s -> m ()) -> ContentFn m s -- | ContentFn for the String type. stringContentFn :: (String -> String) -> ContentFn IO String -- | IO variant of stringContentFn. stringContentIOFn :: (String -> IO String) -> ContentFn IO String -- | ContentFn for the Text type from the text package. textContentFn :: (Text -> Text) -> ContentFn IO Text -- | IO variant of textContentFn. textContentIOFn :: (Text -> IO Text) -> ContentFn IO Text -- | A Fn that reads line by line via Read instances of -- a and accumulates context b. data LineReadFn m a b MkLineReadFn :: (a -> b -> m (b, Maybe String)) -> (b -> m (Maybe String)) -> b -> LineReadFn m a b lineReadFn :: forall a b. Read a => (a -> b -> (b, Maybe String)) -> (b -> Maybe String) -> b -> LineReadFn IO a b fn :: FnFunction f => f -> Fn f instance THSH.Funclet.Funclet (THSH.Fn.Fn f) instance THSH.Fn.FnFunction (THSH.Fn.LineReadFn GHC.Types.IO a b) instance THSH.Fn.FnFunction (THSH.Fn.ContentFn GHC.Types.IO s) module THSH.Script data Script MkScript :: String -> [AnyFunclet] -> Script [source] :: Script -> String [funclets] :: Script -> [AnyFunclet] genFuncletPipeCode :: Int -> String sh :: Script -> Script instance THSH.Funclet.Funclet THSH.Script.Script module THSH.QQ -- | The quasi quoter for Template Haskell shell scripts. thsh :: QuasiQuoter module THSH