[Haskell-cafe] How to implement a digital filter, using Arrows?

Captain Freako capn.freako at gmail.com
Thu Oct 20 14:19:31 CEST 2011


Hi David,

I was referring to the `f' in the `runAuto' function, not the `liftAu' function.

-db

On Wed, Oct 19, 2011 at 8:53 PM, David Barbour <dmbarbour at gmail.com> wrote:
> 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?
>
>



More information about the Haskell-Cafe mailing list