| Safe Haskell | Safe |
|---|---|
| Language | Haskell2010 |
Text.Chatty.Scanner
Description
Provides a typeclass for all monads that may scan text.
- class Monad m => ChScanner m where
- newtype HereStringT m a = HereString {
- runHereStringT :: String -> m (a, String)
- newtype QuietT m a = Quiet {
- runQuietT :: m a
- newtype InRedirT m a = InRedir {
- runInRedirT :: Handle -> m a
- type InRedir = InRedirT (HandleCloserT IO)
- runInRedir :: InRedir a -> Handle -> IO a
- runInRedirFT :: (Functor m, MonadIO m, ChFinalizer m) => InRedirT m a -> FilePath -> m a
- runInRedirF :: InRedir a -> FilePath -> IO a
- mscanLn :: ChScanner m => m String
- mscanN :: ChScanner m => Int -> m String
- data EmptyI = EmptyI
- class RedirectionSource t mt a r | t -> mt, t a -> r where
- (.<.) :: (ChFinalizer m, Functor m, MonadIO m, ChScanner (mt m)) => mt m a -> t -> m r
- class RedirectionHeredoc t mt a r | t -> mt, t a -> r where
Documentation
class Monad m => ChScanner m where Source
A typeclass for all monads that may read input.
Minimal complete definition
newtype HereStringT m a Source
HereStringT holds a given string and uses it as input for the function (much like here-strings in the shell)
Constructors
| HereString | |
Fields
| |
Instances
| MonadTrans HereStringT Source | |
| RedirectionHeredoc String HereStringT a a Source | |
| Monad m => Monad (HereStringT m) Source | |
| Monad m => Functor (HereStringT m) Source | |
| Monad m => Applicative (HereStringT m) Source | |
| MonadIO m => MonadIO (HereStringT m) Source | |
| ChFinalizer m => ChFinalizer (HereStringT m) Source | |
| Monad m => ChScanner (HereStringT m) Source | |
| Monad m => ChBufferedScanner (HereStringT m) Source |
QuietT does not convey any input (much like <devnull in the shell)
InRedirT redirects all input to a given handle (much like <filename in the shell)
Constructors
| InRedir | |
Fields
| |
Instances
| MonadTrans InRedirT Source | |
| RedirectionSource Handle InRedirT a a Source | |
| RedirectionSource FilePath InRedirT a a Source | |
| Monad m => Monad (InRedirT m) Source | |
| Monad m => Functor (InRedirT m) Source | |
| Monad m => Applicative (InRedirT m) Source | |
| MonadIO m => MonadIO (InRedirT m) Source | |
| ChFinalizer m => ChFinalizer (InRedirT m) Source | |
| MonadIO m => ChScanner (InRedirT m) Source |
type InRedir = InRedirT (HandleCloserT IO) Source
InRedirT on an IO monad
runInRedir :: InRedir a -> Handle -> IO a Source
Run InRedir with handle
runInRedirFT :: (Functor m, MonadIO m, ChFinalizer m) => InRedirT m a -> FilePath -> m a Source
Run InRedirT with a filename
runInRedirF :: InRedir a -> FilePath -> IO a Source
Run InRedir with a filename
class RedirectionSource t mt a r | t -> mt, t a -> r where Source
Class for all primitive redirection sources.
Methods
(.<.) :: (ChFinalizer m, Functor m, MonadIO m, ChScanner (mt m)) => mt m a -> t -> m r Source
Redirection
Instances
class RedirectionHeredoc t mt a r | t -> mt, t a -> r where Source
Class for all Here-Documents
Instances