It's true that map
is borrowed from functional programming, but Swift has no concept of 'pure' functions and has never made such a requirement for map
. The Swift Programming Language itself has (or at least, one of its editions once had) an example of map(print)
, so I think it's fair to say that such usage is 'idiomatic' Swift.
1 Like