title: Why class constraint in type synonym needs RankNTypes
body: <p>This compiles fine:</p>
  
  <pre><code>type List a = [a]
  </code></pre>
  
  <p>But when I introduce a class constraint, the compiler asks for <code>RankNTypes</code> to be included:</p>
  
  <pre><code>type List2 a = Num a =&gt; [a]
  </code></pre>
  
  <p>After including that extension, it compiles fine. Why is that extension required for compiling the code ?</p>
  
  <p>Edit: Why do I need the constraint in the first place ?</p>
  
  <p>I was inspecting this Lens type (<code>type RefF a b = Functor f =&gt; (b -&gt; f b) -&gt; (a -&gt; f a)</code>) from <a href="http://www.twanvl.nl/blog/haskell/cps-functional-references">this post</a> and found out that it actually needed <code>RankNTypes</code> because of the <code>Functor</code> constraint.</p>