On Friday 04 Nov 2011 18:12:50 Bertfried Fauser wrote: > ListMonad(Set): > This is actually a monad related to power sets, but lists also have > order, while sets have not. > > Let X be a set, eta(X)= [X] is the singleton list containing this > set, eta : Set --> T Set, where > T Set is lists of sets. > Now T T Set is lists of lists of sets, eg, [[X,Y],[Y],[X],[Z,W]] :: T > T Set ; then the `multiplication' > mu : T T --> T is `flatening the lists' e.g. forgetting the inner > list's brackets -> [ X,Y,Y,X,Z,W] > Associativity of m guarantees that if you have lists of lists of lists > of sets (type T T T Set) > then either of the two ways to forget the inner brackets (multiplying > the monad functor T) > gives the same result. The left/right unit of this multiplication is > the empty list > mu : [[],[X]] --> [X] > The difference is that this construction is much more like a > template class in C++, as it can be instantiated on any (suitable) > category C. And this is what the list constructor actually does...
So how would this be implemented? Lists might be implemented, in a co-data structure, like this: .... domain List(S) .... Rep := Union(Empty,Record(%,S)) and we could define PowerList, in a co-data structure, as: .... domain PowerList(S) .... Rep := Union(S,List %) eta:(%) -> List % mu:(List List %) -> List % But here % is an instance of PowerList(S) and List % is also an instance of PowerList(S) so does eta:(%) -> List % actually enforce an increment in the nesting level or would we have to write eta:(%) -> % and enforce a step in the nesting in the implementation? If this is valid then the next step would be to generalise from List to T .... domain Monad(S,T) .... Rep := Union(S,T %) eta:(%) -> T % mu:(T T %) -> T % Martin -- 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.
