Panic mixing RULES and Type Families
It appears that RULES pragmas and type families don't always play nice.
When either of the last two RULES is present, you get an error analogous to the following. Attempting to supply a manual type annotation did not help.
Attached is a simplified test case.
[1 of 1] Compiling Small ( Small.hs, interpreted )
ghc-6.9.20080401: panic! (the 'impossible' happened)
(GHC version 6.9.20080401 for i386-unknown-linux):
tcSimplifyRuleLhs
Wanted t_apn{tv} [tau] :: main:Small.Coexp{tc roa}
k{tv apj} [tau] b{tv apm} [tau] c{tv apk} [tau]
~
main:Small.Coexp{tc roa}
k{tv apj} [tau] b{tv apb} [tau] c{tv apc} [tau]
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug