redact-0.4.0.0: hide secret text on the terminal
CopyrightCopyright (c) 2020-2022 Travis Cardwell
LicenseMIT
Safe HaskellSafe-Inferred
LanguageHaskell2010

Redact.Monad.Handle

Description

 
Synopsis

MonadHandle

class Monad m => MonadHandle m where Source #

Handle I/O

Since: 0.4.0.0

Methods

hGetLine :: Handle -> m Text Source #

Read a single line from a handle

hIsEOF :: Handle -> m Bool Source #

Check if a handle has more content

withFile :: Typeable r => FilePath -> IOMode -> (Handle -> m r) -> m (Either IOError r) Source #

Open a file and perform an action on its handle

Instances

Instances details
MonadHandle IO Source # 
Instance details

Defined in Redact.Monad.Handle

Internal

handleToTerminal Source #

Arguments

:: forall m s. (MonadHandle m, MonadTerminal m) 
=> (s -> Text -> Either String (Line, s))

step function

-> (s -> Maybe String)

end function

-> s

initial state

-> [SGR]

SGRs for redacted text

-> Handle 
-> m (Either Error ()) 

Redact text from a Handle strictly, putting it to the terminal

handleToTerminal' Source #

Arguments

:: forall m s. (MonadHandle m, MonadTerminal m) 
=> (s -> Text -> (Line, s))

step function

-> s

initial state

-> [SGR]

SGRs for redacted text

-> Handle 
-> m () 

Redact text from a Handle leniently, putting it to the terminal

fileToTerminal Source #

Arguments

:: (MonadHandle m, MonadTerminal m) 
=> (s -> Text -> Either String (Line, s))

step function

-> (s -> Maybe String)

end function

-> s

initial state

-> [SGR]

SGRs for redacted text

-> FilePath 
-> m (Either Error ()) 

Redact text from a file strictly, putting it to the terminal

fileToTerminal' Source #

Arguments

:: (MonadHandle m, MonadTerminal m) 
=> (s -> Text -> (Line, s))

step function

-> s

initial state

-> [SGR]

SGRs for redacted text

-> FilePath 
-> m (Either Error ()) 

Redact text from a file leniently, putting it to the terminal