{-# LANGUAGE CPP #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
#if __GLASGOW_HASKELL__ >= 706
{-# LANGUAGE PolyKinds #-}
#endif
{-# OPTIONS_GHC -fno-warn-orphans #-}
module TextShow.Control.Applicative () where
import Control.Applicative (Const(..), ZipList)
import Data.Text.Lazy.Builder (Builder)
import TextShow.Classes (TextShow(..), TextShow1(..),
TextShow2(..), showbUnaryWith)
import TextShow.Data.List ()
import TextShow.TH.Internal (deriveTextShow, deriveTextShow1)
instance TextShow a => TextShow (Const a b) where
showbPrec = liftShowbConstPrec showbPrec
instance TextShow a => TextShow1 (Const a) where
liftShowbPrec _ _ = liftShowbConstPrec showbPrec
instance TextShow2 Const where
liftShowbPrec2 sp _ _ _ = liftShowbConstPrec sp
liftShowbConstPrec :: (Int -> a -> Builder) -> Int -> Const a b -> Builder
liftShowbConstPrec sp p (Const x) = showbUnaryWith sp "Const" p x
{-# INLINE liftShowbConstPrec #-}
$(deriveTextShow ''ZipList)
$(deriveTextShow1 ''ZipList)