#### Overview of this book

Scala Functional Programming Patterns
Credits
Aknowledgement
www.PacktPub.com
Preface
Free Chapter
Grokking the Functional Way
Singletons, Factories, and Builders
Recursion and Chasing your Own Tail
Lazy Sequences – Being Lazy, Being Good
Taming Multiple Inheritance with Traits
Of Visitors and Chains of Responsibilities
Traversals – Mapping/Filtering/Folding/Reducing
Higher Order Functions
Actors and Message Passing
Index

## A validation problem

We need to validate incoming data. Consider an online banking application. Users have already registered and their passwords are with the bank.

The bank security team changed their requirements, so each password must now have at least six characters and a mix of upper and lowercase letters. We need to pull out the already existing passwords and see if these qualify with the new rules.

So, given a list of password strings, we need to compute a corresponding list of Booleans that will return true if the password qualifies, and otherwise false. In other words, given this list of password strings, we need a `Tuple2(List[String], List[Boolean])`.

### Setting the stage

The following is the example list of passwords:

```scala> val passwords = List("oddoddboy@thedoor", "likelynew", "alwaysThinkOfMyself", "naughty")
passwords: List[String] = List(oddoddboy@thedoor, likelynew, alwaysThinkOfMyself, naughty)
```

Let's define our length-checking function as shown:

`scala> def lengthGreaterThan...`