GHC: Ticket #1713: type synonym families are treated as being able to be instance of a class
http://ghc.haskell.org/trac/ghc/ticket/1713
<p>
The following code doesn’t compile:
</p>
<pre class="wiki">{-# LANGUAGE TypeFamilies #-}
module TypeFamilyBug where
type family TestFamily a :: *
type instance TestFamily () = [()]
testFunction :: value -> TestFamily value -> ()
testFunction = const (const ())
testApplication :: ()
testApplication = testFunction () (return ())
</pre><p>
GHC 6.8.20070916 complains about <tt>TestFamily</tt> not being an instance of <tt>Monad</tt>. Obviously, GHC recognizes that the second argument in the application of <tt>testApplication</tt> has to be of type <tt>TestFamily ()</tt> and tries to unify this type with <tt>m ()</tt> from the type of <tt>return</tt>. However, in my opinion, GHC should reduce <tt>TestFamily ()</tt> to <tt>[()]</tt> and then see that the <tt>[]</tt> is the type which has to be an instance of <tt>Monad</tt>.
</p>
en-usGHChttp://ghc.haskell.org/trac/ghc/chrome/site/ghc_logo.png
http://ghc.haskell.org/trac/ghc/ticket/1713
Trac 1.0.1chakWed, 19 Sep 2007 12:23:09 GMTstatus changed; resolution set
http://ghc.haskell.org/trac/ghc/ticket/1713#comment:1
http://ghc.haskell.org/trac/ghc/ticket/1713#comment:1
<ul>
<li><strong>status</strong>
changed from <em>new</em> to <em>closed</em>
</li>
<li><strong>resolution</strong>
set to <em>fixed</em>
</li>
</ul>
<p>
Fixed in the HEAD will propagate to 6.8 in due course.
</p>
Ticket