...there is no reason you can't have type classes for the experienced and a simplified syntax for the new that looks and mostly behaves like what they are used to its quite amazing how much a single element type class behaves like an interface.... An interface is merely a type class declaration, typically (but not inherently) one with one variable. The only thing interesting about the interface approach is that the "implements" clause gives an obviously preferred instance. Yes a one variable type class does appear to be an interface but im not really talking about the interface / type class definition these can remain as they are but the use of such a type class in functions eg like Java , C++ etc you specify the type class as a type. The compiler converts it and it looks to the user like an interface and has nearly all its properties the only conditions is - Member functions must be supported - Multiple parameter type classes don't make sense as a function parameter. Users are likely to approach the use of Bitc first using the libs so use pre-existing defined type class , after a bit of experience they will write their own now a single parameter type class is pretty straight forward and like an interface . Note member functions fit in perfectly here. What you don't typically get in an interface-oriented approach is the ability to do post-hoc interface membership, which is the place where all of the resolution confusion of type class instances is biting us. Agree ( and you get the vtable indirection) but you can fully use type classes. I don't think simple type classes definitions will be hard for people to pick up ( though they should be isolated from the more complex ones multi parameter type class with constraints can get hairy -going by whats in the spec) . I do think having where clauses on types used in function is much harder because when you use the where clause , it shows the type system is very different ( with strong inference and the creation of types as needed ) . This is made worse by member functions but it is not needed to expose this to the B programmer that begins to use BitC. Anyone who has been involved in an organization where VB6 9-5 programmers had to learn VB.NET will know it's important to make it look simple at first even if there is complexity. Ben
_______________________________________________ bitc-dev mailing list [email protected] http://www.coyotos.org/mailman/listinfo/bitc-dev
