module TextShow.GHC.Generics (
showbU1
, showbPar1PrecWith
, showbRec1Prec
, showbRec1PrecWith
, showbK1PrecWith
, showbM1Prec
, showbM1PrecWith
, showbSumTypePrec
, showbSumTypePrecWith
, showbProductTypePrec
, showbProductTypePrecWith
, showbCompFunctorsPrec
, showbCompFunctorsPrecWith
, showbFixityPrec
, showbAssociativity
, showbArityPrec
) where
import Data.Text.Lazy.Builder (Builder)
import Generics.Deriving.Base (U1(..), Par1, Rec1(..), K1(..),
M1(..), (:+:)(..), (:*:)(..), (:.:)(..),
Fixity, Associativity, Arity)
import TextShow.Classes (TextShow(showb, showbPrec), TextShow1(..), TextShow2(..))
import TextShow.Data.Integral ()
import TextShow.TH.Internal (deriveTextShow, deriveTextShow1, makeShowbPrec,
makeShowbPrecWith, makeShowbPrecWith2)
showbU1 :: U1 p -> Builder
showbU1 = showb
showbPar1PrecWith :: (Int -> p -> Builder) -> Int -> Par1 p -> Builder
showbPar1PrecWith = showbPrecWith
showbRec1Prec :: TextShow (f p) => Int -> Rec1 f p -> Builder
showbRec1Prec = showbPrec
showbRec1PrecWith :: TextShow1 f => (Int -> p -> Builder) -> Int -> Rec1 f p -> Builder
showbRec1PrecWith = showbPrecWith
showbK1PrecWith :: (Int -> c -> Builder) -> Int -> K1 i c p -> Builder
showbK1PrecWith sp = showbPrecWith2 sp undefined
showbM1Prec :: TextShow (f p) => Int -> M1 i c f p -> Builder
showbM1Prec = showbPrec
showbM1PrecWith :: TextShow1 f => (Int -> p -> Builder) -> Int -> M1 i c f p -> Builder
showbM1PrecWith = showbPrecWith
showbSumTypePrec :: (TextShow (f p), TextShow (g p)) => Int -> (f :+: g) p -> Builder
showbSumTypePrec = showbPrec
showbSumTypePrecWith :: (TextShow1 f, TextShow1 g) => (Int -> p -> Builder) -> Int -> (f :+: g) p -> Builder
showbSumTypePrecWith = showbPrecWith
showbProductTypePrec :: (TextShow (f p), TextShow (g p)) => Int -> (f :*: g) p -> Builder
showbProductTypePrec = showbPrec
showbProductTypePrecWith :: (TextShow1 f, TextShow1 g) => (Int -> p -> Builder) -> Int -> (f :*: g) p -> Builder
showbProductTypePrecWith = showbPrecWith
showbCompFunctorsPrec :: TextShow (f (g p)) => Int -> (f :.: g) p -> Builder
showbCompFunctorsPrec = showbPrec
showbCompFunctorsPrecWith :: (TextShow1 f, TextShow1 g) => (Int -> p -> Builder) -> Int -> (f :.: g) p -> Builder
showbCompFunctorsPrecWith = showbPrecWith
showbFixityPrec :: Int -> Fixity -> Builder
showbFixityPrec = showbPrec
showbAssociativity :: Associativity -> Builder
showbAssociativity = showb
showbArityPrec :: Int -> Arity -> Builder
showbArityPrec = showbPrec
instance TextShow (U1 p) where
showbPrec = showbPrecWith undefined
$(deriveTextShow1 ''U1)
$(deriveTextShow ''Par1)
$(deriveTextShow1 ''Par1)
instance TextShow (f p) => TextShow (Rec1 f p) where
showbPrec = $(makeShowbPrec ''Rec1)
$(deriveTextShow1 ''Rec1)
instance TextShow c => TextShow (K1 i c p) where
showbPrec = showbPrecWith undefined
instance TextShow c => TextShow1 (K1 i c) where
showbPrecWith = showbPrecWith2 showbPrec
instance TextShow2 (K1 i) where
showbPrecWith2 = $(makeShowbPrecWith2 ''K1)
instance TextShow (f p) => TextShow (M1 i c f p) where
showbPrec = $(makeShowbPrec ''M1)
instance TextShow1 f => TextShow1 (M1 i c f) where
showbPrecWith = $(makeShowbPrecWith ''M1)
instance (TextShow (f p), TextShow (g p)) => TextShow ((f :+: g) p) where
showbPrec = $(makeShowbPrec ''(:+:))
$(deriveTextShow1 ''(:+:))
instance (TextShow (f p), TextShow (g p)) => TextShow ((f :*: g) p) where
showbPrec = $(makeShowbPrec ''(:*:))
$(deriveTextShow1 ''(:*:))
instance TextShow (f (g p)) => TextShow ((f :.: g) p) where
showbPrec = $(makeShowbPrec ''(:.:))
$(deriveTextShow1 ''(:.:))
$(deriveTextShow ''Fixity)
$(deriveTextShow ''Associativity)
$(deriveTextShow ''Arity)