There's also ListLike: <a href="http://hackage.haskell.org/package/ListLike" target="_blank">http://hackage.haskell.org/package/ListLike</a><br><br><br>--<br>Markus Läll<br><br><div class="gmail_quote">On Fri, Mar 25, 2011 at 6:32 AM, 吴兴博 <span dir="ltr"><<a href="mailto:wuxb45@gmail.com">wuxb45@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">:) Thanks.<br>
<br>
2011/3/24 Brent Yorgey <<a href="mailto:byorgey@seas.upenn.edu">byorgey@seas.upenn.edu</a>>:<br>
<div><div></div><div class="h5">> On Thu, Mar 24, 2011 at 06:34:57PM +0800, 吴兴博 wrote:<br>
>><br>
>> 2.<br>
>> f1 :: (Integral a) => a -> String<br>
>> f2 :: (Integral a) => String -> a<br>
>><br>
>> pipe = f1 . f2<br>
>> It is clear that pipe is String -> String,<br>
><br>
> Actually, this code will give an "ambiguous type" error, since the<br>
> compiler cannot figure out what type 'a' should be. And the type that<br>
> is chosen may make a difference for the behavior.<br>
><br>
>> but.(1)How can I know what instance that 'a' is.<br>
>> (2)How can I determine what instance of 'a' is.<br>
><br>
> If you know what type you want to use for 'a' you can specify it with<br>
> a type annotation, like this:<br>
><br>
> pipe = f1 . (f2 :: String -> Int)<br>
><br>
> -Brent<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>
><br>
<br>
<br>
<br>
</div></div>--<br>
----------------<br>
<font color="#888888">吴兴博<br>
</font><div><div></div><div class="h5"><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>
</div></div></blockquote></div><br>