What's the theoretical basis for existential types?

前端 未结 3 2052
独厮守ぢ
独厮守ぢ 2020-12-22 18:54

The Haskell Wiki does a good job of explaining how to use existential types, but I don\'t quite grok the theory behind them.

Consider this example of an existential

3条回答
  •  悲&欢浪女
    2020-12-22 19:30

    Plotkin and Mitchell established a semantics for existential types, in their famous paper, which made the connection between abstract types in programming languages and existential types in logic,

    Mitchell, John C.; Plotkin, Gordon D.; Abstract Types Have Existential Type, ACM Transactions on Programming Languages and Systems, Vol. 10, No. 3, July 1988, pp. 470–502

    At a high level,

    Abstract data type declarations appear in typed programming languages like Ada, Alphard, CLU and ML. This form of declaration binds a list of identifiers to a type with associated operations, a composite “value” we call a data algebra. We use a second-order typed lambda calculus SOL to show how data algebras may be given types, passed as parameters, and returned as results of function calls. In the process, we discuss the semantics of abstract data type declarations and review a connection between typed programming languages and constructive logic.

提交回复
热议问题