2014-10-03 41 views

回答

0

- datatype 'a DT = thingy of {x: int, y: int} | Empty; datatype 'a DT = Empty | thingy of {x:int, y:int} - thingy {x = 5, y = 4}; val it = thingy {x=5,y=4} : 'a DT - fun f x y = thingy {x = x, y = y}; val f = fn : int -> int -> 'a DT

+0

为什么多态型“a”如果你不使用它?你可以放弃它。 – 2014-10-06 13:45:44

+0

这是他的例子。这可能不是无用的。例如,它可以用作幻影类型。 – seanmcl 2014-10-06 13:55:48

相关问题