From 5cf344de74568ef66d9fb93f95d8c2bf7cbb6d70 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Mon, 26 Aug 2019 00:13:34 -0700 Subject: [PATCH] Add the examples to the repo. --- 03/bad1.txt | 2 ++ 03/bad2.txt | 1 + 03/works1.txt | 2 ++ 03/works2.txt | 3 +++ 03/works3.txt | 7 +++++++ 5 files changed, 15 insertions(+) create mode 100644 03/bad1.txt create mode 100644 03/bad2.txt create mode 100644 03/works1.txt create mode 100644 03/works2.txt create mode 100644 03/works3.txt diff --git a/03/bad1.txt b/03/bad1.txt new file mode 100644 index 0000000..86d4bc4 --- /dev/null +++ b/03/bad1.txt @@ -0,0 +1,2 @@ +data Bool = { True, False } +defn main = { 3 + True } diff --git a/03/bad2.txt b/03/bad2.txt new file mode 100644 index 0000000..def8785 --- /dev/null +++ b/03/bad2.txt @@ -0,0 +1 @@ +defn main = { 1 2 3 4 5 } diff --git a/03/works1.txt b/03/works1.txt new file mode 100644 index 0000000..bedb5d8 --- /dev/null +++ b/03/works1.txt @@ -0,0 +1,2 @@ +defn main = { plus 320 6 } +defn plus x y = { x + y } diff --git a/03/works2.txt b/03/works2.txt new file mode 100644 index 0000000..8332fde --- /dev/null +++ b/03/works2.txt @@ -0,0 +1,3 @@ +defn add x y = { x + y } +defn double x = { add x x } +defn main = { double 163 } diff --git a/03/works3.txt b/03/works3.txt new file mode 100644 index 0000000..cfffd20 --- /dev/null +++ b/03/works3.txt @@ -0,0 +1,7 @@ +data List = { Nil, Cons Int List } +defn length l = { + case l of { + Nil -> { 0 } + Cons x xs -> { 1 + length xs } + } +}