diff options
author | Chloe Brown <chloe.brown.00@outlook.com> | 2025-06-24 18:39:42 +0100 |
---|---|---|
committer | Chloe Brown <chloe.brown.00@outlook.com> | 2025-06-24 18:39:42 +0100 |
commit | d8c0da7f27a1b89e005feddb83763cb453a9ac2a (patch) | |
tree | 545ce2f244bcca64fa75bd33e80c47f0620ae6ba /sec | |
parent | e9c892020fbc92584321503ed5202d16de0b5923 (diff) |
Note eliminator encoding works for lists.
Diffstat (limited to 'sec')
-rw-r--r-- | sec/systemt.ltx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sec/systemt.ltx b/sec/systemt.ltx index 8b24706..75461f9 100644 --- a/sec/systemt.ltx +++ b/sec/systemt.ltx @@ -295,6 +295,11 @@ our sum and depth example, we have no way of knowing whether the value representing a tree came from a leaf or branch as we deliberately forget this information. +A notable exception to this general trend is lists. We can encode a +list as a pair of its length and its index function, returning the +element at a given position. From these two eliminators, we can +reconstruct both folds and pattern matching. + \subsubsection*{Heap Encodings} This encoding strategy is a crude approximation of a heap of memory. Given an |