A divertimento on MonadPlus and nondeterminism,☆☆

https://doi.org/10.1016/j.jlamp.2016.06.004Get rights and content
Under an Elsevier user license
open archive

Highlights

  • This article is to celebrate the contributions of José Nuno Oliveira.

  • It outlines a principled way of modeling notions of nondeterminism.

  • This is done with mathematically well-motivated specializations of monads.

  • The MonadPlus type class of Haskell is given a mathematical underpinning.

  • Further examples are derived from different varieties of semigroups and monoids.

Abstract

In the Haskell community, there is a controversy about what the laws of the MonadPlus type constructor class ought to be. We suggest that there is no single universal correct answer, however there is a universal method. Important classes of notions of finitary nondeterminism are captured by what we call monads of semigroups and monads of monoids, but also by monads of different specializations of semigroups and monoids. Some of these specializations of monads are exotic and amusing too.

Keywords

Monads
Algebraic operations
Semigroups
Nondeterminism

Cited by (0)

Dedicated to José Nuno Oliveira on the occasion of his 60th birthday.

☆☆

This material was also presented at the HOPE 2015 workshop in Vancouver, BC.