On Tue, Mar 23, 2010 at 1:10 PM, Sandro Magi <[email protected]> wrote:
> On 23/03/2010 3:55 PM, Jonathan S. Shapiro wrote:

> Sealed classes bring algebraic types under the same abstraction
> mechanism, and it seems pretty elegant to me....

I'm not convinced that unifying product types and sum types under a
single syntax is necessarily a good thing. That said, here are some
moderately strange aspects (strange != bad) of the syntactic
unification:

1. Union legs can now be closed over private state.
2. Unions can now have methods. This is moderately strange, but
perhaps not a bad thing.
3. If a common syntax is used, and we also end up folding inheritance
into these classes, unions will be able to derive from other objects.
4. Pattern matching doesn't work the same way in BitC, and I need to
think a bit about how to translate this idea into BitC terms.

> Do you have a better way to integrate algebraic types into this framework?

Not at the moment.


shap
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to