|
two things about defs: msg#00409lang.scala
I've posted one of these features into buglist, another one is probably waiting it's turn. First one: scala> def sum(a: Int)(b: Int): Int = a+b sum: (scala.Int)(scala.Int)scala.Int scala> val sum2 = (x: int) => (y: int) => x + y sum2: (scala.Int) => (scala.Int) => scala.Int = <function> Could interpreter print out only one version of type output? Personally I think the best one is: scala.Int => scala.Int => scala.Int = <function> Second one: scala> def yyy = &(List(1,2) foldLeft) yyy: => (scala.Nothing) => ((scala.Nothing, scala.Int) => scala.Nothing) => scala.Nothing scala> def xxx[a] : (a => ((a, int) => a) => a) = &(List(1,2) foldLeft) xxx: [a](a) => ((a, scala.Int) => a) => a Is it possible for type inference mechanism to abstract over scala.Nothing when deciding type for yyy? It would be great to have xxx automatically. Though, this problem may be undecidable. -- WBR, Alexander Sergeev. |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Use of synchronized in scala.Iterator.duplicate?: 00409, Miles Sabin |
|---|---|
| Next by Date: | Any way to cut down on memory footprint?: 00409, Warren Henning |
| Previous by Thread: | Use of synchronized in scala.Iterator.duplicate?i: 00409, Miles Sabin |
| Next by Thread: | Re: two things about defs: 00409, Burak Emir |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |