Addressing some compile-time problems

Although REPL can help explore and tweak correct F# code, it keeps compiler errors intact, as evaluating a code snippet includes compilation by the F# compiler embedded into fsi. And I must admit that some compile-time errors may puzzle an inexperienced F# developer. Here, I will analyze several kinds of such errors and provide advice on how to get rid of them. Before I do this, you should keep in mind that because an initial defect usually gets ingested by type inference as correct code, the reported compilation error is in line with that convoluted type inference determination. That is, type inference often masks the authentic cause of an error. We will go over some occasions of this layout soon.

The if-then ...

Get F# 4.0 Design Patterns now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.