130 likes | 268 Views
Polymorphism. CSED 321 CSE 정진웅. Polymorphism. Predicative polymorphic λ -calculus Let-polymorphism Implicit polymorphism. Predicative polymorphic λ -calculus. Untyped. Typed. Untypable. e’. Typable. e ’ ’. e. Predicative polymorphic λ -calculus. Untyped λ x . x Typed
E N D
Polymorphism CSED 321 CSE 정진웅
Polymorphism • Predicative polymorphic λ-calculus • Let-polymorphism • Implicit polymorphism
Predicative polymorphic λ-calculus Untyped Typed Untypable e’ Typable e ’ ’ e
Predicative polymorphic λ-calculus • Untyped • λ x . x • Typed • λ x : int . x • λ x : bool . x
Predicative polymorphic λ-calculus • Monotype • A ::= A →A | α • Polytype • U ::= A | ∀ α.U
Predicative polymorphic λ-calculus • Polymorphism을 완벽하게 구현하지 못함 • Just polymorphism을 적용!
Let-polymorphism • polytype을 typing하는 방법
Let-polymorphism U Untyped Typable(with system F) Typable(with let-poly) Typable(with predictive-poly)
Implicit polymorphism • untyped -> typed
References • Course note • 김봉준 선배’s PPT