summaryrefslogtreecommitdiff
path: root/examples/test.gn
diff options
context:
space:
mode:
Diffstat (limited to 'examples/test.gn')
-rw-r--r--examples/test.gn21
1 files changed, 13 insertions, 8 deletions
diff --git a/examples/test.gn b/examples/test.gn
index 99e7ef6..5147097 100644
--- a/examples/test.gn
+++ b/examples/test.gn
@@ -1,11 +1,16 @@
-!use defaults -> io -> println.
-!use defaults -> effects.
-!use defaults -> math -> +.
-!use builtin -> block.
-!use builtin -> return.
+?? Comments begin with a ?
+!insert "usage.gn".
+!insert "math.gn".
+
!entrypoint <- main.
+
+?? Type definitions begin with the name wrapped in ()
+(add <- Int <- Int) -> Int.
+add a b -> a + b.
+
(main) -> Int ? (effects -> IO).
+?? Function definitions begin with the name and have an ->
main -> match (x <- println "Hello World") (
- (x >= 0) -> 0,
- (x < 0)-> 1,
-)
+ (x >= 0) -> x,
+ (x < 0)-> add x 10,
+).