A lot of stuff I'm not gonna enumerate

rule fundamentals
This commit is contained in:
2022-07-06 20:13:13 +02:00
parent 49aa73956c
commit ec7ad81fac
21 changed files with 483 additions and 420 deletions

View File

@@ -1,4 +1,4 @@
import std::io::(println, out) -- imports
-- import std::io::(println, out) -- imports
-- single word rule (alias)
greet =1=> (\name. printf out "Hello {}!\n" [name])
@@ -7,12 +7,15 @@ greet =1=> (\name. printf out "Hello {}!\n" [name])
export ;> $a =200=> (greet $a)
-- single-word exported rule
export main = (
export main == (
print "What is your name?" >>
readln >>= \name.
greet name
)
export < $a ...$rest /> == (createElement (tok_to_str $a) [(props_carriage ...$rest)])
export (props_carriage $key = $value) == (tok_to_str $key) => $value
-- The broadest trait definition in existence
Foo = (Bar Baz)
Foo == (Bar Baz)
-- default anyFoo = @T. @impl:(T (Bar Baz)). impl:(T Foo)