[Haskell-beginners] Re: Classes in Polymorphic Constructors

John Smith voldermort at hotmail.com
Mon Aug 23 12:12:36 EDT 2010

On 23/08/2010 18:32, Ertugrul Soeylemez wrote:
> John Smith<voldermort at hotmail.com>  wrote:
>> Why can polymorphic data constructors not be instantiated as a class?
>> (not sure if I used the right terminology there)
>> For example,
>> a = [1,True]::[Show]
>> b = "foo":a
>> c = map show b
>> This would obviate the need for wrapper types
> Your type signature doesn't make sense.  You are confusing type classes
> with types.  Show is a type class.

My question was why doesn't the type system allow classes to be used in this way. It's the equivalent of a base class or 
interface in OO.

More information about the Beginners mailing list