0

Just defined a generic map function in Swift:

func map<T, S: Sequence>(_ f: @escaping (S.Element) -> T) -> (S) -> [T] {
    return { xs in xs.map(f) }
}

However, when I try to partially apply the identity function...

map({ $0 })

the compiler says:

No exact matches in call to global function 'map'

How can I solve this issue ?

F. Zer
  • 1,081
  • 7
  • 9

0 Answers0