ddc: Ticket #74: Finish implementation of constructor classes
http://trac.haskell.org/ddc/ticket/74
<p>
Added by Jared
</p>
<p>
The following function causes the compiler to panic.
</p>
<pre class="wiki">example = map id 0
</pre><p>
The error message is
</p>
<pre class="wiki">DDC: error in stage solve
PANIC in Type.Squid.Class
mergeClassesT: [% -> *, * -> *]
</pre><p>
This should fail with a class error stating that Int is not an instance of
Functor. When type classes are fully working, it should complain that it
could not deduce class Functor from context Num.
</p>
<p>
Kind inference and constructor classes aren't finished yet - so there'll be lots more
panic s where this came from.
</p>
en-usddchttp://trac.haskell.org/ddc/chrome/common/trac_banner.png
http://trac.haskell.org/ddc/ticket/74
Trac 0.11.1benlMon, 24 May 2010 12:25:22 GMTcomment added; resolution set; status changed
http://trac.haskell.org/ddc/ticket/74#comment:1
http://trac.haskell.org/ddc/ticket/74#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>
In the Functor class we have
</p>
<pre class="wiki">class Functor (f :: * -> *) where
map :: forall a b !e1 $c1
. (a -(!e1 $c1)> b) -> f a -(!e2 $c2)> f b
:- !e2 = !{ !ReadT (f a); !e1 }
, $c2 = f : $c1
</pre><p>
This type requires the second argument of map to be a constructor (f) applied to a type (a), so f :: * -> *. If we apply this to 0, that has type Int32 which has kind % -> *, so we get a kind error.
</p>
Ticket