title: What's the current status of restricted monads?
body: <p>Going back to at least the late 1990s there have been people wishing for the integration of <a href="http://okmij.org/ftp/Haskell/types.html#restricted-datatypes" rel="nofollow noreferrer">restricted monads</a> into Haskell in a friendly way.</p>
  
  <p>For example, without restricted monads you can't make an efficient monad out of <code>Set</code>, <code>Map</code> or <a href="http://hackage.haskell.org/packages/archive/probability/0.2.2/doc/html/Numeric-Probability-Distribution.html" rel="nofollow noreferrer">probability distributions</a>. Here's a SO <a href="https://stackoverflow.com/questions/379546/restricting-a-monad-to-a-type-class">question</a> from a few years ago where someone else ran afoul of this problem.</p>
  
  <p>There are various workarounds that people have come up with, including:</p>
  
  <ul>
  <li><p>Creating a <a href="http://hsenag.livejournal.com/11803.html" rel="nofollow noreferrer">new type class</a> for every possible restriction.</p></li>
  <li><p>Using <a href="http://www.randomhacks.net/articles/2007/03/15/data-set-monad-haskell-macros" rel="nofollow noreferrer">Template Haskell</a>.</p></li>
  <li><p>Using <a href="http://blog.omega-prime.co.uk/?p=127" rel="nofollow noreferrer">Constraint Kinds</a>.</p></li>
  </ul>
  
  <p>None of these approaches seem to be "canonical" however. I found a comment from Don Stewart on <a href="http://blog.sigfpe.com/2007/06/how-to-write-tolerably-efficient.html" rel="nofollow noreferrer">this blog post</a>, in 2007, where he intimated that we were "quite close" to having restricted monads with <a href="http://www.haskell.org/haskellwiki/GHC/Indexed_types" rel="nofollow noreferrer">Indexed types</a>.</p>
  
  <p>What is the current status? Is there now a 'canonical' way to do restricted monads? Or we are still living with workarounds?</p>