Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Zerem f m r = forall s. Zerem (s -> m (Step s f r)) (m s)
- data Step s f r
- next :: (Functor f, Monad m) => Zerem f m r -> m (Either r (f (Zerem f m r)))
- next_ :: (Functor f, Monad m) => Zerem f m r -> m (Maybe (f (Zerem f m r)))
- data InitZerem f m r = forall s. InitZerem (s -> m (Step s f r)) s
- initZerem :: Monad m => Zerem f m r -> m (InitZerem f m r)
- newtype ZipZerem r m a = ZipZerem {
- runZipZerem :: Zerem ((,) a) m r
- newtype ListZerem r m a = ListZerem {
- runListZerem :: Zerem ((,) a) m r
- newtype Pipe u v f g m p a b = Pipe {}
- map :: (Bifunctor f, Functor m) => (a -> b) -> Zerem (f a) m r -> Zerem (f b) m r
- maps :: Functor m => (forall x. f x -> g x) -> Zerem f m r -> Zerem g m r
- mapM :: (Bitraversable f, Monad m) => (a -> m b) -> Zerem (f a) m r -> Zerem (f b) m r
- mapsM :: Monad m => (forall x. f x -> m (g x)) -> Zerem f m r -> Zerem g m r
- flatLift :: Monad m => Zerem f m (m r) -> Zerem f m r
- flatMapLift :: Monad m => (r -> m r') -> Zerem f m r -> Zerem f m r'
- (>>^) :: Monad m => Zerem f m r -> (r -> m r') -> Zerem f m r'
- hoistAny :: (forall x. m x -> n x) -> Zerem f m r -> Zerem f n r
- runZerem :: Monad m => Zerem m m r -> m r
- runZerem_ :: Monad m => Zerem m m r -> m ()
- map_ :: (Comonad f, Monad m) => Zerem f m r -> m r
- maps_ :: Monad m => (forall x. f x -> x) -> Zerem f m r -> m r
- mapM_ :: (Bitraversable f, Comonad (f b), Monad m) => (a -> m b) -> Zerem (f a) m r -> m r
- mapsM_ :: Monad m => (forall x. f x -> m x) -> Zerem f m r -> m r
- foldr :: Monad m => (a -> b -> b) -> (r -> b) -> Zerem ((,) a) m r -> m b
- foldr_ :: Monad m => (a -> b -> b) -> b -> Zerem ((,) a) m r -> m b
- foldrM :: Monad m => (a -> b -> m b) -> (r -> m b) -> Zerem ((,) a) m r -> m b
- foldrM_ :: Monad m => (a -> b -> m b) -> m b -> Zerem ((,) a) m r -> m b
- foldl :: Monad m => (b -> a -> b) -> b -> (b -> r -> b') -> Zerem ((,) a) m r -> m b'
- foldl_ :: Monad m => (b -> a -> b) -> b -> Zerem ((,) a) m r -> m b
- foldlM :: Monad m => (b -> a -> m b) -> m b -> (b -> r -> m b') -> Zerem ((,) a) m r -> m b'
- foldlM_ :: Monad m => (b -> a -> m b) -> m b -> Zerem ((,) a) m r -> m b
- scanl :: (Functor m, Functor g) => (a -> x -> g x) -> x -> (r -> x -> x') -> Zerem ((,) a) m r -> Zerem g m x'
- scanl_ :: (Functor m, Functor g) => (a -> x -> g x) -> x -> Zerem ((,) a) m r -> Zerem g m x
- scansl :: (Functor f, Functor m) => (forall s. f (s, x) -> g (s, x)) -> x -> (r -> x -> x') -> Zerem f m r -> Zerem g m x'
- scansl_ :: (Functor f, Functor m) => (forall s. f (s, x) -> g (s, x)) -> x -> Zerem f m r -> Zerem g m x
- scanMaybel :: Functor m => (a -> x -> (Maybe b, x)) -> x -> (r -> x -> x') -> Zerem ((,) a) m r -> Zerem ((,) b) m x'
- scanMaybel_ :: Functor m => (a -> x -> (Maybe b, x)) -> x -> Zerem ((,) a) m r -> Zerem ((,) b) m x
- catMaybes :: Functor m => Zerem ((,) (Maybe a)) m r -> Zerem ((,) a) m r
- mapMaybe :: Functor m => (a -> Maybe b) -> Zerem ((,) a) m r -> Zerem ((,) b) m r
- concat :: Applicative m => Zerem ((,) [a]) m r -> Zerem ((,) a) m r
- concatMap :: Applicative m => (a -> [b]) -> Zerem ((,) a) m r -> Zerem ((,) b) m r
- filter :: Functor m => (a -> Bool) -> Zerem ((,) a) m r -> Zerem ((,) a) m r
- take :: (Functor f, Applicative m) => Int -> Zerem f m r -> Zerem f m ()
- drop :: (Comonad f, Functor m) => Int -> Zerem f m r -> Zerem f m r
- yield :: Applicative m => a -> Zerem ((,) a) m ()
- yieldMany :: (Foldable f, Applicative m) => f a -> Zerem ((,) a) m ()
- yieldM :: Applicative m => m a -> Zerem ((,) a) m ()
- yieldManyM :: (Foldable f, Applicative m) => f (m a) -> Zerem ((,) a) m ()
- concatStream :: (Functor m, Functor g) => (s -> m (Step s g u)) -> Zerem ((,) s) m r -> Zerem g m r
- mtimes :: (Monad m, Functor f) => Int -> Zerem f m r -> Zerem f m ()
Purpose
.
The stream datatype. It consists of a state machine, and an action that yields the initial state.
Instances
MFunctor (Zerem f :: (Type -> Type) -> Type -> Type) Source # | |
MonadTrans (Zerem a) Source # | |
(Functor f, Monad m) => Applicative (Zerem f m) Source # | Not lazy on its arguments. If you use something like: as = yield the program will go into an infinite loop. For that kind of construction, consider using functions
from the as = Zerem next (pure a) where next a = pure $ Z.Yield (a, a) |
Functor m => Functor (Zerem f m) Source # | |
(Functor f, Monad m) => Monad (Zerem f m) Source # | |
(Functor f, Monad m) => Monoid (Zerem f m ()) Source # | |
(Functor f, Monad m) => Semigroup (Zerem f m r) Source # | |
Done r | Stream is over and |
Skip s | Stream is transitioning state without yielding. |
Yield !(f s) | Stream yields a functor. Usually |
Instances
Foldable (Step s f) Source # | |
Defined in Zerem fold :: Monoid m => Step s f m -> m # foldMap :: Monoid m => (a -> m) -> Step s f a -> m # foldMap' :: Monoid m => (a -> m) -> Step s f a -> m # foldr :: (a -> b -> b) -> b -> Step s f a -> b # foldr' :: (a -> b -> b) -> b -> Step s f a -> b # foldl :: (b -> a -> b) -> b -> Step s f a -> b # foldl' :: (b -> a -> b) -> b -> Step s f a -> b # foldr1 :: (a -> a -> a) -> Step s f a -> a # foldl1 :: (a -> a -> a) -> Step s f a -> a # elem :: Eq a => a -> Step s f a -> Bool # maximum :: Ord a => Step s f a -> a # minimum :: Ord a => Step s f a -> a # | |
Traversable (Step s f) Source # | |
Functor (Step s f) Source # | |
newtype ZipZerem r m a Source #
ZipZerem | |
|
Instances
newtype ListZerem r m a Source #
ListZerem | |
|
Instances
newtype Pipe u v f g m p a b Source #
Instances
ProfunctorFunctor (Pipe u v f g m :: (Type -> Type -> Type) -> Type -> Type -> Type) Source # | |
Category p => Category (Pipe u u f f m p :: Type -> Type -> Type) Source # | |
ProfunctorMonad (Pipe Void Void (,) (,) Identity) Source # | |
(Profunctor p, Bifunctor g, Functor m) => Choice (Pipe u v (,) g m p) Source # | |
(Profunctor p, Bifunctor f, Bifunctor g, Functor m) => Profunctor (Pipe u v f g m p) Source # | |
Defined in Zerem dimap :: (a -> b) -> (c -> d) -> Pipe u v f g m p b c -> Pipe u v f g m p a d lmap :: (a -> b) -> Pipe u v f g m p b c -> Pipe u v f g m p a c rmap :: (b -> c) -> Pipe u v f g m p a b -> Pipe u v f g m p a c (#.) :: forall a b c q. Coercible c b => q b c -> Pipe u v f g m p a b -> Pipe u v f g m p a c (.#) :: forall a b c q. Coercible b a => Pipe u v f g m p b c -> q a b -> Pipe u v f g m p a c | |
(Profunctor p, Bifunctor g, Functor m) => Functor (Pipe u v f g m p a) Source # | |
Mapping
Folding
foldlM :: Monad m => (b -> a -> m b) -> m b -> (b -> r -> m b') -> Zerem ((,) a) m r -> m b' Source #
Scanning
scanl :: (Functor m, Functor g) => (a -> x -> g x) -> x -> (r -> x -> x') -> Zerem ((,) a) m r -> Zerem g m x' Source #
scanl_ :: (Functor m, Functor g) => (a -> x -> g x) -> x -> Zerem ((,) a) m r -> Zerem g m x Source #
scansl :: (Functor f, Functor m) => (forall s. f (s, x) -> g (s, x)) -> x -> (r -> x -> x') -> Zerem f m r -> Zerem g m x' Source #
scansl_ :: (Functor f, Functor m) => (forall s. f (s, x) -> g (s, x)) -> x -> Zerem f m r -> Zerem g m x Source #
Filtering
scanMaybel :: Functor m => (a -> x -> (Maybe b, x)) -> x -> (r -> x -> x') -> Zerem ((,) a) m r -> Zerem ((,) b) m x' Source #
scanMaybel_ :: Functor m => (a -> x -> (Maybe b, x)) -> x -> Zerem ((,) a) m r -> Zerem ((,) b) m x Source #
Generating
yieldManyM :: (Foldable f, Applicative m) => f (m a) -> Zerem ((,) a) m () Source #