yi-core-0.19.4: Yi editor core library

Safe Haskell | Safe-Inferred
Language | Haskell2010

Parser.Incremental

Synopsis

- type Process token result = Zip token (result :< ())
- recoverWith :: Parser s a -> Parser s a
- symbol :: (s -> Bool) -> Parser s s
- eof :: Parser s ()
- lookNext :: Parser s (Maybe s)
- testNext :: (Maybe s -> Bool) -> Parser s ()
- run :: Process s a -> [s] -> (a, [String])
- mkProcess :: Parser s a -> Process s a
- profile :: Steps s r -> Profile
- pushSyms :: [s] -> Zip s r -> Zip s r
- pushEof :: Zip s r -> Zip s r
- evalL :: Zip s output -> Zip s output
- evalR :: Zip token (a :< rest) -> (a, [String])
- feedZ :: Maybe [s] -> Zip s r -> Zip s r
- data Parser s a where
  - Look :: forall s a. Parser s a -> (s -> Parser s a) -> Parser s a
  - Yuck :: forall s a. Parser s a -> Parser s a
  - Enter :: forall s a. String -> Parser s a -> Parser s a
- countWidth :: Zip s r -> Int
- fullLog :: Zip s output -> ([String], Tree LogEntry)
- data LogEntry
  - = LLog String
  - | LEmpty
  - | LDislike
  - | LShift
  - | LDone
  - | LFail
  - | LSusp
  - | LS String
- evalL' :: Zip s output -> Zip s output

# Documentation

type Process token result = Zip token (result :< ()) Source #

recoverWith :: Parser s a -> Parser s a Source #

Parse the same thing as the argument, but will be used only as backup. ie, it will be used only if disjuncted with a failing parser.

symbol :: (s -> Bool) -> Parser s s Source #

eof :: Parser s () Source #

lookNext :: Parser s (Maybe s) Source #

testNext :: (Maybe s -> Bool) -> Parser s () Source #

run :: Process s a -> [s] -> (a, [String]) Source #

Run a process (in case you do not need the incremental interface)

mkProcess :: Parser s a -> Process s a Source #

Make a parser into a process.

profile :: Steps s r -> Profile Source #

pushSyms :: [s] -> Zip s r -> Zip s r Source #

Push some symbols.

pushEof :: Zip s r -> Zip s r Source #

Push eof

evalL :: Zip s output -> Zip s output Source #

evalR :: Zip token (a :< rest) -> (a, [String]) Source #

feedZ :: Maybe [s] -> Zip s r -> Zip s r Source #

data Parser s a where Source #

Parser specification

Constructors

Look :: forall s a. Parser s a -> (s -> Parser s a) -> Parser s a |
Yuck :: forall s a. Parser s a -> Parser s a |
Enter :: forall s a. String -> Parser s a -> Parser s a |

#### Instances

Instances details

Alternative (Parser s) Source # |
Instance details Defined in Parser.Incremental Methods empty :: Parser s a Source # (<|>) :: Parser s a -> Parser s a -> Parser s a Source # some :: Parser s a -> Parser s [a] Source # many :: Parser s a -> Parser s [a] Source #
Applicative (Parser s) Source # |
Instance details Defined in Parser.Incremental Methods pure :: a -> Parser s a Source # (<*>) :: Parser s (a -> b) -> Parser s a -> Parser s b Source # liftA2 :: (a -> b -> c) -> Parser s a -> Parser s b -> Parser s c Source # (*>) :: Parser s a -> Parser s b -> Parser s b Source # (<*) :: Parser s a -> Parser s b -> Parser s a Source #
Functor (Parser s) Source # |
Instance details Defined in Parser.Incremental Methods fmap :: (a -> b) -> Parser s a -> Parser s b Source # (<$) :: a -> Parser s b -> Parser s a Source #
Monad (Parser s) Source # |
Instance details Defined in Parser.Incremental Methods (>>=) :: Parser s a -> (a -> Parser s b) -> Parser s b Source # (>>) :: Parser s a -> Parser s b -> Parser s b Source # return :: a -> Parser s a Source #
MonadFail (Parser s) Source # |
Instance details Defined in Parser.Incremental Methods fail :: String -> Parser s a Source #

countWidth :: Zip s r -> Int Source #

fullLog :: Zip s output -> ([String], Tree LogEntry) Source #

data LogEntry Source #

Constructors

LLog String |
LEmpty |
LDislike |
LShift |
LDone |
LFail |
LSusp |
LS String |

#### Instances

Instances details

Show LogEntry Source # |
Instance details Defined in Parser.Incremental Methods showsPrec :: Int -> LogEntry -> ShowS Source # show :: LogEntry -> String Source # showList :: [LogEntry] -> ShowS Source #

evalL' :: Zip s output -> Zip s output Source #