title: GHC 8.0.1 hangs. Explanation or compiler bug?
body: <p>Can someone explain why the following code causes GHC 8.0.1 to loop forever on compiling, or is this a bug?</p>
  
  <pre><code>{-# LANGUAGE TypeFamilyDependencies #-}
  {-# LANGUAGE FlexibleInstances #-}
  {-# LANGUAGE AllowAmbiguousTypes #-}
  
  main = return $ f (Just 'c')
  
  data D1 x
  data D2
  
  type family TF x = t | t -&gt; x
  type instance TF (D1 x, a) = Maybe (TF (x, a))
  type instance TF (D2, ()) = Char
  
  f :: TF (x, a) -&gt; ()
  f _ = ()
  </code></pre>