Question: I want to define a function that computes the number of elements in a list that satisfy a given predicate:

```
  number_of_elements :: (a -> Bool) -> [a] -> Int
  number_of_elements f xs = length (filter f xs)

```

For example:

```
  number_of_elements (==2) [2,1,54,1,2]

```

should return *2*.

We can write it shorter:

```
  number_of_elements f = length . filter f

```

Is it possible to write it without *f* parameter?

Answer: 
Sure it is:

```
number_of_elements = (length .) . filter

```
I don't think you can get more readable than the what you suggested. However, just for the fun of it you can do this:

```
numberOfElements = (.) (.) (.) length filter

```

or

```
(.:) = (.) . (.)
numberOfElements = length .: filter

```