Article

Categorical semantics for arrows.

Journal of Functional Programming (Impact Factor: 0.94). 07/2009; 19(3-4):403-438. DOI: 10.1017/S0956796809007308
Source: DBLP

ABSTRACT Arrows are an extension of the well-established notion of a monad in functional programming languages. This article presents several examples and constructions, and develops
denotational semantics of arrows as monoids in categories of bifunctors C^op x C -> C. Observing similarities to monads -- which are monoids in categories of endofunctors C -> C
-- it then considers Eilenberg-Moore and Kleisli constructions for arrows. The latter yields
Freyd categories, mathematically formulating the folklore claim “arrows are Freyd categories”.

0 Bookmarks
 · 
78 Views
  • [Show abstract] [Hide abstract]
    ABSTRACT: The lambda calculus, subject to typing restrictions, provides a syntax for the internal language of cartesian closed categories. This paper establishes a parallel result: staging annotations, subject to named level restrictions, provide a syntax for the internal language of (the codomain of) a functor which preserves a premonoidal enrichment. Such functors are uniquely determined by functors from an {\it enriching} category to an {\it enriched} category. An equational axiomatization for the latter form is given, and Arrows are shown to constitute a special case. This result is most useful when the enrichment is that of a category of types and terms in a category of judgments. In such a scenario, the proof of correspondence yields a translation from well typed multi-level terms to well typed one-level terms which are parameterized over an instance of a {\it generalized arrow} (GArrow). The translation is defined by induction on the structure of the proof that the multi-level program is well typed, relying on information encoded in the proof's use of structural rules (weakening, contraction, exchange, and context associativity). When supplied with an appropriate GArrow instance, the translation preserves big-step semantics. From a practical perspective, this permits metalanguage designers to factor out the syntactic machinery of metaprogramming by providing a single translation from multi-level syntax into expressions of GArrow type. Object language {\it providers} need only implement the functions of the GArrow type class in point-free style. Object language {\it users} may write metaprograms over these object languages in a pointful style, sharing the same binding, scoping, abstraction, and application mechanisms across both the object language and metalanguage.
    Computing Research Repository - CORR. 01/2010;
  • [Show abstract] [Hide abstract]
    ABSTRACT: Effects are fundamental to programming languages. Even the lambda calculus has effects, and consequently the two famous evaluation strategies produce different semantics. As such, much research has been done to improve our understanding of effects. Since Moggi introduced monads for his computational lambda calculus, further generalizations have been designed to formalize increasingly complex computational effects, such as indexed monads followed by layered monads followed by parameterized monads. This succession prompted us to determine the most general formalization possible. In searching for this formalization we came across many surprises, such as the insufficiencies of arrows, as well as many unexpected insights, such as the importance of considering an effect as a small component of a whole system rather than just an isolated feature. In this paper we present our semantic formalization for producer effect systems, which we call a productor, and prove its maximal generality by focusing on only sequential composition of effectful computations, consequently guaranteeing that the existing monadic techniques are specializations of productors.
    Proceedings of the 40th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages; 01/2013
  • Source
    [Show abstract] [Hide abstract]
    ABSTRACT: Lawvere theories provide a categorical formulation of the algebraic theories from universal algebra. Freyd categories are categorical models of first-order effectful programming languages. The notion of sound limit doctrine has been used to classify accessible categories. We provide a definition of Lawvere theory that is enriched in a closed category that is locally presentable with respect to a sound limit doctrine. For the doctrine of finite limits, we recover Power's enriched Lawvere theories. For the empty limit doctrine, our Lawvere theories are Freyd categories, and for the doctrine of finite products, our Lawvere theories are distributive Freyd categories. In this sense, computational effects are algebraic.
    Electronic Notes in Theoretical Computer Science 01/2014; 303:197–206.

Full-text (4 Sources)

Download
46 Downloads
Available from
May 16, 2014