
3 Apr
2013
3 Apr
'13
7:24 p.m.
On 4/04/2013, at 5:59 AM, Tillmann Rendel wrote:
As I understand it, in ML, it seemed to be a clever idea to not have type signatures at all.
Wrong. In ML, it seemed to be a clever idea not to *NEED* type signatures, and for local definitions they are very commonly omitted. But you can certainly HAVE type signatures, and for modules ('structures') it is normal to have them in the interfaces ('signatures'). signature SOME_SIG = sig val f : int -> int list -> int val a : int end structure Some_Struct : SOME_SIG = struct fun f i [] = i | f i (x:xs) = f (i+x) xs val a = 42 end What ML does not have is type *quantifiers*. For that matter, you could say that ML has one type class: Eq.