map
flatten
Apply this law: xs flatMap f = (xs map f).flatten.
filter
Basic for-expression.
Implement scalarProduct.