A newbie question about Arrows.

Nicolas.Oury noury@ens-lyon.fr
Tue, 7 Jan 2003 18:22:53 +0100 (CET)


I may be totally wrong, but I read in Hughes paper than in Stream
Processors, Either is "more a product" than (,) . It could be interesting
to parameter the arrow by product, in order than the multiplexing is done
using this product when using the new notation for arrow.


Best regards,
Nicolas Oury

On Mon, 6 Jan 2003, Ashley Yakeley wrote:

> At 2003-01-06 03:14, Ross Paterson wrote:
>
> >class PreArrow ar where
> >	arr :: (a -> b) -> ar a b
> >	(>>>) :: ar a b -> ar b c -> ar a c
> ...
> >	class (PreArrow ar, Monoidal p u) => GenArrow ar p u where
> >		first :: ar a b -> ar (p a c) (p b c)
>
> My own preference is something like this:
>
>  	class (PreArrow ar) => GenArrow' ar where
> 	  	arrApply :: ar p (q -> r) -> ar p q -> ar p r
>
> My GenArrow' is actually equivalent to Hughes' Arrow and I assume your
> GenArrow.
>
> In an ideal world, I could leverage my FunctorApply class to have
> something like this:
>
>  	class (Functor f) => FunctorApply f where
>   		-- first arg (fab) "executed" first
> 	  	fApply :: f (a -> b) -> (f a -> f b)
>
>     -- first arg (fa) "executed" first
>     fPassTo :: f a -> f (a -> b) -> f b
>     fPassTo fa fab = fApply (fmap (\a ab -> ab a) fa) fab
>
>   class (PreArrow ar,forall p. FunctorApply (ar p)) => GenArrow'' ar
>
> Unfortunately, GHC does not yet allow this kind of superclassing.
>
> <http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/hbase/Source/HBa
> se/Category/Functor.hs?rev=HEAD&content-type=text/plain>
> <http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/hbase/Source/HBa
> se/Category/Arrow.hs?rev=HEAD&content-type=text/plain>
>
> --
> Ashley Yakeley, Seattle WA
>
>