Problem
Suppose I have an array of strings.
Using only functional programming (map, reduce, etc...), I want to create a new array which doesn't have any punctuation.
Assume that there are no embedded punctuation marks (i.e. they will be by themselves).
let test_arr = [ "This", "is", "a", "test", ";", "try", "it", "." ]
let punc = [ "!":true, ".":true, "?":true, ";":true ]
let new_arr = test_arr.remove_if { punc[ $0 ]? != nil } // how to implement?
Maybe something like this already exists? I had no luck googling in the Apple docs.