Hi, just a silly question (or maybe more than one):

In Haskell we have data types (Integer,[a],...) as well as type
classes (Num, Ord...).

But, if we have type classes do we still need types?


Why shouldn't the objects that we process be defined only by their
'interfaces' (assuming that a type class is a kind of interface)?


Maybe the real question is: are type classes a more primitive concept
than data types?

And if so, in a language that had only type classes what would a data
declaration like the following map to:

data List a = Cons a (List a) | Nil

And what about pattern matching? Would that still be possible, and
what form would it take?


And finally, would having only type classes make the type system any simpler?


Thanks,

                         titto
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to