babynf-0.1.0.2: Library for generating parsers from ABNF
Safe HaskellSafe-Inferred
LanguageGHC2021

Data.BAByNF.Util.Stream

Documentation

newtype Stream e a Source #

Constructors

Stream 

Fields

Instances

Instances details
Applicative (Stream e) Source # 
Instance details

Defined in Data.BAByNF.Util.Stream

Methods

pure :: a -> Stream e a #

(<*>) :: Stream e (a -> b) -> Stream e a -> Stream e b #

liftA2 :: (a -> b -> c) -> Stream e a -> Stream e b -> Stream e c #

(*>) :: Stream e a -> Stream e b -> Stream e b #

(<*) :: Stream e a -> Stream e b -> Stream e a #

Functor (Stream e) Source # 
Instance details

Defined in Data.BAByNF.Util.Stream

Methods

fmap :: (a -> b) -> Stream e a -> Stream e b #

(<$) :: a -> Stream e b -> Stream e a #

Monad (Stream e) Source # 
Instance details

Defined in Data.BAByNF.Util.Stream

Methods

(>>=) :: Stream e a -> (a -> Stream e b) -> Stream e b #

(>>) :: Stream e a -> Stream e b -> Stream e b #

return :: a -> Stream e a #

runStream_ :: Stream e a -> [e] -> a Source #

takeIf :: (e -> Bool) -> Stream e (Maybe e) Source #

dropIf :: (e -> Bool) -> Stream e () Source #

takeWhile :: (e -> Bool) -> Stream e [e] Source #

dropWhile :: (e -> Bool) -> Stream e () Source #

find :: (e -> Bool) -> Stream e (Maybe e) Source #

findSeq :: (e -> Bool) -> Stream e [e] Source #

takeIfMap :: (e -> Maybe a) -> Stream e (Maybe a) Source #

takeWhileMap :: (e -> Maybe a) -> Stream e [a] Source #

findMap :: (e -> Maybe a) -> Stream e (Maybe a) Source #

findSeqMap :: (e -> Maybe a) -> Stream e [a] Source #

either :: Stream e (Either l a) -> (a -> Stream e b) -> Stream e (Either l b) Source #

either' :: Stream e (Either l a) -> (a -> Stream e (Either l b)) -> Stream e (Either l b) Source #

class Propagate (p :: Type -> Type) where Source #

Methods

propagate :: Monad m => m (p a) -> (a -> m (p b)) -> m (p b) Source #

Instances

Instances details
Propagate Maybe Source # 
Instance details

Defined in Data.BAByNF.Util.Stream

Methods

propagate :: Monad m => m (Maybe a) -> (a -> m (Maybe b)) -> m (Maybe b) Source #

Propagate (Either a) Source # 
Instance details

Defined in Data.BAByNF.Util.Stream

Methods

propagate :: Monad m => m (Either a a0) -> (a0 -> m (Either a b)) -> m (Either a b) Source #

propagate' :: (Propagate p, Monad m) => m (p a) -> m (p b) -> m (p b) Source #