Bill Page <bill.p...@newsynthesis.org> writes: | I think one might reasonably expect that | | f(x:Ring) : LinearAggregate(x) == List (x) | | would work. And in almost does (at least in OpenAxiom): | | (1) -> f(x:Ring) : LinearAggregate(x) == List (x) | | x is not a valid type. | | Unfortunately the interpreter in OpenAxiom does not treat categories | in quite the same way as the compiler.
Hi Bill, I would like to understand better what the real problem is, what you would like to express -- not a Spad code but rather the *idea* you would like to express, then we could see how to express it or what it would take to express it. Background: Categories are predicates, not types in the traditional sense of a prescription of data representation -- unlike domains. A value /belongs/ to a *unique* domain. That is one of the reasons why it is some simple to talk about "first class object": you know how to represent their storage, how to pass them around, etc. A domain /can satisfy/ several categories (e.g. predicates) at the same time. If you treat a category as a type that prescribes representation, then their is a question of how do you express the notion that a value has several representation -- has opposed to one. How do you go from one representation to the next? How do you know which representation is going to be needed down the pipeline after several calls? Interestingly the Haskell folks also ran into similar issue in the past. During a recent 4-day visit at TAMU [1], Simon Peyton Jones and I violently agreed that categories or C++ concepts or Haskell type classes (we were discussing similarities and dissimilatiries between C++ concepts and Haskell type classes) are best treated as not types in the traditional sense of describing data -- or else, one might run into serious logical an implementation issues. They are non-representational predicates. In OpenAxiom, we sidestep the issue by saying that there is a domain called Domain that represents all domains as *values*. Similarly, we have a domain named Category that represents all categories as *values* -- yes that `Category' that you put as a return type of a category constructor is a real domain (not a fake one) in OpenAxiom. (I believe Haskell has similar functionality through its Template Haskell extension[2]) [1] https://parasol.tamu.edu/seminar/abstract.php?talk_id=659 [2] http://www.haskell.org/haskellwiki/Template_Haskell | There is however the domain of | domains in OpenAxiom so we may write: | | (1) -> f(x:Domain) : Domain == List (x) | Function declaration f : Domain -> Domain has been added to | workspace. | Type: Void | (2) -> f(Integer) | Compiling function f with type Domain -> Domain | | (2) List Integer Yes. -- Gaby ------------------------------------------------------------------------------ Get a FREE DOWNLOAD! and learn more about uberSVN rich system, user administration capabilities and model configuration. Take the hassle out of deploying and managing Subversion and the tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2 _______________________________________________ open-axiom-devel mailing list open-axiom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/open-axiom-devel