class Pair<A, B>(val a: A, val b: B)
class List<T>(Nil(unit), Cons(Pair<T, List<T>>)) {
function <T> of(t: T): List<T> =
List.Cons(Pair.init(t, List.Nil<T>({})))
method cons(t: T): List<T> =
List.Cons(Pair.init(t, this))
}
class Developer(
val github: string,
val company: string,
val projects: List<string>,
) {
function sam(): Developer = {
val github = "SamChou19815";
val company = "Facebook";
val projects = List.of("samlang").cons("...");
Developer.init(github, company, projects)
}
}
class Main {
function main(): Developer = Developer.sam()
}