From 5233f89fe58624c9aa88e0480eb96736675f2ae0 Mon Sep 17 00:00:00 2001 From: Jashank Jeremy Date: Thu, 30 Apr 2020 16:52:10 +1000 Subject: [PATCH] docs: intro/first-program: Fix the branches; promote a par. (SQUASH ^{23}) --- docs/introduction/first-program.rst | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/docs/introduction/first-program.rst b/docs/introduction/first-program.rst index 270cdf8ed..eb61b46ab 100644 --- a/docs/introduction/first-program.rst +++ b/docs/introduction/first-program.rst @@ -318,19 +318,15 @@ and give the expression to resolve to:: add (x, y) = let sum = x + y in sum < x || sum < y - | True -> Success sum - | False -> Error () + | True -> Error () + | False -> Success sum For our ``R`` type, we can do something similar. Here's a contrived example using it:: - fn _ = add (7, 6) - | Success x -> x - | Error y -> 42 - - -Gum, Glue, and Antiquoted C -====================================================== + fn () = add (7, 6) + | Success x -> x + | Error y -> 42 That's pretty much all that we can do in |cogent|. We can save our favourite definition of ``add``, @@ -342,6 +338,11 @@ you can read :doc:`../reference/surface-syntax`. .. todo:: Part of the language reference will become a section in this doc later. + + +Gum, Glue, and Antiquoted C +====================================================== + Next we will have to write the C code, which does the things that |cogent| cannot do. |cogent| code will be compiled to C code,