{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE RankNTypes #-}
module Data.RVar.Prim (Prim(..)) where
import Data.Typeable
import Data.Word
import Data.ByteString.Short
data Prim a where
PrimWord8 :: Prim Word8
PrimWord16 :: Prim Word16
PrimWord32 :: Prim Word32
PrimWord64 :: Prim Word64
PrimShortByteString :: !Int -> Prim ShortByteString
deriving (Typeable)
instance Show (Prim a) where
showsPrec :: Int -> Prim a -> ShowS
showsPrec Int
_p Prim a
PrimWord8 = String -> ShowS
showString String
"PrimWord8"
showsPrec Int
_p Prim a
PrimWord16 = String -> ShowS
showString String
"PrimWord16"
showsPrec Int
_p Prim a
PrimWord32 = String -> ShowS
showString String
"PrimWord32"
showsPrec Int
_p Prim a
PrimWord64 = String -> ShowS
showString String
"PrimWord64"
showsPrec Int
p (PrimShortByteString Int
n) =
Bool -> ShowS -> ShowS
showParen (Int
p Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
> Int
10) (String -> ShowS
showString String
"PrimShortByteString " ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> Int -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec Int
11 Int
n)