Laziness: Clojure vs Haskell

Laziness: Clojure vs Haskell.
Last week I punted on randomness, and just made my genetic_search
function take a [Double]. While that was convenient, it is unfortunately not
as general as I thought at the time. I’m still in the process of learning
Haskell, and I got confused between laziness in Clojure and laziness in
Haskell.So how do they differ? The one-word answer is “purity”, but let me try to
expand on that a little bit. Clojure has the “seq” abstraction, which is
defined by the two functions first and next, where first gives you an
element and next gives you another seq if there are more elements to be
had, or nil if there are none. When I think of a lazy list, I think in
terms of Clojure seqs, even though Clojure lists are actually not lazy.

Read in full here:

This thread was posted by one of our members via one of our news source trackers.

Corresponding tweet for this thread:

Share link for this tweet.