regression/constraint.sml
raw| 1 | signature S = sig type ('a, 'b) t |
| 2 | val A : 'a * int -> ('a, int) t |
| 3 | val pr : ('a -> string) -> ('b -> string) -> ('a, 'b) t -> string |
| 4 | end |
| 5 | |
| 6 | structure S = |
| 7 | struct |
| 8 | datatype ('a, 'b) t = A of 'a * 'b |
| 9 | fun pr pr_a pr_b (A(a,b)) = "A(" ^ pr_a a ^ "," ^ pr_b b ^ ")" |
| 10 | end |
| 11 | |
| 12 | structure S' = S : S |
| 13 | |
| 14 | val s = S'.pr (fn s => s) (Int.toString) (S'.A("hello",5)) |
| 15 | |
| 16 | val _ = print (s ^ "\n") |