Created
October 9, 2023 20:26
-
-
Save EduardoRFS/64b175ef1464d627e77953861cc6d5fb to your computer and use it in GitHub Desktop.
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
let Closed A = ∀(G : Grade). A [G] | |
// closed as it is unknown how many copies it will be needed(0..1) | |
let Bool : Type = ∀(A : Type). Closed A -> Closed A -> Closed A | |
let true : Closed Bool = | |
// safe to ignore y as it is used 0 times | |
ΛG. [ΛA. fun x y -> let [y] = y 0 in x] | |
let false : Closed Bool = | |
ΛG. [ΛA. fun x y -> let [y] = x 0 in y] | |
// same applies to nats but (0..n) | |
let Nat : Type = ∀(A : Type). Closed A -> Closed (A -> A) -> Closed A; | |
let zero : Closed Nat = | |
ΛG. [ΛA. fun z s -> let [s] = s 0 in z]; | |
let one : Closed Nat = | |
ΛG. [ΛA. fun z s -> let [s] = s 1 in s z]; | |
let two : Closed Nat = | |
ΛG. [ΛA. fun z s -> let [s] = s 2 in s (s z)]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment