machines-0.6.3: Networked stream transducers

Copyright(C) 2012 Edward Kmett
LicenseBSD-style (see the file LICENSE)
MaintainerEdward Kmett <ekmett@gmail.com>
Stabilityprovisional
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Data.Machine.Moore

Description

Synopsis

Documentation

data Moore a b Source #

Moore machines

Constructors

Moore b (a -> Moore a b) 

Instances

Corepresentable Moore Source # 

Associated Types

type Corep (Moore :: * -> * -> *) :: * -> * #

Methods

cotabulate :: (Corep Moore d -> c) -> Moore d c #

Closed Moore Source # 

Methods

closed :: Moore a b -> Moore (x -> a) (x -> b) #

Costrong Moore Source # 

Methods

unfirst :: Moore (a, d) (b, d) -> Moore a b #

unsecond :: Moore (d, a) (d, b) -> Moore a b #

Profunctor Moore Source # 

Methods

dimap :: (a -> b) -> (c -> d) -> Moore b c -> Moore a d #

lmap :: (a -> b) -> Moore b c -> Moore a c #

rmap :: (b -> c) -> Moore a b -> Moore a c #

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

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

Automaton Moore Source # 

Methods

auto :: Moore a b -> Process a b Source #

Cosieve Moore [] Source # 

Methods

cosieve :: Moore a b -> [a] -> b #

Monad (Moore a) Source #

slow diagonalization

Methods

(>>=) :: Moore a a -> (a -> Moore a b) -> Moore a b #

(>>) :: Moore a a -> Moore a b -> Moore a b #

return :: a -> Moore a a #

fail :: String -> Moore a a #

Functor (Moore a) Source # 

Methods

fmap :: (a -> b) -> Moore a a -> Moore a b #

(<$) :: a -> Moore a b -> Moore a a #

MonadFix (Moore a) Source # 

Methods

mfix :: (a -> Moore a a) -> Moore a a #

Applicative (Moore a) Source # 

Methods

pure :: a -> Moore a a #

(<*>) :: Moore a (a -> b) -> Moore a a -> Moore a b #

(*>) :: Moore a a -> Moore a b -> Moore a b #

(<*) :: Moore a a -> Moore a b -> Moore a a #

Distributive (Moore a) Source # 

Methods

distribute :: Functor f => f (Moore a a) -> Moore a (f a) #

collect :: Functor f => (a -> Moore a b) -> f a -> Moore a (f b) #

distributeM :: Monad m => m (Moore a a) -> Moore a (m a) #

collectM :: Monad m => (a -> Moore a b) -> m a -> Moore a (m b) #

Representable (Moore a) Source # 

Associated Types

type Rep (Moore a :: * -> *) :: * #

Methods

tabulate :: (Rep (Moore a) -> a) -> Moore a a #

index :: Moore a a -> Rep (Moore a) -> a #

MonadZip (Moore a) Source # 

Methods

mzip :: Moore a a -> Moore a b -> Moore a (a, b) #

mzipWith :: (a -> b -> c) -> Moore a a -> Moore a b -> Moore a c #

munzip :: Moore a (a, b) -> (Moore a a, Moore a b) #

Comonad (Moore a) Source # 

Methods

extract :: Moore a a -> a #

duplicate :: Moore a a -> Moore a (Moore a a) #

extend :: (Moore a a -> b) -> Moore a a -> Moore a b #

ComonadApply (Moore a) Source # 

Methods

(<@>) :: Moore a (a -> b) -> Moore a a -> Moore a b #

(@>) :: Moore a a -> Moore a b -> Moore a b #

(<@) :: Moore a a -> Moore a b -> Moore a a #

Copointed (Moore a) Source # 

Methods

copoint :: Moore a a -> a #

Pointed (Moore a) Source # 

Methods

point :: a -> Moore a a #

MonadReader [a] (Moore a) Source # 

Methods

ask :: Moore a [a] #

local :: ([a] -> [a]) -> Moore a a -> Moore a a #

reader :: ([a] -> a) -> Moore a a #

type Corep Moore Source # 
type Corep Moore = []
type Rep (Moore a) Source # 
type Rep (Moore a) = [a]

logMoore :: Monoid m => Moore m m Source #

Accumulate the input as a sequence.

unfoldMoore :: (s -> (b, a -> s)) -> s -> Moore a b Source #

Construct a Moore machine from a state valuation and transition function