machines-0.6.2: Networked stream transducers

LicenseBSD-style (see the file LICENSE)
Safe HaskellNone
LanguageHaskell2010

Data.Machine.MealyT

Description

Synopsis

Documentation

newtype MealyT m a b Source #

Mealy machine, with monadic effects

Constructors

MealyT 

Fields

Instances

AutomatonM MealyT Source # 

Methods

autoT :: Monad m => MealyT m a b -> ProcessT m a b Source #

Monad m => Arrow (MealyT m) Source # 

Methods

arr :: (b -> c) -> MealyT m b c #

first :: MealyT m b c -> MealyT m (b, d) (c, d) #

second :: MealyT m b c -> MealyT m (d, b) (d, c) #

(***) :: MealyT m b c -> MealyT m b' c' -> MealyT m (b, b') (c, c') #

(&&&) :: MealyT m b c -> MealyT m b c' -> MealyT m b (c, c') #

Functor m => Profunctor (MealyT m) Source #

Profunctor Example:

>>> embedMealyT (dimap (+21) (+1) (arr (+1))) [1,2,3 :: Int]
[24,25,26]

Methods

dimap :: (a -> b) -> (c -> d) -> MealyT m b c -> MealyT m a d #

lmap :: (a -> b) -> MealyT m b c -> MealyT m a c #

rmap :: (b -> c) -> MealyT m a b -> MealyT m a c #

(#.) :: Coercible * c b => (b -> c) -> MealyT m a b -> MealyT m a c #

(.#) :: Coercible * b a => MealyT m b c -> (a -> b) -> MealyT m a c #

Monad m => Category * (MealyT m) Source # 

Methods

id :: cat a a #

(.) :: cat b c -> cat a b -> cat a c #

Monad m => Monad (MealyT m a) Source # 

Methods

(>>=) :: MealyT m a a -> (a -> MealyT m a b) -> MealyT m a b #

(>>) :: MealyT m a a -> MealyT m a b -> MealyT m a b #

return :: a -> MealyT m a a #

fail :: String -> MealyT m a a #

Functor m => Functor (MealyT m a) Source # 

Methods

fmap :: (a -> b) -> MealyT m a a -> MealyT m a b #

(<$) :: a -> MealyT m a b -> MealyT m a a #

Applicative m => Applicative (MealyT m a) Source # 

Methods

pure :: a -> MealyT m a a #

(<*>) :: MealyT m a (a -> b) -> MealyT m a a -> MealyT m a b #

(*>) :: MealyT m a a -> MealyT m a b -> MealyT m a b #

(<*) :: MealyT m a a -> MealyT m a b -> MealyT m a a #

Pointed m => Pointed (MealyT m a) Source # 

Methods

point :: a -> MealyT m a a #

arrPure :: (a -> b) -> MealyT Identity a b Source #

arrM :: Functor m => (a -> m b) -> MealyT m a b Source #

upgrade :: Monad m => Mealy a b -> MealyT m a b Source #

scanMealyT :: Monad m => (a -> b -> a) -> a -> MealyT m b a Source #

scanMealyTM :: Functor m => (a -> b -> m a) -> a -> MealyT m b a Source #

embedMealyT :: Monad m => MealyT m a b -> [a] -> m [b] Source #

embedMealyT Example:

>>> embedMealyT (arr (+1)) [1,2,3]
[2,3,4]