Jun. 10th, 2009

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

juan_gandhi: (Default)
"Борис и Глеб, конечно, святые, "но надо бороться за себя, за страну, а отдали без борьбы" - сказал Путин Глазунову.
juan_gandhi: (Default)
  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)
here - seems like things are getting harder to accomplish
juan_gandhi: (Default)
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)

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

August 2025

S M T W T F S
      12
3456789
10 11 12 13141516
171819 20212223
24252627282930
31      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Aug. 23rd, 2025 10:09 pm
Powered by Dreamwidth Studios