{-# 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 :: forall a.
(Int -> a -> Builder)
-> ([a] -> Builder) -> Int -> Identity a -> Builder
liftShowbPrec Int -> a -> Builder
sp [a] -> Builder
_ Int
p (Identity a
x) = (Int -> a -> Builder) -> Builder -> Int -> a -> Builder
forall a. (Int -> a -> Builder) -> Builder -> Int -> a -> Builder
showbUnaryWith Int -> a -> Builder
sp Builder
"Identity" Int
p a
x
{-# INLINE liftShowbPrec #-}