diff options
-rw-r--r-- | lec06/notes.md | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lec06/notes.md b/lec06/notes.md index 85f5e7d..af5dcff 100644 --- a/lec06/notes.md +++ b/lec06/notes.md @@ -46,3 +46,13 @@ Although lazy evaluation works like this in theory, in practice GHC uses a more ## Consequences +(Summed up as a list below. The generic "it" pronoun, when used as a subject with otherwise ambiguous meaning, refers to "lazy evaluation".) + +- It forces the language to be pure. +- Determining space usage can get a little tricky, mostly due to thunks and recursion. +- It behaves interestingly, depending on how functions are defined, mainly due to short-circuiting. For example, some equivalent functions may take longer to compute if they make heavy use of pattern matching, while some others might even crash. +- It allows to define custom control structures. +- It allows to work with infinite data structures, or those large enough to not practically fit into memory (whatever the available size is). +- Pipelined incremental transformations of large data structures are memory-efficient. +- It eases the management of results for dynamic programming problems, especially the evaulation of the order of entries in a dynamic programming table. + |