[Haskell-cafe] How to implement a digital filter, using Arrows?
David Barbour
dmbarbour at gmail.com
Thu Oct 20 05:53:42 CEST 2011
On Wed, Oct 19, 2011 at 8:07 PM, Captain Freako <capn.freako at gmail.com>wrote:
> One more question on the `runAuto' code, John:
>
> If I understand the code correctly, `f' is an arrow. Yet, we're using
> it on the right side of `=' in a simple assignment. How are we getting
> away with that?
>
> Thanks,
> -db
>
> liftAu' f s0 = proc x -> do
>> rec (y,s') <- arr f -< (x,s)
>> s <- delay s0 -< s'
>> returnA -< (y,s)
>
>
The value `f` is a function - a parameter of liftAu'. While all functions
are arrows (Arrow is defined on (->)), the value `arr f` is an arrow of the
automaton model. The `=` symbol is used to define the liftAu function. What
are you imagining?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20111019/79642b54/attachment.htm>
More information about the Haskell-Cafe
mailing list