interface for libraries (rather than monads).

It seems like he would supply a monad interface to arrow libraries
for those libraries which are expressible as monads and for which the user
prefers the monad primitives.

The monad interface to arrows would be completely generic. The
library writer would still expose the library using arrows not monads.

As a library user, I think I would prefer the arrow interface to the Monad
interface. For example, even for basic stuff like IO programming, the 
arrow interface seems to give you more power.

Speculatively (e.g. I am guessing here), arrows could make Haskell an
extremely powerful shell programming language as you could easily pipe I/O
to/from various Haskell libraries with arrow interfaces (pipes).  If 
I understand correctly, Monads require you to do some extra homework to
get concurrency working properly in this context.  Hence the point in the
paper about arrows being a generalization of the fudgets concurrency
abstractions.  More generally you could access any external unix process
in the same way you access arrow libraries so that rather than using a
regexp library written in Haskell, you just pipe your Haskell String
through unix grep.
e.g.

> foo = catFile myFile >>> sys ["grep",mystring] >>> someArrowLib

And other much more complex stuff involving multiple input and
output files.

-Alex-

PS. Notationally, pointfree works fine for much shell programming of this
type

___________________________________________________________________
S. Alexander Jacobson                   i2x Media  
1-212-697-0184 voice                    1-212-697-1427 fax



On Thu, 28 Jan 1999, David Bakin (Exchange) wrote:

> Except that he does say in the conclusion of the paper:  "This paper
> proposes the replacement of monads as a structuring tool for combinator
> libraries, by arrows."  
> 
> I don't think he made that argument though; I think the argument he made was
> that arrows could be an alternative structuring tool for combinator
> libraries that supply additional power at some cost in convenience.  The
> second paragraph of the conclusion pretty much describes when arrows could
> and should be used.  And he ends the paper with "In short, we believe that
> arrows offer a useful extension to the generality of generic library
> interfaces", a reasonable (and understated) claim.
> 
> -- Dave
> 
> -----Original Message-----
> From: David Barton [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 28, 1999 7:44 AM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Re: syntactic sugar for "arrows"
> 
> 
> Michael Hobbs writes:
> 
>    Yes, I can see how the arrow paradigm would work very well for
>    things such as parsing LL(1) grammars, but I could not see how such
>    a scheme could become a _replacement_ for monads in general purpose
>    programming.  Perhaps I was expecting the wrong thing from the
>    concept...
> 
> I agree, and (not to speak for John Hughes, but I will anyway) I
> suspect John would as well. 
> 









Reply via email to