If I use functional-style method chains for string manipulation, I can not use the usual machinery for getting the first or last few characters: I do not have access to a reference to the current string, so I can not compute indices.
Example:
[some, nasty, objects]
.map( { $0.asHex } )
.joined()
.<first 100>
.uppercased()
+ "..."
for a truncated debug output.
So how to I implement <first 100>
, or do I have to break the chain?