At 2002-06-03 09:22, Wolfgang Jeltsch wrote:
I think, it would be better to * create a class, which has only an identity and a composition member, and call this class Arrow or Morphism; * create a subclass of this class which introduces pure (arr); * create a subclass of the class introducing pure in order to introduce first.
I agree. I have something similar in my experimental alternative Prelude project 'HBase', but only two classes: <http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/hbase/Source/Cat egory/Composition.hs?rev=HEAD&content-type=text/plain> <http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/hbase/Source/Cat egory/Arrow.hs?rev=HEAD&content-type=text/plain> I call them 'Compositor' and 'Arrow'. I see two issues: 1. Should I add your intermediate class? Do you have examples of something that has 'pure' but not 'first'? 2. What are the best names? I used 'Arrow' because it's for "arrows" as defined by John Hughes <http://haskell.cs.yale.edu/arrows/>. I might change 'Compositor' to 'Morphism' if it makes more sense to people. As you point out, Hughes' "arrows" are a strict subset of category theory "arrows". -- Ashley Yakeley, Seattle WA
At 2002-06-04 06:39 CEST Ashley Yakeley wrote:
[...] 1. Should I add your intermediate class? Do you have examples of something that has 'pure' but not 'first'?
Of course! My Parser type. As I wrote earlier I cannot see a meaningful definition of first for it. You may also try to find a definition for (&&&) and see that there is not a meaningful one. (&&&) for Parser would have the type Parser t v -> Parser t v' -> Parser t (v,v'). The first argument would read some tokens of type t in order to produce a result of type v; the second argument would possibly read a different number of tokens to produce a result of type v'. How many tokens should the result parser read?
2. What are the best names? I used 'Arrow' because it's for "arrows" as defined by John Hughes <http://haskell.cs.yale.edu/arrows/>. I might change 'Compositor' to 'Morphism' if it makes more sense to people.
I think, Morphism would be a good name for your Compositor class. Because I feel the need for a arrow class with pure but without first, I would create a subclass of Morphism which introduces pure and call this class Arrow. Further on, I would exclude first from ArrowChoice by making ArrowChoice a subclass of my Arrow class and letting it introduce only left, right, (+++) and (|||). In a similar way I would exclude first from every other arrow class that doesn't need it. I would create a class ArrowCombine being a subclass of my Arrow class and introducing first, second, (***) and (&&&). Because the relation between ArrowCombine and Arrow would be very, very similar to the relation between ArrowChoice and Arrow, I think it's bad to name the class, which introduces first, just Arrow. Instead, I think, its name should be similar to ArrowChoice. That's why I'd name it ArrowCombine and take the name Arrow for the class without first.
[...]
Wolfgang
participants (2)
-
Ashley Yakeley -
Wolfgang Jeltsch