THSH-0.0.0.2: 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 HaskellSafe-Inferred
LanguageGHC2021

THSH.Fn

Description

 
Synopsis

Documentation

data ContentFn m s Source #

A Fn that converts the entire input content to another as String.

Constructors

MkContentFn (s -> m s) (Handle -> m s) (Handle -> s -> m ()) 

textContentFn :: (Text -> Text) -> ContentFn IO Text Source #

ContentFn for the Text type from the text package.

data LineReadFn m a b Source #

A Fn that reads line by line via Read instances of a and accumulates context b.

Constructors

Read a => MkLineReadFn (a -> b -> m (b, Maybe String)) (b -> m (Maybe String)) b 

lineReadFn :: forall a b. Read a => (a -> b -> (b, Maybe String)) -> (b -> Maybe String) -> b -> LineReadFn IO a b Source #

fn :: FnFunction f => f -> Fn f Source #