Copyright | Copyright (c) 2020-2023 Travis Cardwell |
---|---|
License | MIT |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Redact.Monad.Handle
Contents
Description
Synopsis
- class Monad m => MonadHandle (m :: Type -> Type) where
- handleToTerminal :: (MonadHandle m, MonadTerminal m) => (s -> Text -> Either String (Line, s)) -> (s -> Maybe String) -> s -> [SGR] -> Handle -> m (Either Error ())
- handleToTerminal' :: (MonadHandle m, MonadTerminal m) => (s -> Text -> (Line, s)) -> s -> [SGR] -> Handle -> m ()
- fileToTerminal :: (MonadHandle m, MonadTerminal m) => (s -> Text -> Either String (Line, s)) -> (s -> Maybe String) -> s -> [SGR] -> FilePath -> m (Either Error ())
- fileToTerminal' :: (MonadHandle m, MonadTerminal m) => (s -> Text -> (Line, s)) -> s -> [SGR] -> FilePath -> m (Either Error ())
MonadHandle
class Monad m => MonadHandle (m :: Type -> Type) where Source #
Handle I/O
Since: 0.4.0.0
Internal
Arguments
:: (MonadHandle m, MonadTerminal m) | |
=> (s -> Text -> Either String (Line, s)) | step function |
-> (s -> Maybe String) | end function |
-> s | initial state |
-> [SGR] |
|
-> Handle | |
-> m (Either Error ()) |
Redact text from a Handle
strictly, putting it to the terminal
Arguments
:: (MonadHandle m, MonadTerminal m) | |
=> (s -> Text -> (Line, s)) | step function |
-> s | initial state |
-> [SGR] |
|
-> Handle | |
-> m () |
Redact text from a Handle
leniently, putting it to the terminal
Arguments
:: (MonadHandle m, MonadTerminal m) | |
=> (s -> Text -> Either String (Line, s)) | step function |
-> (s -> Maybe String) | end function |
-> s | initial state |
-> [SGR] |
|
-> FilePath | |
-> m (Either Error ()) |
Redact text from a file strictly, putting it to the terminal
Arguments
:: (MonadHandle m, MonadTerminal m) | |
=> (s -> Text -> (Line, s)) | step function |
-> s | initial state |
-> [SGR] |
|
-> FilePath | |
-> m (Either Error ()) |
Redact text from a file leniently, putting it to the terminal