arrows-0.4.4.1: Arrow classes and transformers

Copyright(c) Ross Paterson 2003
LicenseBSD-style (see the LICENSE file in the distribution)
Maintainerross@soi.city.ac.uk
Stabilityexperimental
Portabilitynon-portable (multi-parameter type classes)
Safe HaskellSafe-Inferred
LanguageHaskell98

Control.Arrow.Transformer.Automaton

Description

Simple Mealy-style automata.

Synopsis

Documentation

newtype Automaton a b c Source

An arrow type comprising Mealy-style automata, each step of which is is a computation in the original arrow type.

Constructors

Automaton (a b (c, Automaton a b c)) 

runAutomaton :: (ArrowLoop a, ArrowApply a) => Automaton a (e, b) c -> a (e, Stream b) (Stream c) Source

Encapsulating an automaton by running it on a stream of inputs, obtaining a stream of outputs.

Typical usage in arrow notation:

	proc p -> do
		...
		ys <- (|runAutomaton (\x -> ...)|) xs

Here xs refers to the input stream and x to individual elements of that stream. ys is bound to the output stream.