<div dir="ltr"><div><div><div><div><div><div><div><div>I am working on <a href="https://ghc.haskell.org/trac/ghc/ticket/12105" target="_blank">https://ghc.haskell.org/trac/ghc/ticket/12105</a>, and have a type to ensure that the `HsMatchContext` has either a `RdrName` or a `Name`, not an `Id`.<br><br>type family NameOrRdrName id where<br>  NameOrRdrName Id      = Name<br>  NameOrRdrName Name    = Name<br>  NameOrRdrName RdrName = RdrName<br><br></div>Is there any way to declare `Data` and `OutputableBndr` instances for this?<br><br></div>Without it I am having to do something like<br><br>instance (OutputableBndr name, OutputableBndr (NameOrRdrName name))<br>         => Outputable (HsDecl name) where<br><br></div>which requires UndecidableInstances.<br><br></div>I get<br><br>compiler/hsSyn/PlaceHolder.hs:114:19:<br>    Illegal type synonym family application in instance:<br>      NameOrRdrName id<br>    In the stand-alone deriving instance for ‘Data (NameOrRdrName id)’<br><br></div>for the parameterised version and<br><br>compiler/hsSyn/PlaceHolder.hs:115:19:<br>    Illegal type synonym family application in instance:<br>      NameOrRdrName RdrName<br>    In the stand-alone deriving instance for<br>      ‘Data (NameOrRdrName RdrName)’<br><br></div>for the one specific to `RdrName`.<br><br></div>Regards<br></div>  Alan<br></div>