Skip to content

Instantly share code, notes, and snippets.

@gakuzzzz
Last active November 5, 2020 21:58
Show Gist options
  • Save gakuzzzz/4a9a9128766d8ea61177 to your computer and use it in GitHub Desktop.
Save gakuzzzz/4a9a9128766d8ea61177 to your computer and use it in GitHub Desktop.
型引数の部分適用
class Foo {
  type L[A] = Either[String, A]
  foo[L](bar)
}

 ↓

class Foo {
  type Anonymous = {type L[A] = Either[String, A]}
  foo[Anonymous#L](bar)
}

 ↓

class Foo {
  foo[({type L[A] = Either[String, A]})#L](bar)
}

 use kind-projector  

class Foo {
  foo[Either[String, ?]](bar)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment