F# yield! (yieldbang) operator

Viewed 2227

I am learning F# at the moment but I'm having a hard time understanding this:

let allPrimes =
let rec allPrimes' n = 
    seq {
        if isPrime n then
            yield n
        yield! allPrimes' (n + 1) }
allPrimes' 2

I am not able to figure out what the yield! operator exactly does even though I've read other simpler examples and it seems yield! returns an inner sequence.

1 Answers
Related