module TextShow.Control.Applicative.Trans (
showbBackwardsPrecWith
, showbLiftPrecWith
) where
import Control.Applicative.Backwards (Backwards(..))
import Control.Applicative.Lift (Lift(..))
import TextShow (TextShow(showbPrec), TextShow1(..),
Builder, showbPrec1, showbUnaryWith)
#include "inline.h"
showbBackwardsPrecWith :: TextShow1 f
=> (Int -> a -> Builder)
-> Int -> Backwards f a -> Builder
showbBackwardsPrecWith sp p (Backwards x)
= showbUnaryWith (showbPrecWith sp) "Backwards" p x
showbLiftPrecWith :: TextShow1 f
=> (Int -> a -> Builder)
-> Int -> Lift f a -> Builder
showbLiftPrecWith sp p (Pure x) = showbUnaryWith sp "Pure" p x
showbLiftPrecWith sp p (Other y) = showbUnaryWith (showbPrecWith sp) "Other" p y
instance (TextShow1 f, TextShow a) => TextShow (Backwards f a) where
showbPrec = showbPrec1
INLINE_INST_FUN(showbPrec)
instance TextShow1 f => TextShow1 (Backwards f) where
showbPrecWith = showbBackwardsPrecWith
INLINE_INST_FUN(showbPrecWith)
instance (TextShow1 f, TextShow a) => TextShow (Lift f a) where
showbPrec = showbPrec1
INLINE_INST_FUN(showbPrec)
instance TextShow1 f => TextShow1 (Lift f) where
showbPrecWith = showbLiftPrecWith
INLINE_INST_FUN(showbPrecWith)