Skip to content

Instantly share code, notes, and snippets.

@sjoerdvisscher
Created February 3, 2021 12:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sjoerdvisscher/b60501d29194fb9d3a3474d46cfbb64f to your computer and use it in GitHub Desktop.
Save sjoerdvisscher/b60501d29194fb9d3a3474d46cfbb64f to your computer and use it in GitHub Desktop.
wtf ala typescript
// term variables
let z : int = 123
let y : int = z
// anonymous products & inline types
let k : [ int, int, int ] = [ 1, 2, 3 ]
// sum types and type variables
type Q = A(int) | B(bool)
let qA : Q = A(123)
let qB : Q = B(f)
// named product type
type X = {
A : int,
B : bool,
}
let x : X = { A : 123, B : f }
type Q = {
pair: [ int, bool ]
other: string
}
let q0 : Q = {
pair: [123, f],
other: "hello",
}
let q1 : Q = {
pair: [234, t],
other = "goodbye",
}
// reference terms
let q0Ref : &Q = #q0
let remoteQRef : &Q = #a9d311488dbe55eb3099.0.1.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment