| Copyright | (c) Miao ZhiCheng 2024 |
|---|---|
| License | MIT |
| Maintainer | zhicheng.miao@gmail.com |
| Stability | experimental |
| Portability | POSIX |
| Safe Haskell | None |
| Language | GHC2021 |
THSH.Funclet
Description
Synopsis
- class Funclet f where
- data AnyFunclet = Funclet f => MkAnyFunclet f
- runFuncletWithStdHandles :: Funclet f => f -> IO ExitCode
Documentation
class Funclet f where Source #
A funclet is an IO process that communicates through handles and calls back with an exit code.
Minimal complete definition
Methods
runFunclet :: f -> (ExitCode -> IO ()) -> IO (Handle, Handle, Handle) Source #
Run the funclet which creates a set of handles itself.
It has a default implementation that calls runFuncletWithHandles with created pipes.
runFuncletWithHandles :: f -> (ExitCode -> IO ()) -> (Handle, Handle, Handle) -> IO () Source #
Run the funclet with the set of handles provided.
It has a default implementation that simply piping data between runFunclet and the provided handles.
Instances
| Funclet AnyFunclet Source # |
|
Defined in THSH.Funclet Methods runFunclet :: AnyFunclet -> (ExitCode -> IO ()) -> IO (Handle, Handle, Handle) Source # runFuncletWithHandles :: AnyFunclet -> (ExitCode -> IO ()) -> (Handle, Handle, Handle) -> IO () Source # | |
| Funclet Script Source # | |
| FnFunction f => Funclet (Fn f) Source # | The |
data AnyFunclet Source #
Existential wrapper of any Funclet.
Constructors
| Funclet f => MkAnyFunclet f |
Instances
| Funclet AnyFunclet Source # |
|
Defined in THSH.Funclet Methods runFunclet :: AnyFunclet -> (ExitCode -> IO ()) -> IO (Handle, Handle, Handle) Source # runFuncletWithHandles :: AnyFunclet -> (ExitCode -> IO ()) -> (Handle, Handle, Handle) -> IO () Source # | |