Changes between Version 14 and Version 15 of NewtypeWrappers
- Jul 27, 2013 10:24:18 AM (19 months ago)
v14 v15 151 151 * Check for constructor visibility. ✓ 152 152 * Check for data constructor argument convertibility. ✓ (but not very elegant yet) 153 153 154 * Think about higher-order type arguments. 154 155 * Polish error messages. … … 159 160 160 161 * The deriving code works in the typechecker and has to generate `HsExpr`, but the implementation is only possible in Core. Currently, a dummy value is inserted by the deriving code and later implemented by a core-to-core pass. Better solution: Add a `HsCore` data constructor to `HsExpr`, similar to `HsCoreTy` in `HsType`? 161 * The overlapping nature of the problem. We clearly want to have a base case `IsNT a a` so that `castNT :: (Int,a) -> (Age, a)` is possible. For that we need all instances of `IsNT` to have the incoherent flag set (✓). But that is not enough: `castNT :: (Int,[a]) -> (Age, [a])` does not work (overlapping matching instances `IsNT a a` and `IsNT [a] [a]`), while (counterintuitively) `(castNT :: (Int,a) -> (Age, a)) :: (Int,[a]) -> (Age, [a])` works again. Possible solutions: 162 * Change the semantics of `IncoherentInstances` that it chooses an arbitrary, or the most specific, or the most general instance here. 163 * Add a flag to classes that marks them as “univalent”, telling the type checker that any instance is good and overlap should not hinder him 164 162 165 163 Code not yet pushed anywhere.