[Haskell-cafe] List as input

Jason Dagit dagit at codersbase.com
Thu Oct 16 22:28:03 EDT 2008


On Thu, Oct 16, 2008 at 7:22 PM, leledumbo <leledumbo_cool at yahoo.co.id>wrote:

>
> > ...  If there isn't enough information to set a concrete type at the
> call,
> type inference fails. This is what you get with strong typing.
>
> In my case, where does type inference fail? Strong typing is good, but
> quite
> confusing when combined with polymorphism.
>
> > It isn't. The type of data in the list must be able to be compared.
>
> Oops, sorry. What I mean by "any" is exactly as what you said: "anything
> than can be compared". Can you tell me an example of list whose elements
> can't be compared (don't include user defined types, please) ?


How about a list of functions from int to int?

Jason
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20081016/4c48e712/attachment.htm


More information about the Haskell-Cafe mailing list