{-# LANGUAGE UndecidableInstances #-}

module Data.Text.Extended.Pretty (
    Pretty(..)
  ) where

import           Data.Text ( Text )
import qualified Data.Text as Text

----------------------------------------------------------------------

class Pretty a where
  pretty :: a -> Text

instance {-# OVERLAPPABLE #-} (Show a) => Pretty a where
  pretty :: a -> Text
pretty = String -> Text
Text.pack (String -> Text) -> (a -> String) -> a -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> String
forall a. Show a => a -> String
show