Haskell overlapping instances and type functions
问题 I have the following typeclass which models a SQL-like query optimization: class OptimizableQuery q where type Optimized q :: * optimize :: q -> Optimized q instance Query q => OptimizableQuery q where type Optimized q = q optimize q = q instance (Query q, OptimizableQuery q) => OptimizableQuery (Select (Select q p) p) where type Optimized (Select (Select q p) p) = Select (Optimized q) p optimize (Select (Select q _) p) = Select (optimize q) p the problem is that I get the error "Conflicting