X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=coroutines_and_aborts.mdwn;h=3822f418f225b7fe36848ff766b2d0987cc513ac;hp=cd71be455d628d3aa7220500a27644e40ecd1589;hb=35949604299e54f944273e8aba8cd2dd33179415;hpb=eb8ac48a126c26a8195d19dfc0e1f60009198746 diff --git a/coroutines_and_aborts.mdwn b/coroutines_and_aborts.mdwn index cd71be45..3822f418 100644 --- a/coroutines_and_aborts.mdwn +++ b/coroutines_and_aborts.mdwn @@ -47,7 +47,7 @@ and then having to remember which element in the triple was which: records let you attach descriptive labels to the components of the tuple: # type blah_record = { height : int; weight : int; char_tester : char -> bool };; - # let b2 = { height = 1; weight = 2; char_tester = fun c -> c = 'M' };; + # let b2 = { height = 1; weight = 2; char_tester = (fun c -> c = 'M') };; val b2 : blah_record = {height = 1; weight = 2; char_tester = } # let b3 = { height = 1; char_tester = (fun c -> c = 'K'); weight = 3 };; (* also works *) val b3 : blah_record = {height = 1; weight = 3; char_tester = } @@ -70,7 +70,7 @@ Here is how you can extract the components of a labeled record: match test with | {height = h; weight = w; char_tester = test} -> - (* go on to use h, w, and test ... *) + (* same as preceding *) Anyway, using record types, we might define the tree zipper interface like so: