Solution: Inferred function types

  • Centimeter::plus function type is (Centimeter, Centimeter) -> Centimeter
  • Centimeter::times function type is (Centimeter, Double) -> Centimeter
  • Centimeter::value function type is (Centimeter) -> Double
  • Centimeter::toString function type is (Centimeter) -> String
  • Centimeter(1.0)::plus function type is (Centimeter) -> Centimeter
  • Centimeter(2.0)::times function type is (Double) -> Centimeter
  • Centimeter(3.0)::value function type is () -> Double
  • Centimeter(4.0)::toString function type is () -> String
  • Int::cm function type is (Int) -> Centimeter
  • 123::cm function type is () -> Centimeter
  • ::distance function type is (Centimeter, Centimeter) -> Centimeter