<div dir="ltr"><div><div><div>Hi,<br><br> thank you for the tip! It helps but it&#39;s not quite there yet. If you see the program in attachment, I can make it compile only by commenting the type declaration for the second function, otherwise it&#39;s the exact same error message as before.<br>
<br></div>In -Wall the compiler does suggest me the signature, but it&#39;s not enlightening for me at this point, I&#39;ve yet to dig that deep in haskell&#39;s type system:<br>parseConfigMap :: forall t (m :: * -&gt; *). Monad m =&gt; t -&gt; m ()<br>
<br></div> Can you explain me why my type signature is not correct?<br><br></div> Thank you again!<br><div><br>Emmanuel<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Mar 17, 2013 at 1:23 PM, Andres Löh <span dir="ltr">&lt;<a href="mailto:andres@well-typed.com" target="_blank">andres@well-typed.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi there.<br>
<div class="im"><br>
&gt; -- | A JSON \&quot;object\&quot; (key\/value map).<br>
&gt; type Object = Map Text Value<br>
<br>
</div>See <a href="https://github.com/bos/aeson/blob/master/release-notes.markdown" target="_blank">https://github.com/bos/aeson/blob/master/release-notes.markdown</a><br>
<br>
Quoting:<br>
<br>
&quot;<br>
0.3 to 0.4<br>
<br>
[...]<br>
<br>
We switched the intermediate representation of JSON objects from<br>
Data.Map to Data.HashMap, which has improved type conversion<br>
performance.<br>
<div class="im">&quot;<br>
<br>
&gt; So my clearly flawed plan is to get the value, pattern mach it against<br>
&gt; (Object hash) and then work on the hash. However for the program in<br>
&gt; attachment, which I would expect to compile, I get this compile error:<br>
&gt;<br>
&gt; question.hs:12:62:<br>
&gt;     Couldn&#39;t match expected type `Map.Map T.Text Value&#39;<br>
&gt;                 with actual type `Object&#39;<br>
&gt;     In the first argument of `parseConfigMap&#39;, namely `map&#39;<br>
&gt;     In the second argument of `($)&#39;, namely `parseConfigMap map&#39;<br>
&gt;     In the expression: return $ parseConfigMap map<br>
<br>
</div>This has nothing to do with &quot;type&quot; vs. &quot;data&quot;. The type synonym<br>
expansion of Object doesn&#39;t match your type, because it uses a HashMap<br>
rather than a Map.<br>
<br>
Cheers,<br>
  Andres<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Andres Löh, Haskell Consultant<br>
Well-Typed LLP, <a href="http://www.well-typed.com" target="_blank">http://www.well-typed.com</a><br>
<br>
_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org">Beginners@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/beginners" target="_blank">http://www.haskell.org/mailman/listinfo/beginners</a><br>
</font></span></blockquote></div><br></div>