A unified view of monadic and applicative non-determinism

Abstract It is well-known that monads are monoids in the category of endofunctors, and in fact so are applicative functors. Unfortunately, monoids do not have enough structure to account for computational effects with non-determinism operators. This article recovers a unified view of computational effects with non-determinism by extending monoids to near-semirings with both additive and multiplicative structure. This enables us to generically define free constructions as well as a novel double Cayley representation that optimises both left-nested sums and left-nested products.

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

[2]  Bart Demoen,et al.  Heuristics Entwined with Handlers Combined: From Functional Specification to Logic Programming Implementation , 2014, PPDP '14.

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

[4]  J. Michael Spivey Algebras for combinatorial search , 2009, J. Funct. Program..

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

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

[7]  Bart Jacobs,et al.  Under Consideration for Publication in J. Functional Programming Categorical Semantics for Arrows , 2022 .

[8]  Maciej Piróg,et al.  Eilenberg-Moore Monoids and Backtracking Monad Transformers , 2016, MSFP.

[9]  Oleg Kiselyov,et al.  Reflection without remorse: revealing a hidden sequence to speed up monadic reflection , 2014, Haskell '14.

[10]  Amr Sabry,et al.  Backtracking, interleaving, and terminating monad transformers: (functional pearl) , 2005, ICFP '05.

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

[12]  Graham Hutton,et al.  Monadic parsing in Haskell , 1998, Journal of Functional Programming.

[13]  Exequiel Rivas,et al.  Functional pearl: a smart view on datatypes , 2015, ICFP.

[14]  Tarmo Uustalu,et al.  Coproducts of Ideal Monads , 2004, RAIRO Theor. Informatics Appl..

[15]  Ambrus Kaposi,et al.  Free Applicative Functors , 2014, MSFP.

[16]  HinzeRalf Deriving backtracking monad transformers , 2000 .

[17]  John Hughes,et al.  Generalising monads to arrows , 2000, Sci. Comput. Program..

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

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

[20]  S. Doaitse Swierstra,et al.  Parsing permutation phrases , 2004, J. Funct. Program..

[21]  Mauro Javier Jaskelioff Lifting of operations in modular monadic semantics , 2009 .

[22]  Christoph Lüth,et al.  Composing monads using coproducts , 2002, ICFP '02.

[23]  Rick Statman Near Semi-rings and Lambda Calculus , 2014, RTA-TLCA.

[24]  K. V. Krishna,et al.  Representation of Near-Semirings and Approximation of Their Categories , 2008 .

[25]  Ralf Hinze,et al.  Deriving backtracking monad transformers , 2000, ICFP '00.

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

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

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

[29]  Stefan Milius,et al.  Coproducts of Monads on Set , 2012, 2012 27th Annual IEEE Symposium on Logic in Computer Science.

[30]  Exequiel Rivas,et al.  Dioids for Computational Effects , 2017, CLEI Selected Papers.

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

[32]  S. Doaitse Swierstra,et al.  Parse Your Options , 2013, The Beauty of Functional Code.