class Point x y = Unit in method _getX (Point x y) = x; _getY (Point x y) = y; _setX (Point x y) = \ x1 -> Point x1 y; _setY (Point x y) = \ y1 -> Point x y1; _move self@(Point x y) = let x = _getX self in let y = _getY self in let p1 = _setX self (x+1) in _setY p1 (y+1); _print (Point x y) = "Point (" ++ (toString x) ++ ", " ++ (toString y) ++ ")" in class ColorPoint x y c = Point x y in method _getC (ColorPoint x y c) = c; _setX (ColorPoint x y c) = \ x1 -> ColorPoint x1 y c; _setY (ColorPoint x y c) = \ y1 -> ColorPoint x y1 c; _print (ColorPoint x y c) = "ColorPoint (" ++ (toString x) ++ ", " ++ (toString y) ++ ", " ++ (toString c) ++ ")" in (_print (_move (Point 0 1))) ++ ", " ++ (_print (_move (ColorPoint 2 3 "red")))