7f918cf1 CE |
1 | structure S :> sig type ('a,'b) t |
2 | val f : ('a,'b) t -> ('b,'a) t |
3 | val mk : 'a * 'b -> ('a,'b) t |
4 | end |
5 | = |
6 | struct |
7 | type ('a,'b) t = 'b * 'a |
8 | fun f (x,y) = (y,x) |
9 | fun mk (a,b) = (b,a) |
10 | end |
11 | |
12 | val a = S.mk (5, "hello") |
13 | |
14 | val b = S.f a |