My too simple view of Arrows language
dufrp@oricom.ca
dufrp@oricom.ca
Sat, 02 Jan 1999 13:36:43 -0500 (EST)
Lisp have lists of elements as data structures, where each element can be a list.
As I understand Arrows, rather than lists of lists, it has graphs of graphs.
Lisp have two 'operators' to navigate through the lists: one that give the head of the list,
and the other that represents all the remaining elements.
In Arrows, navigating must be different.
What comes to mind is:
-a function that given an arrow return the node pointed by the arrow (returns the object
without pointers within it) This object can be a graph.
-a function that given an arrow return a list of arrows (but not a list like in Lisp, because an
element of the list cannot be a list, but see last paragraph) I suppose the list itself could be
manipulated the same way as in Lisp.
-a function that given a graph return the current node
I still don't see how to use this for having more than one view at the same thing.
One thing that I like to add is a type to the arrows, that way one way to see the same graph
from different point of view is to visit different types of arrows.
One example of the use of arrow type is in Object-oriented design where one want to have
'is a kind of' type of arrow and 'possess' to distinguish between what will become a subclass,
from what will become a variable nf the class.
But more complex examples cross my mind when I think about database design.
Take this simple case of a library that lend books to people. I here have a very simple graph
with 2 nodes: Books and Persons. And I need a 'rent' type arrow. But I would like to add
the date at which the book must be return to my 'rent' type arrow. How?
Today, we have to rewrite these graph so that these attached objects are either included in
one of the nodes (like adding a date of return field to book, or either we rewrite the graph
in such a way that these arrows with information attached becomes nodes themselves.
One way to solve this would be to have an arrow to the 'date of return' obiect INSIDE the
'rent' arrow. It is not clear what is the status of this 'date of return' object. I means this is
not a node of the graph, yet it is much like one. Saying that there can be pointers inside
pointers is much like saying that my previous function that return the list of arrows of a node
is indeed a list like Lisp (that is an element of the list can be a list too).