# LANGUAGE TypeFamilies #
{-# LANGUAGE TypeInType #-}
# LANGUAGE TypeOperators #
{-# LANGUAGE GADTs #-}
# LANGUAGE StandaloneDeriving #

module ThoralfPlugin.Variables where


import Var ( TyVar, Var, isTcTyVar )
import TcType ( isMetaTyVar )

data VarCat = Tau | Skol | Irr
  deriving Eq

categorizeVar :: Var -> VarCat
categorizeVar var =
  if isTcTyVar var
  then
    if isMetaTyVar var
    then Tau
    else Skol
  else Irr

isSkolemVar :: Var -> Bool
isSkolemVar v = categorizeVar v == Skol

isTauVar :: TyVar -> Bool
isTauVar v = categorizeVar v == Tau


# LANGUAGE TypeInType #
# LANGUAGE GADTs #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
# LANGUAGE StandaloneDeriving #

module ThoralfPlugin.Variables where


import Var ( TyVar, Var, isTcTyVar )
import TcType ( isMetaTyVar )

data VarCat = Tau | Skol | Irr
  deriving Eq

categorizeVar :: Var -> VarCat
categorizeVar var =
  if isTcTyVar var
  then
    if isMetaTyVar var
    then Tau
    else Skol
  else Irr

isSkolemVar :: Var -> Bool
isSkolemVar v = categorizeVar v == Skol

isTauVar :: TyVar -> Bool
isTauVar v = categorizeVar v == Tau

