>>681
1つ目の{は関数本体の始まり、2つ目の{がクロージャー

func keySorted(by:(Key, Key)->Bool) -> [(Key,Value)] {
  return self.sorted {a, b in
    by(a.key, b.key)
  }
}