let's look at that code:
let rec doSomething () =
let d = GetSomeDataFromSomewhere()
match d with
| Some x -> x
| None -> doSomething()
so that's some form of non stop polling..
but now the following form:
let rec doSomething () =
try
let d = GetSomeDataFromSomewhereButItCouldCrash()
match d with
| Some x -> x
| None -> doSomething()
with _ ->
doSomething()
that one will lead to a stack overflow if there are a lot of exceptions.
Can someone explain the mechanics at play that make the two versions behave differently?
matchfrom under thetry?try