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)

貢獻者指南