type t = | Point of {width: int; mutable x: float; mutable y: float} | Other let v = Point {width = 10; x = 0.; y = 0.} let scale l = function | Point p -> Point {p with x = l *. p.x; y = l *. p.y} | Other -> Other let print = function | Point {x; y; _} -> Printf.printf "%f/%f" x y | Other -> () let reset = function | Point p -> p.x <- 0.; p.y <- 0. | Other -> ()