THSH-0.0.0.5: A "noDSL" approach to mixing shell scripting with Haskell programs using Template Haskell
Copyright(c) Miao ZhiCheng 2024
LicenseMIT
Maintainerzhicheng.miao@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageGHC2021

THSH.Funclet

Description

 
Synopsis

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

runFunclet | runFuncletWithHandles

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

Instances details
Funclet AnyFunclet Source #

AnyFunclet is of course also a Funclet.

Instance details

Defined in THSH.Funclet

Funclet Script Source #

The Script instance of Funclet.

Instance details

Defined in THSH.Script

FnFunction f => Funclet (Fn f) Source #

The FnFunction instance of Funclet.

Instance details

Defined in THSH.Fn

Methods

runFunclet :: Fn f -> (ExitCode -> IO ()) -> IO (Handle, Handle, Handle) Source #

runFuncletWithHandles :: Fn f -> (ExitCode -> IO ()) -> (Handle, Handle, Handle) -> IO () Source #

data AnyFunclet Source #

Existential wrapper of any Funclet.

Constructors

Funclet f => MkAnyFunclet f 

Instances

Instances details
Funclet AnyFunclet Source #

AnyFunclet is of course also a Funclet.

Instance details

Defined in THSH.Funclet

runFuncletWithStdHandles :: Funclet f => f -> IO ExitCode Source #

Run a Funclet with standard handles synchronously.