From 89f14f08b65f2eb905065135670fbb1712cb9b16 Mon Sep 17 00:00:00 2001 From: Chris Barker Date: Fri, 26 Nov 2010 23:59:49 -0500 Subject: [PATCH] edits --- zipper-lists-continuations.mdwn | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/zipper-lists-continuations.mdwn b/zipper-lists-continuations.mdwn index f0a252ee..a2603dba 100644 --- a/zipper-lists-continuations.mdwn +++ b/zipper-lists-continuations.mdwn @@ -245,7 +245,7 @@ Ta da! To bad this digression, though it ties together various elements of the course, has *no relevance whatsoever* to the topic of -continuations. +continuations... Montague's PTQ treatment of DPs as generalized quantifiers ---------------------------------------------------------- @@ -271,10 +271,12 @@ the bind follow naturally. We've done this enough times that we won't belabor the construction of the bind function, the derivation is similar to the List monad just given: - type 'a continuation = ('a -> 'b) -> 'b - c_unit (x:'a) = fun (p:'a -> 'b) -> p x - c_bind (u:('a -> 'b) -> 'b) (f: 'a -> ('c -> 'd) -> 'd): ('c -> 'd) -> 'd = - fun (k:'a -> 'b) -> u (fun (x:'a) -> f x k) +
+type 'a continuation = ('a -> 'b) -> 'b
+c_unit (x:'a) = fun (p:'a -> 'b) -> p x
+c_bind (u:('a -> 'b) -> 'b) (f: 'a -> ('c -> 'd) -> 'd): ('c -> 'd) -> 'd =
+fun (k:'a -> 'b) -> u (fun (x:'a) -> f x k)
+
How similar is it to the List monad? Let's examine the type constructor and the terms from the list monad derived above: -- 2.11.0