Supermonads: one notion to bind them all

Several popular generalizations of monads have been implemented in Haskell. Unfortunately, because the shape of the associated type constructors do not match the standard Haskell monad interface, each such implementation provides its own type class and versions of associated library functions. Furth...

Full description

Bibliographic Details
Main Authors: Bracker, Jan, Nilsson, Henrik
Format: Conference or Workshop Item
Published: 2016
Subjects:
Online Access:https://eprints.nottingham.ac.uk/36156/
_version_ 1848795234353283072
author Bracker, Jan
Nilsson, Henrik
author_facet Bracker, Jan
Nilsson, Henrik
author_sort Bracker, Jan
building Nottingham Research Data Repository
collection Online Access
description Several popular generalizations of monads have been implemented in Haskell. Unfortunately, because the shape of the associated type constructors do not match the standard Haskell monad interface, each such implementation provides its own type class and versions of associated library functions. Furthermore, simultaneous use of different monadic notions can be cumbersome as it in general is necessary to be explicit about which notion is used where. In this paper we introduce supermonads: an encoding of monadic notions that captures several different generalizations along with a version of the standard library of monadic functions that work uniformly with all of them. As standard Haskell type inference does not work for supermonads due to their generality, our supermonad implementation is accompanied with a language extension, in the form of a plugin for the Glasgow Haskell Compiler (GHC), that allows type inference for supermonads, obviating the need for manual annotations.
first_indexed 2025-11-14T19:28:51Z
format Conference or Workshop Item
id nottingham-36156
institution University of Nottingham Malaysia Campus
institution_category Local University
last_indexed 2025-11-14T19:28:51Z
publishDate 2016
recordtype eprints
repository_type Digital Repository
spelling nottingham-361562020-05-04T18:09:52Z https://eprints.nottingham.ac.uk/36156/ Supermonads: one notion to bind them all Bracker, Jan Nilsson, Henrik Several popular generalizations of monads have been implemented in Haskell. Unfortunately, because the shape of the associated type constructors do not match the standard Haskell monad interface, each such implementation provides its own type class and versions of associated library functions. Furthermore, simultaneous use of different monadic notions can be cumbersome as it in general is necessary to be explicit about which notion is used where. In this paper we introduce supermonads: an encoding of monadic notions that captures several different generalizations along with a version of the standard library of monadic functions that work uniformly with all of them. As standard Haskell type inference does not work for supermonads due to their generality, our supermonad implementation is accompanied with a language extension, in the form of a plugin for the Glasgow Haskell Compiler (GHC), that allows type inference for supermonads, obviating the need for manual annotations. 2016-09-23 Conference or Workshop Item PeerReviewed Bracker, Jan and Nilsson, Henrik (2016) Supermonads: one notion to bind them all. In: Proceedings of the 9th International Symposium on Haskell (Haskell '16), 22-23 September 2016, Nara, Japan. Functional programming Glasgow Haskell Compiler Haskell Monads Syntactic support Type checker plugin http://dl.acm.org/citation.cfm?doid=2976002.2976012
spellingShingle Functional programming
Glasgow Haskell Compiler
Haskell
Monads
Syntactic support
Type checker plugin
Bracker, Jan
Nilsson, Henrik
Supermonads: one notion to bind them all
title Supermonads: one notion to bind them all
title_full Supermonads: one notion to bind them all
title_fullStr Supermonads: one notion to bind them all
title_full_unstemmed Supermonads: one notion to bind them all
title_short Supermonads: one notion to bind them all
title_sort supermonads: one notion to bind them all
topic Functional programming
Glasgow Haskell Compiler
Haskell
Monads
Syntactic support
Type checker plugin
url https://eprints.nottingham.ac.uk/36156/
https://eprints.nottingham.ac.uk/36156/