On 14.05.2009, at 09:22, Laurent PETIT wrote:

> Isn't tree-reduce similar to clojure.contrib.generic.functor/fmap  
> (though fmap preserves the type of the structure, while your  
> function returns seqs of seqs ...) ?

fmap is not recursive. When given a list, it would only act at the  
top level. Moreover, fmap maps a function of one argument over a  
structure, it doesn't combine structures.

It would be straightforward to apply fmap recursively by defining a  
suitable data type (such as ::tree) and providing a recursive  
implementation of fmap for it.

> (Ah, and I find that the name reduce here is a bit misleading,  
> since the operation really does a mapping from a tree to another ?)

Indeed.

Konrad.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to