termination for FDs and ATs

Ross Paterson ross at soi.city.ac.uk
Mon Apr 24 07:44:28 EDT 2006

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

More information about the Haskell-prime mailing list