What part of Hindley-Milner do you not understand?

前端 未结 6 687
死守一世寂寞
死守一世寂寞 2020-11-27 23:55

I swear there used to be a T-shirt for sale featuring the immortal words:


What part of

6条回答
  •  粉色の甜心
    2020-11-28 00:33

    The notation comes from natural deduction.

    ⊢ symbol is called turnstile.

    The 6 rules are very easy.

    Var rule is rather trivial rule - it says that if type for identifier is already present in your type environment, then to infer the type you just take it from the environment as is.

    App rule says that if you have two identifiers e0 and e1 and can infer their types, then you can infer the type of application e0 e1. The rule reads like this if you know that e0 :: t0 -> t1 and e1 :: t0 (the same t0!), then application is well-typed and the type is t1.

    Abs and Let are rules to infer types for lambda-abstraction and let-in.

    Inst rule says that you can substitute a type with less general one.

提交回复
热议问题