Hacker News new | ask | show | jobs
by snowcrshd 3398 days 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.

2 comments

It'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.

There'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).