Q:

How F# returns booleans from AND operation?

I am rather new to F# and just curious about the complexity of my solution to a task. I am not going to explain the whole task I am solving, but the idea is that I would like to return a boolean based on whether all elements of some list satisfy some filter. I am going through the list recursively and checking whether the element satisfies the filter or not and then just return the result AND the next result I get from calling the same function on tail.
When doing so, I got curious whether I should check for false on each step, as the result of AND operation is false as soon as any member of the operation is false. Or does F# return false as soon as it gets false from some element in AND operation itself?
Example:
// I have a function check : int -> bool
// check 1 returns false
check 1 && check 2

Does check 2 get executed or is the value returned instantly after check 1, as it returns false?

A:

&& short circuits. If check 1 returns false, then check 2 is never executed.
You can see this in action if you allow check x to have a side effect:
let check n =
    printfn "Checking %i" n
    n = 1

check 2 && check 1 // Just prints 'Checking 2'

