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

David Barbour dmbarbour at gmail.com
Thu Oct 20 18:30:59 CEST 2011


On Thu, Oct 20, 2011 at 5:19 AM, Captain Freako <capn.freako at gmail.com>wrote:

> Hi David,
>
> I was referring to the `f' in the `runAuto' function, not the `liftAu'
> function.
>
> -db
>
>
Ah, I see. You quoted one thing and spoke of another, and I got all
confused. Keep in mind that functions are arrows (instance Arrow (->)).

> type FilterAu b c = Automaton (->) b c
> runAuto :: FilterAu b c -> [b] -> [c]
> runAuto a             []     = []
> runAuto (Automaton f) (x:xs) = let
>   (y,a) = f x
>   in y:runAuto a xs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20111020/1e0d8274/attachment.htm>


More information about the Haskell-Cafe mailing list