
On 12/6/06, Iavor Diatchki
Hello,
another option (perhaps too draconian?) would be to disallow user-defined instances for Ix, and to ensure that the predefined instances satisfy the required laws. We can do this in one of the following ways: * Do not export 'Ix': not good because we cannot write type signatures * Export 'Ix' but not its methods: ensures that programmers can define only trivial (i.e. undefined) instances. * Add a super class to 'Ix' (e.g., 'PrivateIx') which is not exported. This would disallow user-defined instances because they can never satisfy the 'PrivateIx' constraint.
We could put one of these things in e.g. Data.Ix.IAmNotAnIdiot, so that users can define instances of Ix if they need to, but not without being warned that this might be dangerous, and that it is usually possible to just use derived one. (Such warnings would appear in the documentation of this module.)