From 56ec8c944aeb4611b83fceecfe91cfb1dbf54840 Mon Sep 17 00:00:00 2001 From: Jim Pryor Date: Wed, 1 Dec 2010 00:34:22 -0500 Subject: [PATCH] lists-to-contin tweaks Signed-off-by: Jim Pryor --- from_lists_to_continuations.mdwn | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/from_lists_to_continuations.mdwn b/from_lists_to_continuations.mdwn index 8c84dfbd..170ae5d4 100644 --- a/from_lists_to_continuations.mdwn +++ b/from_lists_to_continuations.mdwn @@ -74,7 +74,7 @@ entire list has been unzipped (and so the zipped half of the zipper is empty). 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) @@ -141,7 +141,7 @@ be a function of type `char list -> char list`. We'll call each step (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 @@ -153,7 +153,7 @@ The structure and the behavior will follow that of `tz` above, with 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) -- 2.11.0