From a2386e85bac4e7da8fa1f29a676941b592d35a5d Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Tue, 16 Apr 2013 10:55:48 -0400 Subject: Basis.tryRpc --- tests/tryRpc.ur | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 tests/tryRpc.ur (limited to 'tests/tryRpc.ur') diff --git a/tests/tryRpc.ur b/tests/tryRpc.ur new file mode 100644 index 00000000..7a8d3a8b --- /dev/null +++ b/tests/tryRpc.ur @@ -0,0 +1,46 @@ +fun isBeppo (s : string) : transaction string = + case s of + "Beppo" => return "Yup, that's him!" + | "Mephisto" => error Great googely moogely! + | _ => return "Who's that?" + +fun listOf (n : int) = + if n < 0 then + error Negative! + else if n = 0 then + return [] + else + ls <- listOf (n - 1); + return (n :: ls) + +fun length ls = + case ls of + [] => 0 + | _ :: ls' => 1 + length ls' + +fun main () : transaction page = + s <- source ""; + ns <- source ""; + return + +