{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module TextShow.Data.Functor.Identity () where
import Data.Functor.Identity (Identity(..))
import TextShow.Classes (TextShow(..), TextShow1(..),
showbPrec1, showbUnaryWith)
instance TextShow a => TextShow (Identity a) where
showbPrec :: Int -> Identity a -> Builder
showbPrec = Int -> Identity a -> Builder
forall (f :: * -> *) a.
(TextShow1 f, TextShow a) =>
Int -> f a -> Builder
showbPrec1
{-# INLINE showbPrec #-}
instance TextShow1 Identity where
liftShowbPrec :: (Int -> a -> Builder)
-> ([a] -> Builder) -> Int -> Identity a -> Builder
liftShowbPrec sp :: Int -> a -> Builder
sp _ p :: Int
p (Identity x :: a
x) = (Int -> a -> Builder) -> Builder -> Int -> a -> Builder
forall a. (Int -> a -> Builder) -> Builder -> Int -> a -> Builder
showbUnaryWith Int -> a -> Builder
sp "Identity" Int
p a
x
{-# INLINE liftShowbPrec #-}