Re: Haskell-style list functions

2010-04-14 Thread hayamiz
user (use '[clojure.contrib.seq-utils :only (reductions)]) nil user (reductions + [1 2 3 4 5]) (1 3 6 10 15) Yeah, I think it 'smart'. Thanks for a nice solution. Yuto HAYAMIZU On 4月11ζ—₯, 午後11:48, Steve Purcell st...@sanityinc.com wrote: On 10 Apr 2010, at 08:46, Yuto Hayamizu wrote:

Re: Haskell-style list functions

2010-04-12 Thread saturap
Hi, If you know any smart solutions with only currently available functions, please tell me. I mean, 'smart' solutions have no explicit 'lazy-seq', recursion, and return a lazy sequence as a result. How about using clojure.contrib.seq-utils/reductions? user (accum-seq [1, 1, 1, 1, 1]) (1

Haskell-style list functions

2010-04-11 Thread Yuto Hayamizu
Hi, all I want some list functions in Haskell like mapAccumL in clojure.contrib, because some sequence operations are difficult with only functions in clojure.core and contrib. Think about writing a function 'accum-seq', which takes a sequence of numbers, and returns a sequence of numbers. Each

Re: Haskell-style list functions

2010-04-11 Thread Steve Purcell
On 10 Apr 2010, at 08:46, Yuto Hayamizu wrote: Hi, all I want some list functions in Haskell like mapAccumL in clojure.contrib, because some sequence operations are difficult with only functions in clojure.core and contrib. Think about writing a function 'accum-seq', which takes a