THSH-0.0.0.1: A "noDSL" approach to mixing shell scripting with Haskell programs using Template Haskell
Safe HaskellSafe-Inferred
LanguageGHC2021

THSH.Fn

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 #