Changes between Version 59 and Version 60 of TypeFunctions
- Oct 23, 2006 8:07:49 PM (9 years ago)
v59 v60 35 35 * All argument variables of an associated type family declaration need to be class parameters. There may not be any repetitions, but the order of the variables can differ from that in the class head and the type family can be defined over a subset of the class parameters. 36 36 * In instances, the type indexes of a type declaration must be identical to the corresponding class parameters (i.e., those that share the same variable name in the class declaration). And all arguments that where not connected to a class parameter in the family declaration must be variables; i.e., cannot be used as type indexes. 37 * In an export and import list we currently cannot explicitly list ATs in brackets after the class name (as all upper case names in such brackets are read as data constructors, not type constructors). 37 * In an export and import list, associated types are treated as subcomponents of their type class, just like the class methods. In particular, `C(..)` denotes class `C` with all its methods and all its associated types. If the associated types of a class are explicitly listed in the parenthesis, each type name needs to be prefixed with the keyword `type`; i.e., to denote class `C` with associated type `T` and method `foo`, we write `C(type T, foo)`. 38 * In export and import lists, all data constructors of newtype and data families defined in any newtype or data instance is regarded to be a subcomponent of the family type constructor, and hence specified by `F(..)` if `F` is the family type constructor. Instead of specifying them all with "`..`", they can also be explicitly listed, just as with vanilla data types. 38 39 * Instances of indexed data and new types may not overlap (as such instances correspond to indeterminate type functions). Type equations may only overlap if the equations coincide at critical pairs. (Rational: We cannot be more lazy about checking overlap, as we otherwise cannot guarantee that we generate an F,,C,, program that fulfils the formal consistency criterion.) 39 40 * To enable indexed type families, the switch `-findexed-types` needs to be used (which is implied by `-fglasgow-exts`).