[Haskell-cafe] Question, re: using Automaton

Captain Freako capn.freako at gmail.com
Sun Oct 16 02:40:36 CEST 2011


Hi all,

In this excerpt from the
Automaton<http://hackage.haskell.org/packages/archive/arrows/0.4.1.2/doc/html/Control-Arrow-Transformer-Automaton.html#t:Automaton>page:

runAutomaton ::
(ArrowLoopC<http://hackage.haskell.org/packages/archive/base/4.2.0.2/doc/html/Control-Arrow.html#t:ArrowLoop>a,
ArrowApply<http://hackage.haskell.org/packages/archive/base/4.2.0.2/doc/html/Control-Arrow.html#t:ArrowApply>a)
=>
Automaton<http://hackage.haskell.org/packages/archive/arrows/0.4.1.2/doc/html/Control-Arrow-Transformer-Automaton.html#t:Automaton>a
(e, b) c -> a (e,
Stream<http://hackage.haskell.org/packages/archive/Stream/0.4.1/doc/html/Data-Stream.html#t:Stream>b)
(
Stream<http://hackage.haskell.org/packages/archive/Stream/0.4.1/doc/html/Data-Stream.html#t:Stream>c)
Source<http://hackage.haskell.org/packages/archive/arrows/0.4.1.2/doc/html/src/Control-Arrow-Transformer-Automaton.html#runAutomaton>

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.
Could someone replace the ellipses w/ an expression that would compile and
make sense?
(I'm really struggling, trying to understand this example.)

Thanks!
-db
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20111015/3c85bdde/attachment.htm>


More information about the Haskell-Cafe mailing list