Collaborative real-time editor with live evaluation
Connect to collaborate with other peers in real-time. Make sure the signaling server is running:
node examples/web/signaling-server.js
let x = 42
fn double(x : Int) { x + x }
let result = double 5
result
fn inc(x : Int) { x + 1 }
fn twice(f : Int -> Int, x : Int) {
f (f x)
}
let result = twice inc 0
result
fn choose(x : Int) { if x then {
x + 1
} else {
42
} }
let result = choose 5
result
Module ::= ((FnDef | LetDef) '\n')* Expression?
FnDef ::= 'fn' Identifier ParamList Block
LetDef ::= 'let' Identifier '=' Expression
ParamList ::= '(' Identifier (':' Type)? (',' Identifier (':' Type)?)* ')'
Expression ::= Lambda | IfThenElse | BinaryOp
Lambda ::= ParamList '=>' (Expression | Block)
BinaryOp ::= Application (('+' | '-') Application)*
Application ::= Atom+
Atom ::= Integer | Variable | Block | '(' Expression ')'
Block ::= '{' ((FnDef | LetDef) (';' | '\n'))* Expression? '}'
IfThenElse ::= 'if' Expression 'then' Expression 'else' Expression
Waiting for input...
Waiting for input...