juan_gandhi: (VP)
2015-12-29 04:22 am
Entry tags:

could not figure out...

an example of a Set-endofunctor that does not preserve monomorphisms... any ideas?
juan_gandhi: (Default)
2011-05-25 11:26 am
Entry tags:

on variance, common sense in several short sentences


Why is type inference failing here?

scala> val xs = List(1, 2, 3, 3)
xs: List[Int] = List(1, 2, 3, 3)

scala> xs.toSet map(_*2)
<console>:9: error: missing parameter type for expanded function ((x$1) => x$1.$times(2))
       xs.toSet map(_*2)