Why does F # warn me about ignoring the result

I play with F #, and the compiler warns me if I do not use any result ( the same problem described here ). Since F # even has an “Ignore” function for this, it seems like it is somewhat important, but I really don't understand why - why does C # not care about it, but does F # do?

+4
source share
2 answers

One fundamental difference between C # and F # is that in F # this whole expression (as opposed to a combination of expressions and statements). This includes things that are operations in C-style languages, such as control flow constructs.

, . , , .

, -, , , . - , . , , - .

F # , , ( ) , , unit. , ignore - unit.

+10

F #, - . F #, , , , . , , F # .

+4

All Articles