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 Assert = (condition: boolean, message: string) => asserts condition; | |
const assert: Assert = (condition, message) => { | |
if (!condition) throw new Error(message); | |
}; | |
type List<A> = Cons<A> | Empty; | |
interface Cons<out A> { | |
type: 'Cons'; |