module Text.Show.Text.Data.Bifunctor (
showbBiffPrec
, showbBiffPrecWith2
, showbClownPrec
, showbClownPrecWith
, showbFlipPrec
, showbFlipPrecWith2
, showbJoinPrec
, showbJoinPrecWith
, showbJokerPrec
, showbJokerPrecWith
, showbProductPrec
, showbProductPrecWith2
, showbTannenPrec
, showbTannenPrecWith2
, showbWrappedBifunctorPrec
, showbWrappedBifunctorPrecWith2
) where
import Data.Bifunctor.Biff (Biff)
import Data.Bifunctor.Clown (Clown)
import Data.Bifunctor.Flip (Flip)
import Data.Bifunctor.Join (Join(..))
import Data.Bifunctor.Joker (Joker)
import Data.Bifunctor.Product (Product)
import Data.Bifunctor.Tannen (Tannen)
import Data.Bifunctor.Wrapped (WrappedBifunctor)
import Prelude hiding (Show)
import Text.Show.Text (Show(..), Show1(..), Show2(..), Builder)
import Text.Show.Text.TH (deriveShow1, deriveShow2, mkShowbPrec, mkShowbPrecWith)
showbBiffPrec :: Show (p (f a) (g b)) => Int -> Biff p f g a b -> Builder
showbBiffPrec = showbPrec
showbBiffPrecWith2 :: (Show2 p, Show1 f, Show1 g)
=> (Int -> a -> Builder) -> (Int -> b -> Builder)
-> Int -> Biff p f g a b -> Builder
showbBiffPrecWith2 = showbPrecWith2
showbClownPrec :: Show (f a) => Int -> Clown f a b -> Builder
showbClownPrec = showbPrec
showbClownPrecWith :: Show1 f => (Int -> a -> Builder) -> Int -> Clown f a b -> Builder
showbClownPrecWith sp = showbPrecWith2 sp undefined
showbFlipPrec :: Show (p b a) => Int -> Flip p a b -> Builder
showbFlipPrec = showbPrec
showbFlipPrecWith2 :: Show2 p
=> (Int -> a -> Builder) -> (Int -> b -> Builder)
-> Int -> Flip p a b -> Builder
showbFlipPrecWith2 = showbPrecWith2
showbJoinPrec :: Show (p a a) => Int -> Join p a -> Builder
showbJoinPrec = showbPrec
showbJoinPrecWith :: Show2 p => (Int -> a -> Builder) -> Int -> Join p a -> Builder
showbJoinPrecWith sp p = showbPrecWith2 sp sp p . runJoin
showbJokerPrec :: Show (g b) => Int -> Joker g a b -> Builder
showbJokerPrec = showbPrec
showbJokerPrecWith :: Show1 g => (Int -> b -> Builder) -> Int -> Joker g a b -> Builder
showbJokerPrecWith sp = showbPrecWith2 undefined sp
showbProductPrec :: (Show (f a b), Show (g a b)) => Int -> Product f g a b -> Builder
showbProductPrec = showbPrec
showbProductPrecWith2 :: (Show2 f, Show2 g)
=> (Int -> a -> Builder) -> (Int -> b -> Builder)
-> Int -> Product f g a b -> Builder
showbProductPrecWith2 = showbPrecWith2
showbTannenPrec :: Show (f (p a b)) => Int -> Tannen f p a b -> Builder
showbTannenPrec = showbPrec
showbTannenPrecWith2 :: (Show1 f, Show2 p)
=> (Int -> a -> Builder) -> (Int -> b -> Builder)
-> Int -> Tannen f p a b -> Builder
showbTannenPrecWith2 = showbPrecWith2
showbWrappedBifunctorPrec :: Show (p a b) => Int -> WrappedBifunctor p a b -> Builder
showbWrappedBifunctorPrec = showbPrec
showbWrappedBifunctorPrecWith2 :: Show2 p
=> (Int -> a -> Builder) -> (Int -> b -> Builder)
-> Int -> WrappedBifunctor p a b -> Builder
showbWrappedBifunctorPrecWith2 = showbPrecWith2
instance Show (p (f a) (g b)) => Show (Biff p f g a b) where
showbPrec = $(mkShowbPrec ''Biff)
instance (Show2 p, Show1 f, Show1 g, Show a) => Show1 (Biff p f g a) where
showbPrecWith = showbPrecWith2 showbPrec
$(deriveShow2 ''Biff)
instance Show (f a) => Show (Clown f a b) where
showbPrec = $(mkShowbPrec ''Clown)
$(deriveShow1 ''Clown)
$(deriveShow2 ''Clown)
instance Show (p b a) => Show (Flip p a b) where
showbPrec = $(mkShowbPrec ''Flip)
instance (Show2 p, Show a) => Show1 (Flip p a) where
showbPrecWith = showbPrecWith2 showbPrec
$(deriveShow2 ''Flip)
instance Show (p a a) => Show (Join p a) where
showbPrec = $(mkShowbPrec ''Join)
instance Show2 p => Show1 (Join p) where
showbPrecWith = showbJoinPrecWith
instance Show (g b) => Show (Joker g a b) where
showbPrec = $(mkShowbPrec ''Joker)
instance Show1 g => Show1 (Joker g a) where
showbPrecWith = $(mkShowbPrecWith ''Joker)
$(deriveShow2 ''Joker)
instance (Show (f a b), Show (g a b)) => Show (Product f g a b) where
showbPrec = $(mkShowbPrec ''Product)
instance (Show2 f, Show2 g, Show a) => Show1 (Product f g a) where
showbPrecWith = showbPrecWith2 showbPrec
$(deriveShow2 ''Product)
instance Show (f (p a b)) => Show (Tannen f p a b) where
showbPrec = $(mkShowbPrec ''Tannen)
instance (Show1 f, Show2 p, Show a) => Show1 (Tannen f p a) where
showbPrecWith = showbPrecWith2 showbPrec
$(deriveShow2 ''Tannen)
instance Show (p a b) => Show (WrappedBifunctor p a b) where
showbPrec = $(mkShowbPrec ''WrappedBifunctor)
instance (Show2 p, Show a) => Show1 (WrappedBifunctor p a) where
showbPrecWith = showbPrecWith2 showbPrec
$(deriveShow2 ''WrappedBifunctor)