[Haskell-cafe] Question, re: using Automaton

Paterson, Ross R.Paterson at city.ac.uk
Sun Oct 16 18:22:26 CEST 2011

Captain Freako (quoting Control.Arrow.Transformer.Automaton):
> 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?

That ... thing isn't an expression, but rather a command, the sort of thing you can put in the body of a proc.
This should be an example:

        proc p -> do
                ys <- (|runAutomaton (\x -> delay 0 -< x+1)|) xs

More information about the Haskell-Cafe mailing list