[FMFP] Start lazy evaluation

This commit is contained in:
2026-03-28 10:22:50 +01:00
parent 140a914a39
commit 68d2f1c68b
2 changed files with 11 additions and 1 deletions
@@ -1,3 +1,13 @@
\newpage \newpage
\subsection{Evaluation} \subsection{Evaluation}
Evaluation is then done using tree traversal as we have already seen in the haskell section. Evaluation is then done using tree traversal as we have already seen in the Haskell section.
\subsubsection{Lazy Evaluation}
Expressions are substituted before evaluation recursively until there are no more expressions to substitute, at which point the expression is evaluated.
This can obviously lead to duplicated evaluation, i.e. a computation reoccurring.
In Haskell, this is solved using sharing where the terms are represented in a directed graph.
In pattern matching, the arguments are evaluated only as much as is needed to determine a pattern match.