rescript-lang/rescript-lang.org

Document co / contravariance (`<+a>`, `<-a>`)

开放

#149 创建于 2021年1月1日

 (3 条评论) (2 个反应) (0 位负责人)MDX (258 个派生)github user discovery
help wantedmanual

仓库指标

星标
 (1,855 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

This one is definitely an advanced topic.

  • What does + and - mean?
  • What syntax constructs are possible? (type, function, etc.)
  • What practical use-cases does it have / Why do we need it?

Things to avoid:

  • Complex / too scientific wording
  • Too generic examples without practical context

Hints:

  • We use a covariant type in Js.Promise.t (see it here)

贡献者指南