summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdoardo La Greca2025-08-24 18:10:14 +0200
committerEdoardo La Greca2025-08-24 18:10:14 +0200
commitb1c7f72af59c0de4ed45f3cd182a899a49e3e0b4 (patch)
treec64f1f2b9f832a1881b156c565518ae6ee9796f2
parent62396e4ed3cd37ccf8ec30e53913a494ab8dbdd0 (diff)
add the rest of notes for lecture 6
-rw-r--r--lec06/notes.md10
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.
+