Skip to content

Instantly share code, notes, and snippets.

@alandipert
Created July 27, 2009 21:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alandipert/156750 to your computer and use it in GitHub Desktop.
Save alandipert/156750 to your computer and use it in GitHub Desktop.
scala> def List(op:(Double,Double)=>Double, n:Double*) = n.reduceLeft(op(_,_))
List: ((Double, Double) => Double,Double*)Double
scala> List(_+_,1,2,List(_*_,3,3))
res32: Double = 12.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment