If maplist/tails, why not inits as well?
Prelude GOA Data.List> inits [1,2,3]
[[],[1],[1,2],[1,2,3]]
I've also found haskell's unfold useful:
(defn expand ;; since Clojure has "reduce" and not "foldl"
[f seed]
(lazy-seq (when-let [[a b] (f seed)] (cons a (expand f b)))))
As with maplist it can be implemented in terms of iterate, though I
think that implementation is unattractive. (And iterate can be
implemented in terms of it),
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to
clo...@googlegroups.com
> Note that posts from new members are moderated - please be patient with your
> first post.
> To unsubscribe from this group, send email to
>
clojure+u...@googlegroups.com
> For more options, visit this group at
>
http://groups.google.com/group/clojure?hl=en
--
Ben Wolfson
"Human kind has used its intelligence to vary the flavour of drinks,
which may be sweet, aromatic, fermented or spirit-based. ... Family
and social life also offer numerous other occasions to consume drinks
for pleasure." [Larousse, "Drink" entry]