2009-06-10

juan_gandhi: (Default)
2009-06-10 07:26 am

final destination

"Опоздавшая на разбившийся A330 итальянка погибла в автокатастрофе
Пожилая итальянка, опоздавшая на несколько минут на потерпевший крушение самолет A330 авиакомпании Air France, погибла в автокатастрофе, сообщает в среду агентство АНСА. " (10x [livejournal.com profile] luybu)
juan_gandhi: (Default)
2009-06-10 10:59 am

Бывший Дрозд из Сан Франциско

все сми подсели на дрозда блестящего малого трупиала грачика черножопого, который в центре Сан Франциско блестяще нападает на людей.

juan_gandhi: (Default)
2009-06-10 02:59 pm

Ельцин и Павловский

"Борис и Глеб, конечно, святые, "но надо бороться за себя, за страну, а отдали без борьбы" - сказал Путин Глазунову.
juan_gandhi: (Default)
2009-06-10 07:56 pm

scala musings...

  def testConst() {
    val sut = SetMorphism.const[String, Int](Set("a", "b", "c"), Set(1, 2, 3), 2)
    assert(Set("a", "b", "c") == sut.domain)
    assert(Set(1, 2, 3) == sut.codomain)
    assert(2 == sut("a"))
  }


Notice that I had to parameterize const() with two types, domain and codomain? See, suppose domain is empty (codomain can hardly be empty in our case) - this means that there's no way to deduce the domain element type if you have just Set().

But notice that although morphism type is SetMorphism[X, PX <: Set[X], Y, PY <: Set[Y]], I pass only two parameter types. Why? Because I used Tony Morris's partial type parameterization:

  def const[X, Y] = new {
    def apply[PX <: Set[X], Y, PY <: Set[Y]](domain: PX, codomain: PY, value: Y) =
      new SetMorphism[X, PX, Y, PY](domain, codomain, _ => value)
  }
juan_gandhi: (Default)
2009-06-10 09:52 pm

scala on android, new developments

here - seems like things are getting harder to accomplish
juan_gandhi: (Default)
2009-06-10 09:53 pm

weather report

This morning they showed the whole US map, and it was raining everywhere (except Bay Area, of course); and then subtitles went: "this weather is brought to you by American Cancer Society..." (I guess this answers [livejournal.com profile] anton_solovyev's question regarding where all this comes from)