#if __GLASGOW_HASKELL__ >= 706
#endif
module TextShow.Data.Functor.Trans (liftShowbConstantPrec, liftShowbReversePrec) where
import Data.Functor.Constant (Constant(..))
import Data.Functor.Reverse (Reverse(..))
import TextShow (TextShow(..), TextShow1(..), TextShow2(..),
Builder, showbPrec1, showbUnaryWith)
#include "inline.h"
liftShowbConstantPrec :: (Int -> a -> Builder) -> Int -> Constant a b -> Builder
liftShowbConstantPrec sp p (Constant x) = showbUnaryWith sp "Constant" p x
liftShowbReversePrec :: TextShow1 f
=> (Int -> a -> Builder) -> ([a] -> Builder)
-> Int -> Reverse f a -> Builder
liftShowbReversePrec sp sl p (Reverse x) =
showbUnaryWith (liftShowbPrec sp sl) "Reverse" p x
instance TextShow a => TextShow (Constant a b) where
showbPrec = liftShowbConstantPrec showbPrec
INLINE_INST_FUN(showbPrec)
instance TextShow a => TextShow1 (Constant a) where
liftShowbPrec _ _ = liftShowbConstantPrec showbPrec
INLINE_INST_FUN(liftShowbPrec)
instance TextShow2 Constant where
liftShowbPrec2 sp _ _ _ = liftShowbConstantPrec sp
INLINE_INST_FUN(liftShowbPrec2)
instance (TextShow1 f, TextShow a) => TextShow (Reverse f a) where
showbPrec = showbPrec1
INLINE_INST_FUN(showbPrec)
instance TextShow1 f => TextShow1 (Reverse f) where
liftShowbPrec = liftShowbReversePrec
INLINE_INST_FUN(liftShowbPrec)