2 ms·
OCaml gives you a warning ("this function should return unit") if you don't use the result of each function call, unless that function returns unit (void). You
by pcwalton 13y ago
OCaml gives you a warning ("this function should return unit") if you don't use the result of each function call, unless that function returns unit (void). You can suppress it with the "ignore" function or with "let _ = some_function() in …"
I would like to implement this feature in Rust as well, as it would have saved me hours of debugging a couple of times.
- masklinn 13y ago> OCaml gives you a warning ("this function should return unit") if you don't use the result of each function call, unless that function returns unit (void). You can suppress it with the "ignore" function or with "let _ = some_function() in …" GHC can also do so optionally (with -fwarn-unused-do-bind) (and I'm unsure there even is a way to ignore return values outside of do blocks)