[Haskell-cafe] Is there anyone out there who can translate C# generics into Haskell?

Bulat Ziganshin bulat.ziganshin at gmail.com
Thu Jan 3 05:54:18 EST 2008


Hello Mark,

Thursday, January 3, 2008, 1:22:26 PM, you wrote:

because they have different models. i recommend you to start from
learning this model, otherwise you will don't understand how Haskell
really works and erroneously apply your OOP knowledge to Haskell data
structures.

shortly said, there are 3 ways to polymorphism:

1) C++ templates - type-specific code generated at compile time
2) OOP classes - every object carries VMT which allows to select
type-specific operation
3) type classes - dictionary of type-specific operations is given as
additional hidden argument to each function

Haskell uses t.c. and its abilities are dictated by this
implementation. there is no simple and direct mapping between
features provided by OOP and t.c.


> Can you give me a summary of why it's meaningless.....both would seem to
> describe/construct values/objects....they may not be equivalent, but I
> would expect some considerable overlap.

> -----Original Message-----
> From: Bulat Ziganshin [mailto:bulat.ziganshin at gmail.com] 
> Sent: 02 January 2008 20:29
> To: Nicholls, Mark
> Cc: haskell-cafe at haskell.org
> Subject: Re: [Haskell-cafe] Is there anyone out there who can translate
> C# generics into Haskell?

> Hello Mark,

> Wednesday, January 2, 2008, 7:40:31 PM, you wrote:

>> I'm trying to translate some standard C# constucts into Haskell...
> some

> it's meaningless. read
> http://haskell.org/haskellwiki/OOP_vs_type_classes
> and especially papers mentioned in the References




-- 
Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com



More information about the Haskell-Cafe mailing list