module ConLike (
ConLike(..)
) where
#include "HsVersions.h"
import DataCon (DataCon)
import PatSyn (PatSyn)
import Outputable
import Unique
import Util
import Name
import Data.Function (on)
import qualified Data.Data as Data
import qualified Data.Typeable
data ConLike = RealDataCon DataCon
| PatSynCon PatSyn
deriving Data.Typeable.Typeable
instance Eq ConLike where
(==) = (==) `on` getUnique
(/=) = (/=) `on` getUnique
instance Ord ConLike where
(<=) = (<=) `on` getUnique
(<) = (<) `on` getUnique
(>=) = (>=) `on` getUnique
(>) = (>) `on` getUnique
compare = compare `on` getUnique
instance Uniquable ConLike where
getUnique (RealDataCon dc) = getUnique dc
getUnique (PatSynCon ps) = getUnique ps
instance NamedThing ConLike where
getName (RealDataCon dc) = getName dc
getName (PatSynCon ps) = getName ps
instance Outputable ConLike where
ppr (RealDataCon dc) = ppr dc
ppr (PatSynCon ps) = ppr ps
instance OutputableBndr ConLike where
pprInfixOcc (RealDataCon dc) = pprInfixOcc dc
pprInfixOcc (PatSynCon ps) = pprInfixOcc ps
pprPrefixOcc (RealDataCon dc) = pprPrefixOcc dc
pprPrefixOcc (PatSynCon ps) = pprPrefixOcc ps
instance Data.Data ConLike where
toConstr _ = abstractConstr "ConLike"
gunfold _ _ = error "gunfold"
dataTypeOf _ = mkNoRepType "ConLike"