Question: Good day. Can you help me to combine several functions `(string -> string -> bool)` to one big function `(string -> bool)`.

I have a `(contactList:seq<string>)` and function 

```
let checkEqual localPhone azurePhone =
    localPhone = azurePhone

```

I did `Seq.map` to get seq of functions `(string -> bool)`:

```
let checks = contactList |> Seq.map (fun x -> checkEqual x)

```

Now i need to combine this seq somehow to one big func `(string -> bool)` to use it in Where clause of Azure Mobile Services.

```
let! result = table.Where(fun y > checkAll y).ToEnumerableAsync() 
              |> Async.AwaitTask

```

I want to make expression like this:
`y == x1 || y == x2 || etc`

Answer: 
For this particular scenario you can use [`Seq.exists`](http://msdn.microsoft.com/en-gb/library/vstudio/ee353562(v=vs.100).aspx):

```
checkAll y = checks |> Seq.exists (fun f -> f y)

```
For a more general solution, you can write something like this:

```
checkAll y = checks |> Seq.fold (fun acc check -> acc || check y) false

```

`acc` is generally named like this because it is the accumulator -- the value that stores what has been computed so far.

The advantage of `exists` is that it will stop scanning the sequence as soon as it finds a true value, whereas `fold` always goes to the end of the sequence. But `fold` is more general: you can write a sum, a product, or really any global computation on your sequence with it.