r/functionalprogramming • u/metazip • Jun 28 '24
Question Does Lazy Evaluation have a Future?
In Haskell it is used for deforestation to keep the stack low. But after some experience with it, it is simply a problematic concept.
UPDATE: What do you think about a concept with buds?
Buds that change from unbound to bound via a side effect,
which can be checked beforehand with isbound. Wouldn't a concept with buds be much more flexible.
2
Upvotes
View all comments
Show parent comment
2
u/quiteamess Jun 29 '24
Yeah, I see your point. It would be nice if the type would ensure that the program terminates. But this is not the case at all in Haskell. It is possible to define infinite recursion and there is
undefined. So there is not totality checking anyways in Haskell, so I don’t think this is a particular concern about laziness.If you want to enforce this kind of corrections in the type system you will need dependent types. Idris is not lazy by default, but I think these concerns are orthogonal.