Thanks, it did!<br><br>(For the record, here is a paraphrase of what first <br>confused me -- undefined was not the problem).<br>
<br>
&gt; enumerateMethodNames :: [String]<br>
&gt; enumerateMethodNames = map fst methodsNoConstr  <br>
&gt; --enumerateMethodNames = map fst methodsConstr <br>
&gt; <br>
&gt; methodsConstr :: (Ord a) =&gt; [(String, [a] -&gt; Int)]    <br>
&gt; methodsConstr = [ (&quot;method&quot;, methodConstr )]<br>
&gt;   where methodConstr :: (Ord a) =&gt; [a] -&gt; Int<br>
&gt;         methodConstr xs = length . sort $ xs <br>
&gt; <br>
&gt; <br>
&gt; methodsNoConstr :: [(String, [a] -&gt; Int)]    <br>
&gt; methodsNoConstr = [ (&quot;method&quot;, methodNoConstr )]<br>
&gt;   where methodNoConstr :: [a] -&gt; Int<br>
&gt;         methodNoConstr = length<br>
&gt; <br>
&gt;<br>
&gt; --First enumerateMethodNames works as expected, second does not compile.<br><br><div class="gmail_quote">2010/3/4 Ryan Ingram <span dir="ltr">&lt;<a href="mailto:ryani.spam@gmail.com">ryani.spam@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Perhaps this thought exercise will make things clear:<br>
<br>
&gt; class Show a =&gt; Foo a where<br>
&gt;    toFoo :: String -&gt; a<br>
<br>
&gt; foos :: (Foo a) =&gt; [(String, a)]<br>
&gt; foos = map (\f -&gt; (show f, f)) [toFoo &quot;a&quot;, toFoo &quot;b&quot;, toFoo &quot;c&quot;]<br>
<br>
&gt; data Foo1 = Foo1<br>
&gt; instance Show Foo1 where show _ = &quot;1&quot;<br>
&gt; instance Foo Foo1 where toFoo _ = Foo1<br>
&gt; data Foo2 = Foo2<br>
&gt; instance Show Foo2 where show _ = &quot;2&quot;<br>
&gt; instance Foo Foo2 where toFoo _ = Foo2<br>
<br>
&gt; exercise :: [String]<br>
&gt; exercise = map fst foos<br>
<br>
Exercise for the reader: what should the contents of &quot;exercise&quot; be?<br>
<br>
Keep in mind that your question is exactly the same as this one, from<br>
the compiler&#39;s point of view.<br>
<font color="#888888"><br>
  -- ryan<br>
</font><div><div></div><div class="h5"><br>
On Wed, Mar 3, 2010 at 10:48 PM, Marcus Uneson &lt;<a href="mailto:marcus.uneson@gmail.com">marcus.uneson@gmail.com</a>&gt; wrote:<br>
&gt; Thanks. I realize there are many ways to make it compile.<br>
&gt; However, I am trying to understand the mechanism behind --<br>
&gt; why does the first example compile and what constraints does<br>
&gt; enumerateMethodNames add on a (which it does not inspect)?<br>
</div></div></blockquote></div><br>