--------------------------------------------------------------------------------

convertLHsTyVarBndrs :: LocalConvMonad r m => Explicitness -> [LHsTyVarBndr GhcRn] -> m [Binder]
convertLHsTyVarBndrs ex tvs = for (map unLoc tvs) $ \case
  UserTyVar   NOEXTP tv   -> mkBinder ex . Ident <$> var TypeNS (unLoc tv)
  KindedTyVar NOEXTP tv k -> mkBinders ex <$> (pure . Ident <$> var TypeNS (unLoc tv)) <*> convertLType k
#if __GLASGOW_HASKELL__ >= 806
  XTyVarBndr v -> noExtCon v
#endif

--------------------------------------------------------------------------------
convertLHsTyVarBndrs :: LocalConvMonad r m => Explicitness -> [LHsTyVarBndr GhcRn] -> m [Binder]
convertLHsTyVarBndrs ex tvs = for (map unLoc tvs) $ \case
  UserTyVar   NOEXTP tv   -> mkBinder ex . Ident <$> var TypeNS (unLoc tv)
  KindedTyVar NOEXTP tv k -> mkBinders ex <$> (pure . Ident <$> var TypeNS (unLoc tv)) <*> convertLType k
#if __GLASGOW_HASKELL__ >= 806
  XTyVarBndr v -> noExtCon v
#endif

--------------------------------------------------------------------------------
convertLHsTyVarBndrs ex tvs = for (map unLoc tvs) $ \case
  UserTyVar   NOEXTP tv   -> mkBinder ex . Ident <$> var TypeNS (unLoc tv)
  KindedTyVar NOEXTP tv k -> mkBinders ex <$> (pure . Ident <$> var TypeNS (unLoc tv)) <*> convertLType k
#if __GLASGOW_HASKELL__ >= 806
  XTyVarBndr v -> noExtCon v
#endif

--------------------------------------------------------------------------------