What about &quot;users :: ToJson a =&gt; a&quot;?<br><br><div class="gmail_quote">On Tue, Oct 4, 2011 at 12:42 AM, Magicloud Magiclouds <span dir="ltr">&lt;<a href="mailto:magicloud.magiclouds@gmail.com">magicloud.magiclouds@gmail.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,<br>
  I have a function:<br>
post :: (ToJson p, FromJson q) =&gt; String -&gt; String -&gt; String -&gt;<br>
Map.Map String p -&gt; IO q<br>
  Now I&#39;d like to call it like:<br>
r &lt;- post site token &quot;user.addMedia&quot; (Map.fromList [ (&quot;users&quot;, users :: ToJson)<br>
                                                   , (&quot;medias&quot;, medias<br>
:: ToJson) ])<br>
  So I got the problem. If I used things like &quot;users :: ToJson&quot;, then<br>
class used as a type error occurred. But if I did not use them, since<br>
users and medias were actually different types, then fromList failed,<br>
required the type of medias the same with users.<br>
<br>
  How to resolve the conflict?<br>
<font color="#888888">--<br>
竹密岂妨流水过<br>
山高哪阻野云飞<br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</font></blockquote></div><br>