Denotational design with type class morphisms ( extended version )

نویسنده

  • Conal Elliott
چکیده

Type classes provide a mechanism for varied implementations of standard interfaces. Many of these interfaces are founded in mathematical tradition and so have regularity not only of types but also of properties (laws) that must hold. Types and properties give strong guidance to the library implementor, while leaving freedom as well. Some of this remaining freedom is in how the implementation works, and some is in what it accomplishes. To give additional guidance to the what, without impinging on the how, this paper proposes a principle of type class morphisms (TCMs), which further refines the compositional style of denotational semantics. The TCM idea is simply that the instance’s meaning follows the meaning’s instance. This principle determines the meaning of each type class instance, and hence defines correctness of implementation. It also serves to transfer laws about a type’s semantic model, such as the class laws, to hold for the type itself. In some cases, it provides a systematic guide to implementation, and in some cases, valuable design feedback. The paper is illustrated with several examples of types, meanings, and morphisms.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Higher category models of the pi-calculus

We present an approach to modeling computational calculi using higher category theory. Specifically we present a fully abstract semantics for the π-calculus. The interpretation is consistent with Curry-Howard, interpreting terms as typed morphisms, while simultaneously providing an explicit interpretation of the rewrite rules of standard operational presentations as 2-morphisms. One of the key ...

متن کامل

Quasi-Prime Algebraic Domains

The purpose of this paper is to introduce a new class of domains called quasi-prime algebraic domains. We show that this class is a good candidate for the purpose of denotational semantics of programming languages. This is achieved by exhibiting many constructions usually needed for denotational semantics on quasi-prime algebraic domains. In the first part we motivate the notion of quasi-primes...

متن کامل

Full abstraction for probabilistic PCF

We present a probabilistic version of PCF, a well-known simply typed universal functional language. The type hierarchy is based on a single ground type of natural numbers. Even if the language is globally call-byname, we allow a call-by-value evaluation for ground type arguments in order to provide the language with a suitable algorithmic expressiveness. We describe a denotational semantics bas...

متن کامل

Categories and types for axiomatic domain theory

Domain Theory provides a denotational semantics for programming languages and calculi containing fixed point combinators and other so-called paradoxical combinators. This dissertation presents results in the category theory and type theory of Axiomatic Domain Theory. Prompted by the adjunctions of Domain Theory, we extend Benton’s linear/nonlinear dualsequent calculus to include recursive linea...

متن کامل

Stratified coherent spaces: a denotational semantics for Light Linear Logic

We introduce a stratified version of the coherent spaces model where an object is given by a sequence of coherent spaces. The intuition behind it is that each level gives a different degree of precision on the computation, an appearance. A morphism is required to satisfy a coherence condition at each level and this setting gives a model of Elementary Linear Logic. We then introduce a measure fu...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2016