4 ms·
> I can't imagine using a haskell-like language without laziness. It's what makes it possible to actually write small reusable functions. I don't understand yo
by snowcrshd 10y ago
> I can't imagine using a haskell-like language without laziness. It's what makes it possible to actually write small reusable functions.
I don't understand your point. Why is laziness a requirement to write small reusable functions? Are you thinking about currying?
OCaml is (relatively) similar to Haskell and is not lazy. Function currying does not require laziness.
- the_af 10y agoIt's unrelated to currying. It's also hard to explain, but if you're used to Haskell, working with an eager-by-default language such as OCaml or ML is mildly annoying. You can adapt, of course, but it does seem as if gluing stuff together is trickier with eager evaluation. There are downsides to lazy-by-default, of course.
- charlieflowers 10y agoThere's a classic paper that answers this well: "Why Functional Programming Matters." (Not a quick read, but not too huge, and it is a classic that is well worth reading sometime).