Tim about applications of polytypic programming:

>I didn't mean to imply that business applications involve any
sophisticated data
>structures. I had in mind just the kind of boring record values you mention,
>with no recursion required. Nonetheless, these record values need to be
stored,
>edited and moved around (and there are *many* different record types). In
order
>to do this we have to either write code for each type (error-prone,
boring, and
>a lot of work because there are so many) or write polytypic code e.g. a
>polytypic editor (this is discussed briefly by the fudgets authors),
polytypic
>code to flatten/unflatten records for storage or transport (there isn't much
>flattening needed for non-recursive records, but we do need to squash all the
>fields together into a blob of bytes, and probably convert to network byte
>order; and occasionally we will have a container full of records to deal
with),
>and similar code for getting records in and out of relational databases.

I'm happy you mention these applications: they are the reason why we
developed PolyP. For example, in our ESOP paper:

P. Jansson and J. Jeuring. Polytypic compact printing and parsing. In S.
Doaitse Swierstra, editor, Proceedings European Symposium on Programming,
ESOP'99, LNCS 1576, pages 273--287, Springer-Verlag, 1999. 

we develop a program that transforms a value of a datatype to a compact
representation. At the moment we are working on an extension of this
article, in which we show how to separate structure from content, how to
pretty print and parse datatype values, and how to transform datatype
values into a database format. I think these are the kind of applications
polytypic programming is useful for. The programs are pretty complicated,
and certainly not easy to read (and I'm afraid the same holds for our
articles), but the idea of course is that you write them once, and use them
very often.

> > | Also, the categorical prelude (not sure about PolyP) does not provide

> > | a way to get access to type/field names (this is not interesting from
> > | a CS POV, but would be very useful for automatically generated GUIs
> > | for editing records).

PolyP does provide a way to access constructor names, and this is essential
for many of the programs we have developed. But we have been criticized by
category theorists for this...

-- Johan


Reply via email to