machines-0.6.4: 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 # 
Instance details

Defined in Data.Machine.MealyT

Methods

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

Monad m => Arrow (MealyT m) Source # 
Instance details

Defined in Data.Machine.MealyT

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]
Instance details

Defined in Data.Machine.MealyT

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 => q b c -> MealyT m a b -> MealyT m a c #

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

Monad m => Category (MealyT m :: * -> * -> *) Source # 
Instance details

Defined in Data.Machine.MealyT

Methods

id :: MealyT m a a #

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

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

Defined in Data.Machine.MealyT

Methods

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

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

return :: a0 -> MealyT m a a0 #

fail :: String -> MealyT m a a0 #

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

Defined in Data.Machine.MealyT

Methods

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

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

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

Defined in Data.Machine.MealyT

Methods

pure :: a0 -> MealyT m a a0 #

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

liftA2 :: (a0 -> b -> c) -> MealyT m a a0 -> MealyT m a b -> MealyT m a c #

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

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

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

Defined in Data.Machine.MealyT

Methods

point :: a0 -> MealyT m a a0 #

(Semigroup b, Monad m) => Semigroup (MealyT m a b) Source # 
Instance details

Defined in Data.Machine.MealyT

Methods

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

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

stimes :: Integral b0 => b0 -> MealyT m a b -> MealyT m a b #

(Monoid b, Monad m) => Monoid (MealyT m a b) Source # 
Instance details

Defined in Data.Machine.MealyT

Methods

mempty :: MealyT m a b #

mappend :: MealyT m a b -> MealyT m a b -> MealyT m a b #

mconcat :: [MealyT m a b] -> MealyT m a b #

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]