Am Sonntag, 7. August 2005 20:40 schrieb Lemmih: > [...] > > second one: > > is it possible to write something like > > type Point = (Float, Float) > > type Vector = (Float, Float) > > and still have type safety (i.e. not be able to mix Point and Vector) > > (and still have (*,*) without constructor)? > > No, that's not possible.
Note that while newtype declared types use some kind of data constructor, internally the newtype declared type is normally represented the same way as the "encapsulated" type. So newtype normally doesn't introduce any overhead concerning execution time and space but, of course, it introduces overhead concerning typing. :-) Best regards, Wolfgang _______________________________________________ Haskell mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell
