{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeFamilies #-}
module PlutusCore.Pretty.ConfigName
( PrettyConfigName (..)
, HasPrettyConfigName (..)
, prettyConfigName
, prettyConfigNameSimple
) where
import Data.Coerce (coerce)
import Text.PrettyBy (HasPrettyDefaults)
import Text.PrettyBy.Fixity (Sole (Sole))
newtype PrettyConfigName = PrettyConfigName
{ PrettyConfigName -> Bool
_pcnShowsUnique :: Bool
}
deriving stock (PrettyConfigName -> PrettyConfigName -> Bool
(PrettyConfigName -> PrettyConfigName -> Bool)
-> (PrettyConfigName -> PrettyConfigName -> Bool)
-> Eq PrettyConfigName
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PrettyConfigName -> PrettyConfigName -> Bool
== :: PrettyConfigName -> PrettyConfigName -> Bool
$c/= :: PrettyConfigName -> PrettyConfigName -> Bool
/= :: PrettyConfigName -> PrettyConfigName -> Bool
Eq, Int -> PrettyConfigName -> ShowS
[PrettyConfigName] -> ShowS
PrettyConfigName -> String
(Int -> PrettyConfigName -> ShowS)
-> (PrettyConfigName -> String)
-> ([PrettyConfigName] -> ShowS)
-> Show PrettyConfigName
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PrettyConfigName -> ShowS
showsPrec :: Int -> PrettyConfigName -> ShowS
$cshow :: PrettyConfigName -> String
show :: PrettyConfigName -> String
$cshowList :: [PrettyConfigName] -> ShowS
showList :: [PrettyConfigName] -> ShowS
Show)
type instance HasPrettyDefaults PrettyConfigName = 'True
class HasPrettyConfigName config where
toPrettyConfigName :: config -> PrettyConfigName
instance HasPrettyConfigName (Sole PrettyConfigName) where
toPrettyConfigName :: Sole PrettyConfigName -> PrettyConfigName
toPrettyConfigName = Sole PrettyConfigName -> PrettyConfigName
forall a b. Coercible a b => a -> b
coerce
prettyConfigName :: PrettyConfigName
prettyConfigName :: PrettyConfigName
prettyConfigName = PrettyConfigName{_pcnShowsUnique :: Bool
_pcnShowsUnique = Bool
True}
prettyConfigNameSimple :: PrettyConfigName
prettyConfigNameSimple :: PrettyConfigName
prettyConfigNameSimple = PrettyConfigName{_pcnShowsUnique :: Bool
_pcnShowsUnique = Bool
False}