-- | While the flexible pretty-printing infrastructure is useful when you want it,
-- it's helpful to have an implementation of the default Pretty typeclass that
-- does the default thing.

{-# OPTIONS_GHC -fno-warn-orphans #-}

{-# LANGUAGE TypeOperators        #-}
{-# LANGUAGE UndecidableInstances #-}

module PlutusCore.Core.Instance.Pretty.Default () where

import PlutusPrelude

import PlutusCore.Core.Instance.Pretty.Classic ()
import PlutusCore.Core.Type
import PlutusCore.Name.Unique
import PlutusCore.Pretty.Classic
import PlutusCore.Pretty.PrettyConst

import Universe

instance Pretty TyName where
    pretty :: forall ann. TyName -> Doc ann
pretty = TyName -> Doc ann
forall a ann. PrettyClassic a => a -> Doc ann
prettyClassic

instance Pretty Name where
    pretty :: forall ann. Name -> Doc ann
pretty = Name -> Doc ann
forall a ann. PrettyClassic a => a -> Doc ann
prettyClassic

instance Pretty ann => Pretty (Kind ann) where
    pretty :: forall ann. Kind ann -> Doc ann
pretty = Kind ann -> Doc ann
forall a ann. PrettyClassic a => a -> Doc ann
prettyClassic

instance (PrettyClassic tyname, PrettyParens (SomeTypeIn uni), Pretty ann) =>
            Pretty (Type tyname uni ann) where
    pretty :: forall ann. Type tyname uni ann -> Doc ann
pretty = Type tyname uni ann -> Doc ann
forall a ann. PrettyClassic a => a -> Doc ann
prettyClassic

instance
        ( PrettyClassic tyname
        , PrettyClassic name
        , PrettyUni uni
        , Pretty fun
        , Pretty ann
        ) => Pretty (Term tyname name uni fun ann) where
    pretty :: forall ann. Term tyname name uni fun ann -> Doc ann
pretty = Term tyname name uni fun ann -> Doc ann
forall a ann. PrettyClassic a => a -> Doc ann
prettyClassic

instance
        ( PrettyClassic tyname
        , PrettyClassic name
        , PrettyUni uni
        , Pretty fun
        , Pretty ann
        ) => Pretty (Program tyname name uni fun ann) where
    pretty :: forall ann. Program tyname name uni fun ann -> Doc ann
pretty = Program tyname name uni fun ann -> Doc ann
forall a ann. PrettyClassic a => a -> Doc ann
prettyClassic