The supermonad package

[ Tags: bsd3, library, monad, plugin, type-system ] [ Propose Tags ]

The supermonad library adds support for supermonads to GHC using a type checker plugin. Plugins are available from GHC 7.10 onwards. The base library containing the Haskell representation of super monads is also given by this package. Additional information can be found in the README.

[Skip to Readme]


Versions 0.1
Dependencies base (>=4.8 && <5), containers (==0.5.*), fgl (>=5.5 && <6.0), ghc (>=7.10.1 && <8.1), mtl (>=2.2 && <3), transformers (>=0.4 && <0.6) [details]
License BSD3
Copyright Copyright (c) 2016, Jan Bracker
Author Jan Bracker <>
Maintainer Jan Bracker <>
Category Type System, Plugin, Monad
Bug tracker
Source repository head: git clone
Uploaded Wed Sep 14 11:57:31 UTC 2016 by JanBracker
Distributions NixOS:0.1
Downloads 77 total (10 in the last 30 days)
Rating 0.0 (0 ratings) [clear rating]
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2016-09-14 [all 1 reports]
Hackage Matrix CI




Maintainer's Corner

For package maintainers and hackage trustees

Readme for supermonad-0.1

[back to package description]

Supermonads for GHC

Implementation of supermonads for GHC.

GHC Version

The implementation has been tested with GHC in version 7.10.3 and GHC 8.0.1.

Versions of GHC prior to version 7.10.1 will most certainly not work, because the plugin mechanism was still in development.

Newer version of GHC may work. If you encounter problems with a newer version of GHC, please file a bug report so they can be fixed.


To use supermonads in a module you need to do the following:

  • Enable RebindableSyntax in your module by using the LANGUAGE pragma:

    {-# LANGUAGE RebindableSyntax #-}

  • Enable the plugin in that modules using the the OPTIONS_GHC pragma:

    {-# OPTIONS_GHC -fplugin Control.Supermonad.Plugin #-}

  • Import the supermonad prelude Control.Supermonad.Prelude. If you choose to work with constrained monads you will need to import Control.Supermonad.Constrained.Prelude instead.

  • Make sure to compile the module with the -dynamic flag. This is required for GHC's plugin mechanism to work properly.

Bug Reports

If you file a bug report, please always include the version of GHC you are working with and a minimal example that shows the problem.


Examples for the use of the plugin with different kinds of monad generalizations are provided in the examples directory. All examples have their own separate cabal file and offer a version of the code with and without the use of supermonads.

Known Problems

  • The effect example will not compile with GHC 8+, because the effect-monad package requires base < 4.9 but GHC 8+ delivers base >= 4.9.