-- | Create a type synonym 'TyCon'
mkSynonymTyCon :: Name -> Kind -> [TyVar] -> [Role] -> Type -> TyCon
mkSynonymTyCon name kind tyvars roles rhs
  = SynonymTyCon {
        tyConName   = name,
        tyConUnique = nameUnique name,
        tyConKind   = kind,
        tyConArity  = length tyvars,
        tyConTyVars = tyvars,
        tcRoles     = roles,
        synTcRhs    = rhs
    }
mkSynonymTyCon :: Name -> Kind -> [TyVar] -> [Role] -> Type -> TyCon
mkSynonymTyCon name kind tyvars roles rhs
  = SynonymTyCon {
        tyConName   = name,
        tyConUnique = nameUnique name,
        tyConKind   = kind,
        tyConArity  = length tyvars,
        tyConTyVars = tyvars,
        tcRoles     = roles,
        synTcRhs    = rhs
    }
mkSynonymTyCon name kind tyvars roles rhs
  = SynonymTyCon {
        tyConName   = name,
        tyConUnique = nameUnique name,
        tyConKind   = kind,
        tyConArity  = length tyvars,
        tyConTyVars = tyvars,
        tcRoles     = roles,
        synTcRhs    = rhs
    }