Dear Bill, thank you for the explanation, I was not aware that this code is for OpenAxiom (I have only FriCAS installed currently, and as I am moving to a new computer I will not add anything on my old one)
> )abbrev domain MYSET MySet > MySet(T:SetCategory): SetAggregate(T) with > finiteAggregate > join: MySet MySet T -> MySet T > == add > Rep == List T Why are the next two lines commented out? > --rep(x:%):Rep == x pretend Rep > --per(x:Rep):% == x pretend % > > Rep2 := List List T > rep2(x:MySet MySet T):Rep2 == x pretend Rep2 > per2(x:Rep2):MySet MySet T == x pretend MySet MySet T > > coerce(x:%):OutputForm == brace [i::OutputForm for i in rep x] > x = y == rep(x) = rep(y) > construct(x) == per removeDuplicates(x)$Rep > parts(x:%):List T == rep x > join x == construct concat rep2 x > Perhaps as you know the point of this exercise was to be able to write > 'MySet MySet T' (or equivalent) in the definition of MySet itself. Yes, I got that, and that was the reason why I tried to compile it. To define a monad, we need something which can operator on a (mathematical) category (say Set). Now sets itself may be structured, eg a set of elements, or a set of sets (take lists if you like). So I wondered if one could have something like a `lazy type'. We want to have on the _category_ Set (List if you like) an endofunctor T : Set --> Set, which has as a codomain possibly a structured datatype (think of the power set functor) hence a set of sets (list of lists). As the functor can be applied indefinitely often, we get data types of the form Set(Set(...(Set)...)). Clearyl that is not a definable instance in a CAS. So I would like to see something as a type: lazyType = Type + T( lazyType ) where the rhs is not evaluated (lazy). In terms of sets of elements of some type foo, we have foo, Set(foo), Set(Set(foo)), etc The monad multiplication operation will not look into the deeper nesting if always allied on the outer level (which is feasible due to associativity). So if the type checking would just see that there is at least on Set(bar) there, then the type of bar would not matter. I had the feeling that your code wanted to do this just for three levels: I, List(I), List(List(I)) Cheers BF. -- % PD Dr Bertfried Fauser % Research Fellow, School of Computer Science, Univ. of Birmingham % Honorary Associate, University of Tasmania % Privat Docent: University of Konstanz, Physics Dept <http://www.uni-konstanz.de> % contact |-> URL : http://www.cs.bham.ac.uk/~fauserb/ % Phone : +44-121-41-42795 -- You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/fricas-devel?hl=en.
