func (c Channel) Take(count int) chan T {
	result := make(chan T, 1)
	go func() {
		defer close(result)
		if count <= 0 {
			return
		}
		i := 0
		for el := range c.Data {
			result <- el
			i++
			if i == count {
				return
			}
		}
	}()
	return result
}
Take takes first count elements from the channel.
package implementation
import (
	"sync"
)
type Channel struct {
	Data chan T
}
func (c Channel) Any(f func(el T) bool) bool {
	for el := range c.Data {
		if f(el) {
			return true
		}
	}
	return false
}
func (c Channel) All(f func(el T) bool) bool {
	for el := range c.Data {
		if !f(el) {
			return false
		}
	}
	return true
}
func (c Channel) ChunkEvery(count int) chan []T {
	chunks := make(chan []T, 1)
	go func() {
		chunk := make([]T, 0, count)
		i := 0
		for el := range c.Data {
			chunk = append(chunk, el)
			i++
			if i%count == 0 {
				i = 0
				chunks <- chunk
				chunk = make([]T, 0, count)
			}
		}
		if len(chunk) > 0 {
			chunks <- chunk
		}
		close(chunks)
	}()
	return chunks
}
func (c Channel) Count(el T) int {
	count := 0
	for val := range c.Data {
		if val == el {
			count++
		}
	}
	return count
}
func (c Channel) Drop(n int) chan T {
	result := make(chan T, 1)
	go func() {
		i := 0
		for el := range c.Data {
			if i >= n {
				result <- el
			}
			i++
		}
		close(result)
	}()
	return result
}
func (c Channel) Each(f func(el T)) {
	for el := range c.Data {
		f(el)
	}
}
func (c Channel) Filter(f func(el T) bool) chan T {
	result := make(chan T, 1)
	go func() {
		for el := range c.Data {
			if f(el) {
				result <- el
			}
		}
		close(result)
	}()
	return result
}
func (c Channel) Map(f func(el T) G) chan G {
	result := make(chan G, 1)
	go func() {
		for el := range c.Data {
			result <- f(el)
		}
		close(result)
	}()
	return result
}
func (c Channel) Max() (T, error) {
	max, ok := <-c.Data
	if !ok {
		return max, ErrEmpty
	}
	for el := range c.Data {
		if el > max {
			max = el
		}
	}
	return max, nil
}
func (c Channel) Min() (T, error) {
	min, ok := <-c.Data
	if !ok {
		return min, ErrEmpty
	}
	for el := range c.Data {
		if el < min {
			min = el
		}
	}
	return min, nil
}
func (c Channel) Reduce(acc G, f func(el T, acc G) G) G {
	for el := range c.Data {
		acc = f(el, acc)
	}
	return acc
}
func (c Channel) Scan(acc G, f func(el T, acc G) G) chan G {
	result := make(chan G, 1)
	go func() {
		for el := range c.Data {
			acc = f(el, acc)
			result <- acc
		}
		close(result)
	}()
	return result
}
func (c Channel) Sum() T {
	var sum T
	for el := range c.Data {
		sum += el
	}
	return sum
}