{-# LANGUAGE GADTs #-}
module What4.Utils.OnlyNatRepr
( OnlyNatRepr(..)
, toBaseTypeRepr
) where
import Data.Hashable (Hashable(..))
import Data.Parameterized.Classes (HashableF(..))
import What4.BaseTypes
data OnlyNatRepr tp
= (tp ~ BaseNatType) => OnlyNatRepr
instance TestEquality OnlyNatRepr where
testEquality OnlyNatRepr OnlyNatRepr = Just Refl
instance Hashable (OnlyNatRepr tp) where
hashWithSalt s OnlyNatRepr = s
instance HashableF OnlyNatRepr where
hashWithSaltF = hashWithSalt
toBaseTypeRepr :: OnlyNatRepr tp -> BaseTypeRepr tp
toBaseTypeRepr OnlyNatRepr = BaseNatRepr