18 research outputs found

    Quotienting the delay monad by weak bisimilarity

    Get PDF
    The delay datatype was introduced by Capretta as a means to deal with partial functions (as in computability theory) in Martin-Löf type theory. It is a monad and it constitutes a constructive alternative to the maybe monad. It is often desirable to consider two delayed computations equal, if they terminate with equal values, whenever one of them terminates. The equivalence relation underlying this identification is called weak bisimilarity. In type theory, one commonly replaces quotients with setoids. In this approach, the delay monad quotiented by weak bisimilarity is still a monad. In this paper, we consider Hofmann's alternative approach of extending type theory with inductive-like quotient types. In this setting, it is difficult to define the intended monad multiplication for the quotiented datatype. We give a solution where we postulate some principles, crucially proposition extensionality and the (semi-classical) axiom of countable choice. We have fully formalized our results in the Agda dependently typed programming language

    Promonads and String Diagrams for Effectful Categories

    Full text link
    Premonoidal and Freyd categories are both generalized by non-cartesian Freyd categories: effectful categories. We construct string diagrams for effectful categories in terms of the string diagrams for a monoidal category with a freely added object. We show that effectful categories are pseudomonoids in a monoidal bicategory of promonads with a suitable tensor product.Comment: In Proceedings ACT 2022, arXiv:2307.1551

    Reversible Effects as Inverse Arrows

    Get PDF
    Reversible computing models settings in which all processes can be reversed. Applications include low-power computing, quantum computing, and robotics. It is unclear how to represent side-effects in this setting, because conventional methods need not respect reversibility. We model reversible effects by adapting Hughes' arrows to dagger arrows and inverse arrows. This captures several fundamental reversible effects, including serialization and mutable store computations. Whereas arrows are monoids in the category of profunctors, dagger arrows are involutive monoids in the category of profunctors, and inverse arrows satisfy certain additional properties. These semantics inform the design of functional reversible programs supporting side-effects.Comment: 15 pages; corrected Example 3.

    Commutativity

    Full text link
    We describe a general framework for notions of commutativity based on enriched category theory. We extend Eilenberg and Kelly's tensor product for categories enriched over a symmetric monoidal base to a tensor product for categories enriched over a normal duoidal category; using this, we re-find notions such as the commutativity of a finitary algebraic theory or a strong monad, the commuting tensor product of two theories, and the Boardman-Vogt tensor product of symmetric operads.Comment: 48 pages; final journal versio

    Quantum Information Effects

    Get PDF
    We study the two dual quantum information effects to manipulate the amount of information in quantum computation: hiding and allocation. The resulting type-and-effect system is fully expressive for irreversible quantum computing, including measurement. We provide universal categorical constructions that semantically interpret this arrow metalanguage with choice, starting with any rig groupoid interpreting the reversible base language. Several properties of quantum measurement follow in general, and we translate quantum flow charts into our language. The semantic constructions turn the category of unitaries between Hilbert spaces into the category of completely positive trace-preserving maps, and they turn the category of bijections between finite sets into the category of functions with chosen garbage. Thus they capture the fundamental theorems of classical and quantum reversible computing of Toffoli and Stinespring.Comment: 32 pages, including 10 page appendi

    Arrows, like Monads, are Monoids

    Get PDF
    Monads are by now well-established as programming construct in functional languages. Recently, the notion of “Arrow ” was introduced by Hughes as an extension, not with one, but with two type parameters. At first, these Arrows may look somewhat arbitrary. Here we show that they are categorically fairly civilised, by showing that they correspond to monoids in suitable subcategories of bifunctors C op ×C → C. This shows that, at a suitable level of abstraction, arrows are like monads — which are monoids in categories of functors C → C. Freyd categories have been introduced by Power and Robinson to model computational effects, well before Hughes ’ Arrows appeared. It is often claimed (informally) that Arrows are simply Freyd categories. We shall make this claim precise by showing how monoids in categories of bifunctors exactly correspond to Freyd categories

    Monads need not be endofunctors

    Get PDF
    We introduce a generalization of monads, called relative monads, allowing for underlying functors between different categories. Examples include finite-dimensional vector spaces, untyped and typed λ-calculus syntax and indexed containers. We show that the Kleisli and Eilenberg-Moore constructions carry over to relative monads and are related to relative adjunctions. Under reasonable assumptions, relative monads are monoids in the functor category concerned and extend to monads, giving rise to a coreflection between relative monads and monads. Arrows are also an instance of relative monads
    corecore