{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module TextShow.Control.Applicative.Trans () where
import Control.Applicative.Backwards (Backwards(..))
import Control.Applicative.Lift (Lift(..))
import TextShow (TextShow(..), TextShow1(..),
showbPrec1, showbUnaryWith)
import TextShow.Utils (liftShowbUnaryWith)
instance (TextShow1 f, TextShow a) => TextShow (Backwards f a) where
showbPrec = showbPrec1
{-# INLINE showbPrec #-}
instance TextShow1 f => TextShow1 (Backwards f) where
liftShowbPrec sp sl p (Backwards x) = liftShowbUnaryWith sp sl "Backwards" p x
{-# INLINE liftShowbPrec #-}
instance (TextShow1 f, TextShow a) => TextShow (Lift f a) where
showbPrec = showbPrec1
{-# INLINE showbPrec #-}
instance TextShow1 f => TextShow1 (Lift f) where
liftShowbPrec sp _ p (Pure x) = showbUnaryWith sp "Pure" p x
liftShowbPrec sp sl p (Other y) = showbUnaryWith (liftShowbPrec sp sl) "Other" p y
{-# INLINE liftShowbPrec #-}