func ApplePartition(in <-chan Apple, matching, others chan<- Apple, p func(Apple) bool) {
	for v := range in {
		if p(v) {
			matching <- v
		} else {
			others <- v
		}
	}
	close(matching)
	close(others)
}
// ApplePartition filters a stream of Apple into two output streams using a predicate p, those that
// match and all others.
// When the sender closes the input channel, both output channels are closed then the function terminates.
//
// It is part of the Plumbing function suite for Apple.
ApplePartition filters a stream of Apple into two output streams using a predicate p, those that
match and all others.
When the sender closes the input channel, both output channels are closed then the function terminates.

It is part of the Plumbing function suite for Apple.
// ApplePartition filters a stream of Apple into two output streams using a predicate p those that // match and all others . // When the sender closes the input channel both output channels are closed then the function terminates . // // It is part of the Plumbing function suite for Apple .
func ApplePartition(in <-chan Apple, matching, others chan<- Apple, p func(Apple) bool) {
	for v := range in {
		if p(v) {
			matching <- v
		} else {
			others <- v
		}
	}
	close(matching)
	close(others)
}
func ApplePartition ( in <- chan Apple , matching , others chan <- Apple , p func ( Apple ) bool ) { for v := range in { if p ( v ) { matching <- v } else { others <- v } } close ( matching ) close ( others ) }
ApplePartition filters a stream of Apple into two output streams using a predicate p, those that
match and all others.
ApplePartition filters a stream of Apple into two output streams using a predicate p those that match and all others .