bugfix in CCList.take
additional utils for pairs and functions