do-notation: Generalize do-notation to work on monads and indexed monads simultaneously.

[ bsd3, language, library ] [ Propose Tags ]

Please see the README on GitHub at

[Skip to Readme]
Versions [faq],,
Change log
Dependencies base (>=4.7 && <5), indexed [details]
License BSD-3-Clause
Copyright 2018 Sandy Maguire
Author Sandy Maguire
Category Language
Home page
Bug tracker
Source repo head: git clone
Uploaded by isovector at 2018-09-07T16:11:29Z
Distributions LTSHaskell:, NixOS:, Stackage:
Downloads 1375 total (10 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2018-09-07 [all 1 reports]


[Index] [Quick Jump]


Maintainer's Corner

For package maintainers and hackage trustees

Readme for do-notation-

[back to package description]


Build Status | Hackage


I've just locked an open door. Strange, yet symbolically compelling.

Manny Calavera, Grim Fandango


Have you ever wanted to manage siiiick invariants with indexed monads without giving up your regular monads in the process? do-notation lets you do this with a bunch of type jiggery-pokery behind the scenes.

It also provides the Ix m indexed monad which is a free construction over a regular monad m. Cool.


{-# LANGUAGE RebindableSyntax #-}

import Language.Haskell.DoNotation
import Prelude hiding (Monad (..), pure)


The implementation doesn't play very nicely with do-blocks bound via let.


Huge shout-outs to Csongor Kiss for very patiently walking me through the incoherent instance machinery necessary to make this all work.