    {-# LANGUAGE OverloadedStrings #-}
    {-# LANGUAGE TemplateHaskell #-}
    {-# OPTIONS_GHC -fno-warn-orphans #-}
    {-|
    Module:      TextShow.Data.Ord
    Copyright:   (C) 2014-2017 Ryan Scott
    License:     BSD-style (see the file LICENSE)
    Maintainer:  Ryan Scott
    Stability:   Provisional
    Portability: GHC

    'TextShow' instances for 'Ordering' and 'Down'.

    /Since: 2/
    -}
    module TextShow.Data.Ord () where

    import GHC.Exts (Down(..))

    import TextShow.Classes ( TextShow(..), TextShow1(..)
                            , showbPrec1, showbUnaryWith )
    import TextShow.TH.Internal (deriveTextShow)

    -- | This instance would be equivalent to a derived 'TextShow' instance
    -- if the 'getDown' field were removed.
    --
    -- /Since: 2/
    instance TextShow a => TextShow (Down a) where
        showbPrec :: Int -> Down a -> Builder
    showbPrec = Int -> Down a -> Builder
    forall (f :: * -> *) a.
    (TextShow1 f, TextShow a) =>
    Int -> f a -> Builder
    showbPrec1
        {-# INLINE showbPrec #-}

    -- | This instance would be equivalent to a derived 'TextShow1' instance
    -- if the 'getDown' field were removed.
    --
    -- /Since: 2/
    instance TextShow1 Down where
        liftShowbPrec :: (Int -> a -> Builder)
    -> ([a] -> Builder) -> Int -> Down a -> Builder
    liftShowbPrec sp :: Int -> a -> Builder
    sp _ p :: Int
    p (Down x :: a
    x) = (Int -> a -> Builder) -> Builder -> Int -> a -> Builder
    forall a. (Int -> a -> Builder) -> Builder -> Int -> a -> Builder
    showbUnaryWith Int -> a -> Builder
    sp "Down" Int
    p a
    x
        {-# INLINE liftShowbPrec #-}

    -- | /Since: 2/
    $(deriveTextShow ''Ordering)