The Big Table

Expression syntax

Type Construction Destruction
type Unit = !
let value = !
let ! = value
type Either = either {
  .left String,
  .right Int,
}
let value: Either = .left "Hello!"
let result = value.case {
  .left str => String.Length(str),
  .right num => Int.Mul(num, 5),
}
type Pair = (String) Int
let value = ("Hello!") 42
let (str) num = value
type Function = [Int] String
let value = [num: Int] Int.ToString(num)
let str = value(42)
type Choice = choice {
  .left => String,
  .right => Int,
}
let value: Choice = case {
  .left => "Hello!",
  .right => 42,
}
let num = value.right
type Continuation = ?
No expression syntax No expression syntax

Process syntax

Type Construction Destruction
type Unit = !
let value = chan c {
  c!
}
value?
type Either = either {
  .left String,
  .right Int,
}
let value: Either = chan c {
  c.left
  c <> "Hello!"
}
value.case {
  .left => {
    let result = String.Length(value)
  }
  .right => {
    let result = Int.Mul(value, 5)
  }
}
// `result` is in scope here
type Pair = (String) Int
let value = chan c {
  c("Hello!")
  c <> 42
}
value[str]
let num = value
type Function = [Int] String
let value = chan c {
  c[num: Int]
  c <> Int.ToString(num)
}
value(42)
let result = value
type Choice = choice {
  .left => String,
  .right => Int,
}
let value = chan c {
  c.case {
    .left  => { c <> "Hello!" }
    .right => { c <> 42 }
  }
}
value.right
let num = value
type Continuation = ?
let outer: ! = chan break {
  let value: ? = chan c {
    c?     // construction
    break!
  }
  value!   // destruction
}
Shown on the left