To ensure termination with FDs, there is a proposed restriction that
an instance that violates the coverage condition must have a trivial
instance improvement rule.  Is the corresponding restriction also
required for ATs, namely that an associated type synonym definition
may only contain another associated type synonym at the outermost
level?  If not, wouldn't the non-terminating example from the FD-CHR
paper (ex. 6, adapted below) also be a problem for ATs?

        class Mul a b where
                type Result a b
                (.*.) :: a -> b -> Result a b

        instance Mul a b => Mul a [b] where
                type Result a b = [Result a b]
                x .*. ys = map (x .*.) ys

        f = \ b x y -> if b then x .*. [y] else y

_______________________________________________
Haskell-prime mailing list
Haskell-prime@haskell.org
http://haskell.org/mailman/listinfo/haskell-prime

Reply via email to