Add the examples to the repo.
このコミットが含まれているのは:
コミット
c2df5fdc78
2
code/compiler/03/bad1.txt
ノーマルファイル
2
code/compiler/03/bad1.txt
ノーマルファイル
@ -0,0 +1,2 @@
|
|||||||
|
data Bool = { True, False }
|
||||||
|
defn main = { 3 + True }
|
1
code/compiler/03/bad2.txt
ノーマルファイル
1
code/compiler/03/bad2.txt
ノーマルファイル
@ -0,0 +1 @@
|
|||||||
|
defn main = { 1 2 3 4 5 }
|
2
code/compiler/03/works1.txt
ノーマルファイル
2
code/compiler/03/works1.txt
ノーマルファイル
@ -0,0 +1,2 @@
|
|||||||
|
defn main = { plus 320 6 }
|
||||||
|
defn plus x y = { x + y }
|
3
code/compiler/03/works2.txt
ノーマルファイル
3
code/compiler/03/works2.txt
ノーマルファイル
@ -0,0 +1,3 @@
|
|||||||
|
defn add x y = { x + y }
|
||||||
|
defn double x = { add x x }
|
||||||
|
defn main = { double 163 }
|
7
code/compiler/03/works3.txt
ノーマルファイル
7
code/compiler/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 }
|
||||||
|
}
|
||||||
|
}
|
読み込み中…
新しいイシューから参照
ユーザーをブロックする