X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=using_the_programming_languages.mdwn;h=6952e4995bbddbabd71a24cd0c4ed64462947a22;hp=5dfcb36589246414e4d4230454123d052d3d0d19;hb=98652627403eaa920f51cedc4d0cc68c1103b972;hpb=47235bf81d3cbe019b7ddcd5321c4679445c25e9 diff --git a/using_the_programming_languages.mdwn b/using_the_programming_languages.mdwn index 5dfcb365..6952e499 100644 --- a/using_the_programming_languages.mdwn +++ b/using_the_programming_languages.mdwn @@ -43,16 +43,16 @@ know much OCaml yet to use it. Using it looks like this: let add = << fun m n -> n $succ$ m >>;; (* or *) let add = << fun m n -> fun s z -> m s (n s z) >>;; - + . (* now use: pp FORMULA to print a formula, unreduced pn FORMULA to print the normal form of a formula (when possible) pi FORMULA to print the integer which FORMULA is a Church numeral for (when possible) - + . alpha_eq FORM1 FORM2 are FORM1 and FORM2 syntactically equivalent (up to alpha-conversion)? this does not do reductions on the formulae *) - + . pi << $add$ $one$ $two$ >>;; - : int = 3