I am a Javascripter and I love using the `not/negate` function:

```
function not (predicateFunc) {
    return function () {
        return !predicateFunc.apply(this, arguments);
    };
}

```

I am trying to do the same thing with swift:

```
func not <A> (_ f: @escaping (_ A: Any) -> Bool) -> (A) -> Bool {
    return { a in !f(a) }
}

```

But I am getting errors like

```
generic parameter 'T' could not be inferred

```

and

```
Cannot convert value of type '(_) -> Bool' to expected argument type '(Any) -> Bool'

```

The outcome I am looking for is when I have a function like this:

```
func isEmpty<T: Collection>(collection: T) -> Bool {
    return collection.count == 0
}

```

I can just create a `notEmpty` function like this:

```
let notEmpty = not(isEmpty)

```

And then use it like 

```
   notEmpty([3,4,5]) // true

```

What am I doing wrong?