I know that the map function takes each element of a list (a sequence) and applies a function to it. Recursively (and without respect to termination conditions, etc)
map(s, f) = f(s.head) :: map(s.tail, f)
I am looking for a function that does something like
foo(s, f) = f(s) :: map(s.tail, f).
So a 'mapper' where the mapping function gets called on sublists and not individual elements. In lisp terms, I'm looking for a maplist, as opposed to a mapcar. Does something like this exist, or do I have to roll my own (or use recursion)?
Alternatively, I'd take a function that takes as input a sequence and returns a sequence of mid-to-end subsequences, ie
bar(s, f) = s :: bar(s.tail, f)