[Haskell-cafe] zigzag data structure

Brian McQueen mcqueenorama at gmail.com
Thu Dec 22 22:17:31 EST 2005

I'm curious what this user community would come up with in order to
implement the curious zigzag data structure.  If you haven't heard
anything about it, its a simple but peculiar idea, by the guy who
dreamed up the Xanadu project:  http://xanadu.com/zigzag/. 
Conceptually it is "cells" with some sort of value, where each cell
has any number of connections to any other cell, but the connections
are conceptually labeled/grouped as though they were dimensions.  So a
cell with the value "Brian McQueen" would have a link to "dorky guy"
in the Description dimension, and a link to "519 S. Frances" in the
Street Address dimension.  Obviously most people would have links in
those same dimensions passing through their own name's cell.  My cell
might have a pointer to "Hector" in the Hero dimension while a
conceited man might have a link right back to itself in that same Hero
direction.  So the structure is very flexible.  There are interesting
examples on the web site of a Day Planner type of an app where each
day has a time line and each time has appointments and the
appointments have attendees and they all have personal contact
information ...  But its all logically linked.

I imagine it would be something like this in C-like code:

struct cell { value; ptr_to_links };
struct link { { dimension; ptr_to_destination; ptr_to_link; };
struct dimension { name; id; } ;

As I write this I realise that I don't remember much, if any,
discussion in this group about data structures.  I may be starting
with a non-functional way of thinking.

BTW I'm mostly still at the reading Haskell and fiddling with ghci phase.

Brian McQueen

More information about the Haskell-Cafe mailing list