Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] 'should have type unit' warning in 'let _ =' ?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-07-15 (00:29)
From: henridf@l...
Subject: [Caml-list] 'should have type unit' warning in 'let _ =' ?

i had a minor bug where the last expression in a 
let _ = ...
block of my module was not fully applied and hence was returning a 
functional value rather than apply the function (because I had added a 
parameter to the function).

pretty harmless, but it led me to wonder why I wasn't writing 'let () = 
..' for all my module initialization blocks, which would have given me 
'warning should have type unit' in the above situation.

So is there a reason why the commonly used idiom seems to be 'let _ =' 
rather than 'let () = '? 



To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: