What about "users :: ToJson a => a"?<br><br><div class="gmail_quote">On Tue, Oct 4, 2011 at 12:42 AM, Magicloud Magiclouds <span dir="ltr"><<a href="mailto:magicloud.magiclouds@gmail.com">magicloud.magiclouds@gmail.com</a>></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) => String -> String -> String -><br>
Map.Map String p -> IO q<br>
Now I'd like to call it like:<br>
r <- post site token "user.addMedia" (Map.fromList [ ("users", users :: ToJson)<br>
, ("medias", medias<br>
:: ToJson) ])<br>
So I got the problem. If I used things like "users :: ToJson", 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>