module Data.TypeLevel.Num.Reps (
D0, D1, D2, D3, D4, D5, D6, D7, D8, D9,
(:*)(..),
) where
import Data.Typeable (Typeable)
import Language.Haskell.TH.Syntax (Lift(..))
data D0 deriving Typeable
instance Show D0 where show _ = "0"
instance Lift D0 where lift _ = [| undefined :: D0 |]
data D1 deriving Typeable
instance Show D1 where show _ = "1"
instance Lift D1 where lift _ = [| undefined :: D1 |]
data D2 deriving Typeable
instance Show D2 where show _ = "2"
instance Lift D2 where lift _ = [| undefined :: D2 |]
data D3 deriving Typeable
instance Show D3 where show _ = "3"
instance Lift D3 where lift _ = [| undefined :: D3 |]
data D4 deriving Typeable
instance Show D4 where show _ = "4"
instance Lift D4 where lift _ = [| undefined :: D4 |]
data D5 deriving Typeable
instance Show D5 where show _ = "5"
instance Lift D5 where lift _ = [| undefined :: D5 |]
data D6 deriving Typeable
instance Lift D6 where lift _ = [| undefined :: D6 |]
instance Show D6 where show _ = "6"
data D7 deriving Typeable
instance Show D7 where show _ = "7"
instance Lift D7 where lift _ = [| undefined :: D7 |]
data D8 deriving Typeable
instance Show D8 where show _ = "8"
instance Lift D8 where lift _ = [| undefined :: D8 |]
data D9 deriving Typeable
instance Show D9 where show _ = "9"
instance Lift D9 where lift _ = [| undefined :: D9 |]
data a :* b = a :* b deriving Typeable
instance (Show a, Show b) => Show (a :* b) where
show _ = (show (undefined :: a)) ++ (show (undefined :: b))
instance (Lift a, Lift b) => Lift (a :* b) where
lift _ = [| $(lift (undefined ::a)) :* $(lift (undefined :: b) ) |]