I'm a bit confused as to how to get two method to call each other (i.e., have A() call B() and B() call A()). It seems that F# only 'sees' the method after it's been encountered in code, so if it hasn't, it just says value or constructor has not been defined.
A()
B()
Am I missing something very basic here?
'let rec... and...' is the syntax you seek.
let rec F() = G() and G() = F()
See also Adventures in F# Co-Recursion.
2.1m questions
2.1m answers
60 comments
57.0k users