Re: [Haskell-cafe] ArrowLoop examples?

2004-10-27 Thread Ross Paterson
On Sat, Oct 23, 2004 at 08:55:16PM +0300, Einar Karttunen wrote:
 Are there any examples of using ArrowLoop outside the signal
 functions? Instances are declared for ordinary functions and 
 Kleisli arrows, but how should they be actually used?

You wouldn't normally use those instances directly.  With ordinary
functions, you can just use recursion; with monads you can use
Control.Monad.Fix.mfix (or monadic do-notation, which reduces to the same
thing).  Using loop for such arrows would be equivalent, but more awkward.

Most of the useful examples seen so far in proper arrows have been
in the different kinds of signal processors.  Another example might
be plumbing of attributes in a parsing arrow (though the loop in this
case doesn't satisfy right tightening), where you want to pass values
of later symbols to the parsers for earlier ones.  With a monadic parser
you'd do this using with mfix; with an arrow-based one, you'd use loop.
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] ArrowLoop examples?

2004-10-23 Thread Einar Karttunen
Hello

Are there any examples of using ArrowLoop outside the signal
functions? Instances are declared for ordinary functions and 
Kleisli arrows, but how should they be actually used?

- Einar Karttunen
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe