This repository has been archived on 2024-01-18. You can view files and clone it, but cannot push or open issues or pull requests.
compilation/flap/tests/03-Typing/26-function-over-polymorphic-record.bad.typing.hopix.human-readable
Adrien Guatto 6355f88c0f Jalon 3
2023-11-15 19:08:33 +01:00

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.x<`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)