## Introduction

When you use allSatisfy function in Array, Dictionary...

You have to check empty.

Because if Array, Dictionary are empty, results of allSatisfy are true.

```
let numbers = [Int]()
let numbers2 = [1,2,3,4,5]
func isGreaterThanThree(_ number: Int) -> Bool {
return number > 3
}
let numbersAreGreaterThanThree = numbers.allSatisfy(isGreaterThanThree) // true
let numbers2AreGreaterThanThree = numbers2.allSatisfy(isGreaterThanThree) // false
// So we must check empty.
func isNumbersAreGreaterThanThree() -> Bool {
guard numbers.isEmpty == false else {
return false
}
numbers.allSatisfy(isGreaterThanThree)
}
```

## Motivation

When you use reduce function, you can define initial result.

So I think that if we can define empty result, we don't have to check empty.

## Proposed solution

```
func allSatisfy(_ ifEmpty: Bool, _ predicate: (Element) throws -> Bool) rethrows -> Bool {
guard self.isEmpty == false else {
return ifEmpty
}
return self.allSatisfiy(predicate)
}
let numbersAreGreaterThanThree = numbers.allSatisfy(isGreaterThanThree) // false
```

It makes help people to reduce bolierpate code for empty check.