13 lines
No EOL
326 B
Text
13 lines
No EOL
326 B
Text
type p<`a, `b> = { x : `a, y : `b }
|
|
|
|
fun : [`a, `b] p<`a, `b> -> `a
|
|
get_x (p : p<`a, `b>) = p.x<`a, `b>
|
|
|
|
fun : [`a, `b] p<`a, `b> -> `b
|
|
get_y (p : p<`a, `b>) = p.y<`a, `b>
|
|
|
|
let p : p<int, string> = { x = 37, y = "Rory Williams" }<int, string>
|
|
|
|
let x : int = get_x<int, string>(p)
|
|
|
|
let y : string = get_y<int, string>(p) |