type 'a list_zipper = ('a list) * ('a list);;
- let rec tz (z:char list_zipper) =
+ let rec tz (z : char list_zipper) =
match z with
| (unzipped, []) -> List.rev(unzipped) (* Done! *)
| (unzipped, 'S'::zipped) -> tz ((List.append unzipped unzipped), zipped)
(or group of steps) a **continuation** of the recipe. So in this
context, a continuation is a function of type `char list -> char
list`. For instance, the continuation corresponding to the portion of
-the recipe below the horizontal line is the function `fun (tail:char
+the recipe below the horizontal line is the function `fun (tail : char
list) -> 'a'::('b'::tail)`.
This means that we can now represent the unzipped part of our
some small but interesting differences. We've included the orginal
`tz` to facilitate detailed comparison:
- let rec tz (z:char list_zipper) =
+ let rec tz (z : char list_zipper) =
match z with
| (unzipped, []) -> List.rev(unzipped) (* Done! *)
| (unzipped, 'S'::zipped) -> tz ((List.append unzipped unzipped), zipped)