Skip to content

Instantly share code, notes, and snippets.

@jroesch
Created August 26, 2012 01:56
Show Gist options
  • Save jroesch/3473102 to your computer and use it in GitHub Desktop.
Save jroesch/3473102 to your computer and use it in GitHub Desktop.
Full Generic Scala Version
import scala.math.Numeric.Implicits._
def doubleSum[T](s: Seq[T])(implicit n: Numeric[T]) = s.map (n.fromInt(2) * _) reduce (_ + _)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment