|
|
|
|
|
by latkin
4074 days ago
|
|
I think OP has something like this in mind: let x =
if ... then
let a = frob()
Foo + a
else Baz
`x` is never in an invalid/uninitialized state, and it's immediately clear exactly what code contributes toward computing its value.Somewhat related, you can also define nested functions in F#, which is very convenient and tidy. No need for a pile of one-off private helpers at the same syntactic level as your public APIs - just tuck them inside the members which need them. |
|