-considered monads. But we can't do that if we leave the list type
-as a primitive Ocaml type. However, we know several ways of implementing
-lists using just functions. In what follows, we're going to use type
-3 lists (the right fold implementation), though it's important to
-wonder how things would change if we used some other strategy for
-implementating lists. These were the lists that made lists look like
-Church numerals with extra bits embdded in them:
-
- empty list: fun f z -> z
- list with one element: fun f z -> f 1 z
- list with two elements: fun f z -> f 2 (f 1 z)
- list with three elements: fun f z -> f 3 (f 2 (f 1 z))
+considered monads. But we can't do that if we leave the list type as
+a primitive OCaml type. However, we know several ways of implementing
+lists using just functions. In what follows, we're going to use version
+3 lists, the right fold implementation (though it's important and
+intriguing to wonder how things would change if we used some other
+strategy for implementing lists). These were the lists that made
+lists look like Church numerals with extra bits embedded in them:
+
+ empty list: fun f z -> z
+ list with one element: fun f z -> f 1 z
+ list with two elements: fun f z -> f 2 (f 1 z)
+ list with three elements: fun f z -> f 3 (f 2 (f 1 z))