Go backward to Bounded Quantification 'n Subtyping Go up to Top Go forward to Bounded Existential Quantification and Partial Abstraction |
type Point = {x: Int, y: Int}
value moveX0 =
fun(p: Point, dx: Int) p.x := p.x + dx; p
value moveX =
all[P <= Point] fun(p:P, dx: Int) p.x := p.x + dx; p
type Tile = {x: Int, y: Int, hor: Int, ver: Int}
moveX[Tile]({x = 0, y = 0, hor - 1, ver = 1}, 1).hor