Dioids for Computational Effects

Abstract There are different algebraic structures that one can use to model notions of computation. The most well- known are monads, but lately, applicative functors have been gaining popularity. These two structures can be understood as instances of the unifying notion of monoid in a monoidal category. When dealing with non-determinism, it is usual to extend monads and applicative functors with additional structure. However, depending on the desired non-determinism, there are different options of interaction between the existing and the additional structure. This article studies one of those options, which is captured algebraically by dioids. We generalise dioids to dioid categories and show how dioids in such a category model non- determinism in monads and applicative functors. Moreover, we study the construction of free dioids in a programming context.

[1]  S. Lane Categories for the Working Mathematician , 1971 .

[2]  Marco Grandis Cubical monads and their symmetries , 1993 .

[3]  J. Michael Spivey,et al.  A Functional Theory of Exceptions , 1990, Sci. Comput. Program..

[4]  Janis Voigtländer,et al.  Asymptotic Improvement of Computations over Free Monads , 2008, MPC.

[5]  Brian Day,et al.  Note on monoidal localisation , 1973, Bulletin of the Australian Mathematical Society.

[6]  Simon Marlow,et al.  There is no fork: an abstraction for efficient, concurrent, and concise data access , 2014, ICFP.

[7]  J. Michael Spivey,et al.  When Maybe is not good enough , 2012, J. Funct. Program..

[8]  Bruno C. d. S. Oliveira,et al.  The essence of the Iterator pattern , 2006, J. Funct. Program..

[9]  Exequiel Rivas,et al.  Notions of computation as monoids* , 2014, Journal of Functional Programming.

[10]  G. Kelly A unified treatment of transfinite constructions for free algebras, free monoids, colimits, associated sheaves, and so on , 1980, Bulletin of the Australian Mathematical Society.

[11]  Mauro Jaskelioff,et al.  An Investigation of the Laws of Traversals , 2012, MSFP.

[12]  Eugenio Moggi,et al.  Notions of Computation and Monads , 1991, Inf. Comput..

[13]  Andre Scedrov,et al.  Functorial Polymorphism , 1990, Theor. Comput. Sci..

[14]  Eugenio Moggi,et al.  Computational lambda-calculus and monads , 1989, [1989] Proceedings. Fourth Annual Symposium on Logic in Computer Science.

[15]  Joseph A. Goguen,et al.  ALGEBRAS, THEORIES AND FREENESS: AN INTRODUCTION FOR COMPUTER SCIENTISTS , 1982 .

[16]  S. Doaitse Swierstra,et al.  Deterministic, Error-Correcting Combinator Parsers , 1996, Advanced Functional Programming.

[17]  John Hughes,et al.  A Novel Representation of Lists and its Application to the Function "reverse" , 1986, Inf. Process. Lett..

[18]  GibbonsJeremy,et al.  The essence of the iterator pattern , 2009 .

[19]  Conor McBride,et al.  Applicative programming with effects , 2008, J. Funct. Program..

[20]  Tarmo Uustalu A divertimento on MonadPlus and nondeterminism , 2016, J. Log. Algebraic Methods Program..

[21]  Tom Schrijvers,et al.  From monoids to near-semirings: the essence of MonadPlus and alternative , 2015, PPDP.

[22]  Philip Wadler,et al.  Comprehending monads , 1990, LISP and Functional Programming.

[23]  John Launchbury,et al.  Advanced Functional Programming: Second International School, Olympia, WA, USA, August 26 - 30, 1996, Tutorial Text , 1996 .