Created
February 3, 2021 12:05
-
-
Save sjoerdvisscher/b60501d29194fb9d3a3474d46cfbb64f to your computer and use it in GitHub Desktop.
wtf ala typescript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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