Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def square[Element, IT[_] <: Iterable[Element], That](it: IT[Element])
- (implicit bf: CanBuildFrom[IT[Element], Element, That],
- num: Numeric[Element]): That = {
- val b = bf.apply(it)
- b.sizeHint(it)
- it.foreach(elem => b += num.times(elem,elem) )
- b.result()
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement