Monads and applicative functors are staple design patterns to handle effects in pure functional programming, especially in Haskell with its built-in syntactic support. Over the last decade, however, practical needs and theoretical research have given rise to generalisations of monads and applicative functors. Examples are graded, indexed and constrained monads. The problem with these generalisations is that no unified representation of standard and generalised monads or applicatives exists in theory or practice. As a result, in Haskell, each generalisation has its own representation and library of functions. Hence, interoperability among the different notions is hampered and code is duplicated. To solve the above issues, I first survey the three most wide-spread generalisations of monads and applicatives: their graded, indexed and constrained variations. I then examine two approaches to give them a unified representation in Haskell: polymonads and supermonads. Both approaches are embodied in plugins for the Haskell compiler GHC that address most of the identified concerns. Finally, I examine category theory and propose unifying categorical models that encompass the three discussed generalisations together with the standard notions of monad and applicative.
Identifer | oai:union.ndltd.org:bl.uk/oai:ethos.bl.uk:765498 |
Date | January 2018 |
Creators | Bracker, Jan |
Publisher | University of Nottingham |
Source Sets | Ethos UK |
Detected Language | English |
Type | Electronic Thesis or Dissertation |
Source | http://eprints.nottingham.ac.uk/55211/ |
Page generated in 0.002 seconds