| 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
- 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
Methods
Read one single character
Lazily read all the input.
mscannable :: m Bool Source #
Input readable? (not EOF)
mscanh :: m (Maybe Handle) Source #
Return FD handle, if available
Input available yet?
Instances
| ChScanner IO Source # | |
| MonadIO m => ChScanner (InRedirT m) Source # | |
| Monad m => ChScanner (QuietT m) Source # | |
| Monad m => ChScanner (HereStringT m) Source # | |
| ChScanner m => ChScanner (ScannerBufferT m) Source # | |
| ChAtoms m => ChScanner (FileScannerT m) Source # | |
| Monad m => ChScanner (StateT String m) Source # | |
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 # | |
runInRedirFT :: (Functor m, MonadIO m, ChFinalizer m) => InRedirT m a -> FilePath -> m a Source #
Run InRedirT with a filename
class RedirectionSource t mt a r | t -> mt, t a -> r where Source #
Class for all primitive redirection sources.
Minimal complete definition
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
Minimal complete definition
Instances