Lazy data structures are neat, but laziness by default seems like a bad idea due to the confusion it causes. In a more normal programming language, a lazy data structure would contain a function...
Lazy data structures are neat, but laziness by default seems like a bad idea due to the confusion it causes. In a more normal programming language, a lazy data structure would contain a function that you call to get the next value, rather than implicitly applying a function when reading what appears to be an ordinary value.
To be fair, making it the default does avoid a what color is your function problem by making ordinary data structures and lazy data structures have the same interface, which could be important when using laziness extensively.
Lazy data structures are neat, but laziness by default seems like a bad idea due to the confusion it causes. In a more normal programming language, a lazy data structure would contain a function that you call to get the next value, rather than implicitly applying a function when reading what appears to be an ordinary value.
To be fair, making it the default does avoid a what color is your function problem by making ordinary data structures and lazy data structures have the same interface, which could be important when using laziness extensively.