Page 5 of 6,523 results found for scala =>
Iterable[(T=>Boolean,String)]) = { list.view.map(x => (x , preds.find( _._1(x) ))).find( _._2.isDefined ) } scala> findP( | List(1,2,3,4,5,6), | List( ((i:Int)=>i>4,"Fred") ,
http://stackoverflow.com/question...-which-predicate-has-been-satisfie
scala-2.8 function-parameter This answer uses the Numeric trait. import Numeric._ def f[A](l: List[A])(implicit numeric: Numeric[A]) = l reduceLeft ((l,r) =>
http://stackoverflow.com/question...-a-list-of-different-numeric-types
"init" on an Iterator? I'm considering the following, but I'm not confident it will always work: lines.takeWhile(_ => lines.hasNext) Tags: scala iterator
http://stackoverflow.com/question...scala-iterator-a-k-a-iterator-init
Ideas? Tags: scala functional-programming pattern-matching In case you missed the obvious: case list @ (head :: tail) if head == list.last => true The
http://stackoverflow.com/question...nts-of-list-using-pattern-matching
={shifyValue1:Int => 1 + shiftValue + 1; 2 + shift(k2:Int => Int => k2(6)} + 2 } reified(5) How can I reify it further to get rid of the 2nd shift ? Tags: scala
http://stackoverflow.com/question...t-with-two-shifts-reified-in-scala
Map[UUID,SomeObject]) : java.util.Map[UUID,java.lang.String] = { oldMap map { case(k,v) => (k->v.name)} } The scala map is scala.collection.Map and I am using import
http://stackoverflow.com/question...lize-java-map-converted-from-scala
elem.attributes map { md => (md.getNamespace(elem), md.key, md.value(0).text) } Tags: xml scala I don't think there is a better way to do this. If you need to
http://stackoverflow.com/question...xml-attribute-information-in-scala
ValidationNEL[String, Validation[String,Int]]. Is there a way to "flatten" this result, to get the ValidationNEL[String,Int]? Tags: scala scalaz You can flatten the
http://stackoverflow.com/questions/4678964/scalaz-validation
in scala 2.7? I have the following code: try { < ... some JSON parsing code .. > } catch { case e:ClassCastException => throw new ParseException(body,
http://stackoverflow.com/question...in-one-case-statement-in-scala-2-7
scala, I call Map(entities.map{e => e.id -> e}) , and I get: found : scala.collection.mutable.IndexedSeq[(Int, Entity)] required: (Int, Entity) This is
http://stackoverflow.com/question...nded-list-as-varargs-into-a-method