-- | $(hexT n) returns the appropriate THex instance
hexT :: Integral a => a -> Type
hexT n = case n of
    0  -> ConT f
    -1 -> ConT t
    n  -> AppT (x !! mod (fromIntegral n) 16) $ hexT $ n `div` 16

-- | $(hexE n) returns an undefined value of the appropriate THex instance
hexT :: Integral a => a -> Type
hexT n = case n of
    0  -> ConT f
    -1 -> ConT t
    n  -> AppT (x !! mod (fromIntegral n) 16) $ hexT $ n `div` 16

-- | $(hexE n) returns an undefined value of the appropriate THex instance
hexT n = case n of
    0  -> ConT f
    -1 -> ConT t
    n  -> AppT (x !! mod (fromIntegral n) 16) $ hexT $ n `div` 16

-- | $(hexE n) returns an undefined value of the appropriate THex instance