fst|T| s: Sequence T = s[0] assert fst([1, 2, 3]) + 1 == 2 assert fst(["a", "b", "c"]) + "b" == "ab" assert fst((1, 2, 3)) + 1 == 2 Norm = Trait {.norm = (self: Self) -> Nat} Point2D = Class {x = Int; y = Int} Point2D|<: Norm|. norm self = self::x**2 + self::y**2 Point3D = Class {x = Int; y = Int; z = Int} Point3D|<: Norm|. norm self = self::x**2 + self::y**2 + self::z**2 norm|T <: Norm| x: T = x.norm() implicit_norm x = x.norm() p = Point2D.new {x = 3; y = 4} print! norm(p) assert norm(p) == 25 assert norm(Point3D.new {x = 3; y = 4; z = 5}) == 50 # assert norm(1) # this should be an error assert implicit_norm(p) == 25