
23 Aug
2010
23 Aug
'10
12:12 p.m.
On 23/08/2010 18:32, Ertugrul Soeylemez wrote:
John Smith
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.