[Haskell-cafe] Work on Collections Processing Arrows?
David Barbour
dmbarbour at gmail.com
Mon May 9 21:02:10 CEST 2011
Has anyone developed a typeclass model for (Control.Monad.mapM) and related
functions for arrows?
I've a preliminary model, using Adam Megacz's Generalized Arrows, of the
form:
class (GArrowDrop a (**) u) => GArrowMap_ a (**) u c where
mapA_ :: a d u -> a (c d) u
class (GArrow a (**) u c) => GArrowMap a (**) u c where
mapA :: a d r -> a (c d) (c r)
class (GArrowMap a (**) u c) => GArrowJoin a (**) u c where
join :: a d (c r) -> a (c d) (c r)
class (GArrow a (**) u) => GArrowUnion a (**) u c where
union :: a ((c r) ** (c r)) (c r)
class (GArrowMap a (**) u c, GArrow a (++) v) => GArrowPartition a (**) u
(++) v c where
partition :: a d (q ++ r) -> a (c d) ((c q) ** (c r))
Motivations: regular arrows (including GArrows) expose simple products for
behavior, but those have a static 'width' and don't seem suitable for
processing large values. ArrowApply would give me a dynamic amount of
processing, but seems excessively expressive. In my own case, 'c' might be
representing an asynchronous or distributed, reactive collection, so the
ability to restrict expressiveness is important for performance.
I'm wondering if you know of any other work along the same lines.
Thank you,
Dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20110509/66b6b3f3/attachment.htm>
More information about the Haskell-Cafe
mailing list