Categorical semantics for arrows.

Journal of Functional Programming (Impact Factor: 0.94). 01/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”.

  • Source
    [Show abstract] [Hide abstract]
    ABSTRACT: This paper contributes a feedback operator, in the form of a monoidal trace, to the theory of coalgebraic, state-based modelling of components. The feedback operator on components is shown to satisfy the trace axioms of Joyal, Street and Verity. We employ McCurdy's tube diagrams, which are an extension of standard string diagrams for monoidal categories, to represent and manipulate component diagrams. The microcosm principle then yields a canonical ‘inner’ traced monoidal structure on the category of resumptions (elements of final coalgebras/components). This generalises an observation by Abramsky, Haghverdi and Scott.
    Mathematical Structures in Computer Science 01/2011; 21:267-320. · 0.72 Impact Factor
  • Source
    [Show abstract] [Hide abstract]
    ABSTRACT: Multi-level languages and Arrows both facilitate metaprogramming, the act of writing a program which generates a program. The arr function required of all Arrows turns arbitrary host language expressions into guest language expressions; because of this, Arrows may be used for metaprogramming only when the guest language is a superset of the host language. This restriction is also present in multi-level languages which offer unlimited cross-level persistence. This paper introduces generalized arrows and proves that they generalize Arrows in the following sense: every Arrow in a programming language arises from a generalized arrow with that language's term category as its codomain. Generalized arrows impose no containment relationship between the guest language and host language; they facilitate heterogeneous metaprogramming. The category having all generalized arrows as its morphisms and the category having all multi-level languages as its morphisms are isomorphic categories. This is proven formally in Coq, and the proof is offered as justification for the assertion that multi-level languages are generalized arrows. Combined with the existence of a particular kind of retraction in the host language, this proof can be used to define an invertible translation from two-level terms to one-level terms parameterized by a generalized arrow instance. This is ergonomically significant: it lets guest language providers write generalized arrow instances while the users of those guest languages write multi-level terms. This is beneficial because implementing a generalized arrow instance is easier than modifying a compiler, whereas writing two-level terms is easier than manipulating generalized arrow terms.
  • [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

Full-text (4 Sources)

Available from
May 16, 2014