#$ Basic typeclass with three instances, two with environment. # 11111 # 489 # 0 # 11193 class MyAsInt to-int (self _) -> I32 m = 69 inst MyAsInt I32 to-int (self I32) -> I32 return self + m inst MyAsInt Unit to-int (self Unit) -> I32 return 11111 true-const = 1 false-const = 0 inst MyAsInt Bool to-int (self Bool) -> I32 if self return true-const else return false-const println(to-int(Unit)) println(to-int(420)) println(to-int(False)) println(to-int(Unit) + to-int(12) + to-int(True))