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
type Eq<A, B> = <X>(a: A, eq: (x: A & B) => X) => X; | |
const refute = (x: never) => x; | |
const refl = <A, X>(a: A, eq: (x: A) => X) => eq(a); | |
const sickos = <A>(x: A, eq: Eq<A, number>) => eq(x, (x) => x); | |
const two = sickos(2, refl); | |
type Ty<A> = | |
| { tag: "number"; eq: Eq<A, number> } | |
| { tag: "string"; eq: Eq<A, string> }; |