Boost logo

Boost :

From: Esa Pulkkinen (esa.pulkkinen_at_[hidden])
Date: 2002-06-11 13:01:59


>>Douglas Gregor wrote:
>>http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?Variant
>> Here's the current requirements list from the Wiki
>page:

There is a great paper on union types, which describes (some) ideas on
what such union type should include:

"Poll: Subtyping and inheritance for inductive types"
<http://www.cs.kun.nl/~erikpoll/publications/durham97.html>. I think
this is a must-read for the design of interface for union types!

Also, the visitor pattern is actually exactly the same as 'fold' is in
functional languages, which is very closely related to unions. The
corresponding inverse operation ("unfold") is also something I think
should be remembered [a way to think of it is that 'visitor' (fold)
reads (or destroys if you believe in functional languages) information
from a data structure based on an algorithm and the unfold will
construct such data structure based on an algorithm.]. In particular,
using a visitor in conjunction with an 'unfold' operation will allow you
to translate between any two variant data structures that have
isomorphic structure.

For more information about these, see:

"Meijer, Hutton: Bananas in Space: Extending fold and unfold to
exponential types" <http://citeseer.nj.nec.com/293490.html>.

"Wehr: Non-uniform recursion: The solution (minimal sorting for fold)"
<http://citeseer.nj.nec.com/wehr00nonuniform.html>.

In message <20020611152511.68249.qmail_at_[hidden]>,
Itay Maman writes:
>The fourth aspect relates to the issue of variant to
>variant assigmnet:
[SNIP]
>(i) Compile-time error if List2 is not a sub set of List1.

I think this would be the best approach. [reasons are described in the
above paper by E.Poll].

-- 
  Esa Pulkkinen

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk