{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PolyKinds #-}
{-# OPTIONS -Wno-orphans #-}
module TextShow.Data.Tagged () where
import Data.Tagged (Tagged(..))
import TextShow (TextShow(..), TextShow1(..), TextShow2(..),
Builder, showbPrec1, showbUnaryWith)
liftShowbTaggedPrec :: (Int -> b -> Builder) -> Int -> Tagged s b -> Builder
liftShowbTaggedPrec :: forall {k} b (s :: k).
(Int -> b -> Builder) -> Int -> Tagged s b -> Builder
liftShowbTaggedPrec Int -> b -> Builder
sp Int
p (Tagged b
b) = (Int -> b -> Builder) -> Builder -> Int -> b -> Builder
forall a. (Int -> a -> Builder) -> Builder -> Int -> a -> Builder
showbUnaryWith Int -> b -> Builder
sp Builder
"Tagged" Int
p b
b
{-# INLINE liftShowbTaggedPrec #-}
instance TextShow b => TextShow (Tagged s b) where
showbPrec :: Int -> Tagged s b -> Builder
showbPrec = Int -> Tagged s b -> Builder
forall (f :: * -> *) a.
(TextShow1 f, TextShow a) =>
Int -> f a -> Builder
showbPrec1
{-# INLINE showbPrec #-}
instance TextShow1 (Tagged s) where
liftShowbPrec :: forall a.
(Int -> a -> Builder)
-> ([a] -> Builder) -> Int -> Tagged s a -> Builder
liftShowbPrec Int -> a -> Builder
sp [a] -> Builder
_ = (Int -> a -> Builder) -> Int -> Tagged s a -> Builder
forall {k} b (s :: k).
(Int -> b -> Builder) -> Int -> Tagged s b -> Builder
liftShowbTaggedPrec Int -> a -> Builder
sp
{-# INLINE liftShowbPrec #-}
instance TextShow2 Tagged where
liftShowbPrec2 :: forall a b.
(Int -> a -> Builder)
-> ([a] -> Builder)
-> (Int -> b -> Builder)
-> ([b] -> Builder)
-> Int
-> Tagged a b
-> Builder
liftShowbPrec2 Int -> a -> Builder
_ [a] -> Builder
_ Int -> b -> Builder
sp [b] -> Builder
_ = (Int -> b -> Builder) -> Int -> Tagged a b -> Builder
forall {k} b (s :: k).
(Int -> b -> Builder) -> Int -> Tagged s b -> Builder
liftShowbTaggedPrec Int -> b -> Builder
sp
{-# INLINE liftShowbPrec2 #-}