{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE StandaloneDeriving #-}

import Data.Data hiding ( Fixity )

data Name    = Name    deriving Data
data Id      = Id      deriving Data
data RdrName = RdrName deriving Data

class Outputable a where
  ppr :: a -> String

instance Outputable Name where
  ppr _ = "Name"

instance Outputable RdrName where
  ppr _ = "RdrName"

type family NameOrRdrName id where
  NameOrRdrName Id      = Name
  NameOrRdrName Name    = Name
  NameOrRdrName RdrName = RdrName


deriving instance Data (NameOrRdrName id)

instance Outputable (NameOrRdrName id) where
  ppr = undefined -- what should this be?

