Skip to content

Instantly share code, notes, and snippets.

View znck's full-sized avatar
🎯
Focusing

Rahul Kadyan znck

🎯
Focusing
View GitHub Profile
@znck
znck / Option.mts
Created November 23, 2025 09:15
A simple Option type
interface Protocol<T> {
orElse(defaultValue: T): T
}
interface Some<T> extends Protocol<T> {
readonly ok: true
readonly value: T
}
interface None<T> extends Protocol<T> {