Skip to content

Instantly share code, notes, and snippets.

@saoudrizwan
Created February 11, 2017 02:17
Show Gist options
  • Save saoudrizwan/1784b1f5309b1c8bafa0fd6d0b72e137 to your computer and use it in GitHub Desktop.
Save saoudrizwan/1784b1f5309b1c8bafa0fd6d0b72e137 to your computer and use it in GitHub Desktop.
/// Returns an array containing, in order, the elements of the sequence
/// that satisfy the given predicate.
/// - Parameter shouldInclude: A closure that takes an element of the
/// sequence as its argument and returns a Boolean value indicating
/// whether the element should be included in the returned array.
/// - Returns: An array of the elements that `includeElement` allowed.
public func filter(_ isIncluded: (Element) throws -> Bool) rethrows -> [Element]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment