cryptol-3.5.0: Cryptol: The Language of Cryptography
Copyright(c) 2013-2016 Galois Inc.
LicenseBSD3
Maintainercryptol@galois.com
Stabilityprovisional
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Cryptol.Utils.PP

Description

 
Synopsis

Documentation

data PPOpts Source #

How to pretty print things when evaluating

Instances

Instances details
Show PPOpts Source # 
Instance details

Defined in Cryptol.Utils.PP

data PPFloatFormat Source #

Constructors

FloatFixed Int PPFloatExp

Use this many significant digis

FloatFrac Int

Show this many digits after floating point

FloatFree PPFloatExp

Use the correct number of digits

Instances

Instances details
Show PPFloatFormat Source # 
Instance details

Defined in Cryptol.Utils.PP

data PPFloatExp Source #

Constructors

ForceExponent

Always show an exponent

AutoExponent

Only show exponent when needed

Instances

Instances details
Show PPFloatExp Source # 
Instance details

Defined in Cryptol.Utils.PP

data FieldOrder Source #

Instances

Instances details
Bounded FieldOrder Source # 
Instance details

Defined in Cryptol.Utils.PP

Enum FieldOrder Source # 
Instance details

Defined in Cryptol.Utils.PP

Read FieldOrder Source # 
Instance details

Defined in Cryptol.Utils.PP

Show FieldOrder Source # 
Instance details

Defined in Cryptol.Utils.PP

Eq FieldOrder Source # 
Instance details

Defined in Cryptol.Utils.PP

Ord FieldOrder Source # 
Instance details

Defined in Cryptol.Utils.PP

data NameDisp Source #

How to display names, inspired by the GHC Outputable module. Getting a value of Nothing from the NameDisp function indicates that the display has no opinion on how this name should be displayed, and some other display should be tried out.

Instances

Instances details
Monoid NameDisp Source # 
Instance details

Defined in Cryptol.Utils.PP

Semigroup NameDisp Source # 
Instance details

Defined in Cryptol.Utils.PP

Generic NameDisp Source # 
Instance details

Defined in Cryptol.Utils.PP

Associated Types

type Rep NameDisp 
Instance details

Defined in Cryptol.Utils.PP

type Rep NameDisp = D1 ('MetaData "NameDisp" "Cryptol.Utils.PP" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (C1 ('MetaCons "EmptyNameDisp" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "NameDisp" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (OrigName -> Maybe NameFormat))))

Methods

from :: NameDisp -> Rep NameDisp x #

to :: Rep NameDisp x -> NameDisp #

Show NameDisp Source # 
Instance details

Defined in Cryptol.Utils.PP

NFData NameDisp Source # 
Instance details

Defined in Cryptol.Utils.PP

Methods

rnf :: NameDisp -> () #

type Rep NameDisp Source # 
Instance details

Defined in Cryptol.Utils.PP

type Rep NameDisp = D1 ('MetaData "NameDisp" "Cryptol.Utils.PP" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'False) (C1 ('MetaCons "EmptyNameDisp" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "NameDisp" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (OrigName -> Maybe NameFormat))))

data NameFormat Source #

Instances

Instances details
Show NameFormat Source # 
Instance details

Defined in Cryptol.Utils.PP

neverQualifyMod :: ModPath -> NameDisp Source #

Never qualify names from this module.

extend :: NameDisp -> NameDisp -> NameDisp Source #

Compose two naming environments, preferring names from the left environment.

getNameFormat :: OrigName -> NameDisp -> NameFormat Source #

Get the format for a name.

withNameDisp :: (NameDisp -> Doc) -> Doc Source #

Produce a document in the context of the current NameDisp.

withPPCfg :: (PPCfg -> Doc) -> Doc Source #

Produce a document in the context of the current configuration.

fixNameDisp :: NameDisp -> Doc -> Doc Source #

Fix the way that names are displayed inside of a doc.

fixPPCfg :: PPCfg -> Doc -> Doc Source #

Fix the way that names are displayed inside of a doc.

data PPAnnot Source #

A type for annotations we can use during pretty printing

Constructors

AnnError 

data AnnotStyle Source #

How to render annotations

newtype Doc Source #

Constructors

Doc (PPCfg -> PPDoc) 

Instances

Instances details
IsString Doc Source # 
Instance details

Defined in Cryptol.Utils.PP

Methods

fromString :: String -> Doc #

Monoid Doc Source # 
Instance details

Defined in Cryptol.Utils.PP

Methods

mempty :: Doc #

mappend :: Doc -> Doc -> Doc #

mconcat :: [Doc] -> Doc #

Semigroup Doc Source # 
Instance details

Defined in Cryptol.Utils.PP

Methods

(<>) :: Doc -> Doc -> Doc #

sconcat :: NonEmpty Doc -> Doc #

stimes :: Integral b => b -> Doc -> Doc #

Generic Doc Source # 
Instance details

Defined in Cryptol.Utils.PP

Associated Types

type Rep Doc 
Instance details

Defined in Cryptol.Utils.PP

type Rep Doc = D1 ('MetaData "Doc" "Cryptol.Utils.PP" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'True) (C1 ('MetaCons "Doc" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (PPCfg -> PPDoc))))

Methods

from :: Doc -> Rep Doc x #

to :: Rep Doc x -> Doc #

Show Doc Source # 
Instance details

Defined in Cryptol.Utils.PP

Methods

showsPrec :: Int -> Doc -> ShowS #

show :: Doc -> String #

showList :: [Doc] -> ShowS #

NFData Doc Source # 
Instance details

Defined in Cryptol.Utils.PP

Methods

rnf :: Doc -> () #

type Rep Doc Source # 
Instance details

Defined in Cryptol.Utils.PP

type Rep Doc = D1 ('MetaData "Doc" "Cryptol.Utils.PP" "cryptol-3.5.0-HoSGjqdyafy4TMoEJgOBMg" 'True) (C1 ('MetaCons "Doc" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (PPCfg -> PPDoc))))

class PP a where Source #

Minimal complete definition

ppPrec

Methods

ppPrec :: Int -> a -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> a -> Doc Source #

Pretty print something, annotating subterms as needed. | Pretty print something, annotating subterms as needed. The [Int] is supposed to indicate a path through the term in some type specific way.

Instances

Instances details
PP EvalError Source # 
Instance details

Defined in Cryptol.Backend.Monad

PP EvalErrorEx Source # 
Instance details

Defined in Cryptol.Backend.Monad

PP ImportErrorMessage Source # 
Instance details

Defined in Cryptol.Backend.Monad

PP ImportThing Source # 
Instance details

Defined in Cryptol.Backend.Monad

PP Unsupported Source # 
Instance details

Defined in Cryptol.Backend.Monad

PP WordTooWide Source # 
Instance details

Defined in Cryptol.Backend.Monad

PP FFILoadError Source # 
Instance details

Defined in Cryptol.Eval.FFI.Error

PP TValue Source # 
Instance details

Defined in Cryptol.Eval.Type

Methods

ppPrec :: Int -> TValue -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> TValue -> Doc Source #

PP ModulePath Source # 
Instance details

Defined in Cryptol.ModuleSystem.Env

PP ImportSource Source # 
Instance details

Defined in Cryptol.ModuleSystem.Monad

PP ModuleError Source # 
Instance details

Defined in Cryptol.ModuleSystem.Monad

PP ModuleWarning Source # 
Instance details

Defined in Cryptol.ModuleSystem.Monad

PP Name Source # 
Instance details

Defined in Cryptol.ModuleSystem.Name

Methods

ppPrec :: Int -> Name -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> Name -> Doc Source #

PP NamingEnv Source # 
Instance details

Defined in Cryptol.ModuleSystem.NamingEnv.Types

PP RenamedModule Source # 
Instance details

Defined in Cryptol.ModuleSystem.Renamer

PP DepName Source # 
Instance details

Defined in Cryptol.ModuleSystem.Renamer.Error

PP ModKind Source # 
Instance details

Defined in Cryptol.ModuleSystem.Renamer.Error

PP RenamerError Source # 
Instance details

Defined in Cryptol.ModuleSystem.Renamer.Error

PP RenamerWarning Source # 
Instance details

Defined in Cryptol.ModuleSystem.Renamer.Error

PP ForeignMode Source # 
Instance details

Defined in Cryptol.Parser.AST

PP ImportSpec Source # 
Instance details

Defined in Cryptol.Parser.AST

PP Kind Source # 
Instance details

Defined in Cryptol.Parser.AST

Methods

ppPrec :: Int -> Kind -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> Kind -> Doc Source #

PP Literal Source # 
Instance details

Defined in Cryptol.Parser.AST

PP Pragma Source # 
Instance details

Defined in Cryptol.Parser.AST

Methods

ppPrec :: Int -> Pragma -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> Pragma -> Doc Source #

PP UpdHow Source # 
Instance details

Defined in Cryptol.Parser.AST

Methods

ppPrec :: Int -> UpdHow -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> UpdHow -> Doc Source #

PP Error Source # 
Instance details

Defined in Cryptol.Parser.ExpandPropGuards

Methods

ppPrec :: Int -> Error -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> Error -> Doc Source #

PP PName Source # 
Instance details

Defined in Cryptol.Parser.Name

Methods

ppPrec :: Int -> PName -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> PName -> Doc Source #

PP Error Source # 
Instance details

Defined in Cryptol.Parser.NoPat

Methods

ppPrec :: Int -> Error -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> Error -> Doc Source #

PP Position Source # 
Instance details

Defined in Cryptol.Parser.Position

PP Range Source # 
Instance details

Defined in Cryptol.Parser.Position

Methods

ppPrec :: Int -> Range -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> Range -> Doc Source #

PP Selector Source # 
Instance details

Defined in Cryptol.Parser.Selector

PP Token Source # 
Instance details

Defined in Cryptol.Parser.Token

Methods

ppPrec :: Int -> Token -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> Token -> Doc Source #

PP ConfigLoadError Source # 
Instance details

Defined in Cryptol.Project.Config

PP REPLException Source # 
Instance details

Defined in Cryptol.REPL.Monad

PP Smoke Source # 
Instance details

Defined in Cryptol.REPL.Monad

Methods

ppPrec :: Int -> Smoke -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> Smoke -> Doc Source #

PP CaseAlt Source # 
Instance details

Defined in Cryptol.TypeCheck.AST

PP Decl Source # 
Instance details

Defined in Cryptol.TypeCheck.AST

Methods

ppPrec :: Int -> Decl -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> Decl -> Doc Source #

PP DeclGroup Source # 
Instance details

Defined in Cryptol.TypeCheck.AST

PP Expr Source # 
Instance details

Defined in Cryptol.TypeCheck.AST

Methods

ppPrec :: Int -> Expr -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> Expr -> Doc Source #

PP Match Source # 
Instance details

Defined in Cryptol.TypeCheck.AST

Methods

ppPrec :: Int -> Match -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> Match -> Doc Source #

PP TCTopEntity Source # 
Instance details

Defined in Cryptol.TypeCheck.AST

PP DocFor Source # 
Instance details

Defined in Cryptol.TypeCheck.Docstrings

Methods

ppPrec :: Int -> DocFor -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> DocFor -> Doc Source #

PP Error Source # 
Instance details

Defined in Cryptol.TypeCheck.Error

Methods

ppPrec :: Int -> Error -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> Error -> Doc Source #

PP Warning Source # 
Instance details

Defined in Cryptol.TypeCheck.Error

PP ConstraintSource Source # 
Instance details

Defined in Cryptol.TypeCheck.InferTypes

PP DerivingConstraintSource Source # 
Instance details

Defined in Cryptol.TypeCheck.InferTypes

PP Error Source # 
Instance details

Defined in Cryptol.TypeCheck.Sanity

Methods

ppPrec :: Int -> Error -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> Error -> Doc Source #

PP Solved Source # 
Instance details

Defined in Cryptol.TypeCheck.Solver.Types

Methods

ppPrec :: Int -> Solved -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> Solved -> Doc Source #

PP Subst Source # 
Instance details

Defined in Cryptol.TypeCheck.Subst.Type

Methods

ppPrec :: Int -> Subst -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> Subst -> Doc Source #

PP Kind Source # 
Instance details

Defined in Cryptol.TypeCheck.TCon

Methods

ppPrec :: Int -> Kind -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> Kind -> Doc Source #

PP PC Source # 
Instance details

Defined in Cryptol.TypeCheck.TCon

Methods

ppPrec :: Int -> PC -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> PC -> Doc Source #

PP TC Source # 
Instance details

Defined in Cryptol.TypeCheck.TCon

Methods

ppPrec :: Int -> TC -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> TC -> Doc Source #

PP TCon Source # 
Instance details

Defined in Cryptol.TypeCheck.TCon

Methods

ppPrec :: Int -> TCon -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> TCon -> Doc Source #

PP TFun Source # 
Instance details

Defined in Cryptol.TypeCheck.TCon

Methods

ppPrec :: Int -> TFun -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> TFun -> Doc Source #

PP ArgDescr Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

PP ModParamNames Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

PP ModTParam Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

PP ModVParam Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

PP NominalType Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

PP Schema Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

ppPrec :: Int -> Schema -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> Schema -> Doc Source #

PP TParam Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

ppPrec :: Int -> TParam -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> TParam -> Doc Source #

PP TVar Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

ppPrec :: Int -> TVar -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> TVar -> Doc Source #

PP TVarInfo Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

PP TySyn Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

ppPrec :: Int -> TySyn -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> TySyn -> Doc Source #

PP Type Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

Methods

ppPrec :: Int -> Type -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> Type -> Doc Source #

PP TypeSource Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

PP Path Source # 
Instance details

Defined in Cryptol.TypeCheck.Unify

Methods

ppPrec :: Int -> Path -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> Path -> Doc Source #

PP Assoc Source # 
Instance details

Defined in Cryptol.Utils.PP

Methods

ppPrec :: Int -> Assoc -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> Assoc -> Doc Source #

PP Fixity Source # 
Instance details

Defined in Cryptol.Utils.PP

Methods

ppPrec :: Int -> Fixity -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> Fixity -> Doc Source #

PP Ident Source # 
Instance details

Defined in Cryptol.Utils.PP

Methods

ppPrec :: Int -> Ident -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> Ident -> Doc Source #

PP ModName Source # 
Instance details

Defined in Cryptol.Utils.PP

PP ModPath Source # 
Instance details

Defined in Cryptol.Utils.PP

PP Namespace Source # 
Instance details

Defined in Cryptol.Utils.PP

PP OrigName Source # 
Instance details

Defined in Cryptol.Utils.PP

PP PrimIdent Source # 
Instance details

Defined in Cryptol.Utils.PP

PP Text Source # 
Instance details

Defined in Cryptol.Utils.PP

Methods

ppPrec :: Int -> Text -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> Text -> Doc Source #

(Show name, PPName name) => PP (Bind name) Source # 
Instance details

Defined in Cryptol.Parser.AST

Methods

ppPrec :: Int -> Bind name -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> Bind name -> Doc Source #

(Show name, PPName name) => PP (BindDef name) Source # 
Instance details

Defined in Cryptol.Parser.AST

Methods

ppPrec :: Int -> BindDef name -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> BindDef name -> Doc Source #

(Show name, PPName name) => PP (BindImpl name) Source # 
Instance details

Defined in Cryptol.Parser.AST

Methods

ppPrec :: Int -> BindImpl name -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> BindImpl name -> Doc Source #

(Show name, PPName name) => PP (CaseAlt name) Source # 
Instance details

Defined in Cryptol.Parser.AST

Methods

ppPrec :: Int -> CaseAlt name -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> CaseAlt name -> Doc Source #

(Show name, PPName name) => PP (Decl name) Source # 
Instance details

Defined in Cryptol.Parser.AST

Methods

ppPrec :: Int -> Decl name -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> Decl name -> Doc Source #

(Show name, PPName name) => PP (EnumCon name) Source # 
Instance details

Defined in Cryptol.Parser.AST

Methods

ppPrec :: Int -> EnumCon name -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> EnumCon name -> Doc Source #

(Show name, PPName name) => PP (EnumDecl name) Source # 
Instance details

Defined in Cryptol.Parser.AST

Methods

ppPrec :: Int -> EnumDecl name -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> EnumDecl name -> Doc Source #

(Show name, PPName name) => PP (Expr name) Source # 
Instance details

Defined in Cryptol.Parser.AST

Methods

ppPrec :: Int -> Expr name -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> Expr name -> Doc Source #

PP name => PP (ImpName name) Source # 
Instance details

Defined in Cryptol.Parser.AST

Methods

ppPrec :: Int -> ImpName name -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> ImpName name -> Doc Source #

PP mname => PP (ImportG mname) Source # 
Instance details

Defined in Cryptol.Parser.AST

Methods

ppPrec :: Int -> ImportG mname -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> ImportG mname -> Doc Source #

(Show name, PPName name) => PP (Match name) Source # 
Instance details

Defined in Cryptol.Parser.AST

Methods

ppPrec :: Int -> Match name -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> Match name -> Doc Source #

(Show name, PPName name) => PP (ModParam name) Source # 
Instance details

Defined in Cryptol.Parser.AST

Methods

ppPrec :: Int -> ModParam name -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> ModParam name -> Doc Source #

(Show name, PPName name) => PP (ModuleDefinition name) Source # 
Instance details

Defined in Cryptol.Parser.AST

(Show name, PPName name) => PP (ModuleInstanceArg name) Source # 
Instance details

Defined in Cryptol.Parser.AST

(Show name, PPName name) => PP (ModuleInstanceArgs name) Source # 
Instance details

Defined in Cryptol.Parser.AST

(Show name, PPName name) => PP (ModuleInstanceNamedArg name) Source # 
Instance details

Defined in Cryptol.Parser.AST

(Show name, PPName name) => PP (NestedModule name) Source # 
Instance details

Defined in Cryptol.Parser.AST

Methods

ppPrec :: Int -> NestedModule name -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> NestedModule name -> Doc Source #

PPName name => PP (Newtype name) Source # 
Instance details

Defined in Cryptol.Parser.AST

Methods

ppPrec :: Int -> Newtype name -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> Newtype name -> Doc Source #

(Show name, PPName name) => PP (ParamDecl name) Source # 
Instance details

Defined in Cryptol.Parser.AST

Methods

ppPrec :: Int -> ParamDecl name -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> ParamDecl name -> Doc Source #

(Show name, PPName name) => PP (ParameterConstraint name) Source # 
Instance details

Defined in Cryptol.Parser.AST

(Show name, PPName name) => PP (ParameterFun name) Source # 
Instance details

Defined in Cryptol.Parser.AST

Methods

ppPrec :: Int -> ParameterFun name -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> ParameterFun name -> Doc Source #

(Show name, PPName name) => PP (ParameterType name) Source # 
Instance details

Defined in Cryptol.Parser.AST

Methods

ppPrec :: Int -> ParameterType name -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> ParameterType name -> Doc Source #

PPName name => PP (Pattern name) Source # 
Instance details

Defined in Cryptol.Parser.AST

Methods

ppPrec :: Int -> Pattern name -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> Pattern name -> Doc Source #

(Show name, PPName name) => PP (PrimType name) Source # 
Instance details

Defined in Cryptol.Parser.AST

Methods

ppPrec :: Int -> PrimType name -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> PrimType name -> Doc Source #

(Show name, PPName name) => PP (Program name) Source # 
Instance details

Defined in Cryptol.Parser.AST

Methods

ppPrec :: Int -> Program name -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> Program name -> Doc Source #

PPName name => PP (Prop name) Source # 
Instance details

Defined in Cryptol.Parser.AST

Methods

ppPrec :: Int -> Prop name -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> Prop name -> Doc Source #

PPName name => PP (PropSyn name) Source # 
Instance details

Defined in Cryptol.Parser.AST

Methods

ppPrec :: Int -> PropSyn name -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> PropSyn name -> Doc Source #

PPName name => PP (Schema name) Source # 
Instance details

Defined in Cryptol.Parser.AST

Methods

ppPrec :: Int -> Schema name -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> Schema name -> Doc Source #

(Show name, PPName name) => PP (SigDecl name) Source # 
Instance details

Defined in Cryptol.Parser.AST

Methods

ppPrec :: Int -> SigDecl name -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> SigDecl name -> Doc Source #

PPName name => PP (TParam name) Source # 
Instance details

Defined in Cryptol.Parser.AST

Methods

ppPrec :: Int -> TParam name -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> TParam name -> Doc Source #

(Show name, PPName name) => PP (TopDecl name) Source # 
Instance details

Defined in Cryptol.Parser.AST

Methods

ppPrec :: Int -> TopDecl name -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> TopDecl name -> Doc Source #

PP a => PP (TopLevel a) Source # 
Instance details

Defined in Cryptol.Parser.AST

Methods

ppPrec :: Int -> TopLevel a -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> TopLevel a -> Doc Source #

PPName name => PP (TySyn name) Source # 
Instance details

Defined in Cryptol.Parser.AST

Methods

ppPrec :: Int -> TySyn name -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> TySyn name -> Doc Source #

PPName name => PP (Type name) Source # 
Instance details

Defined in Cryptol.Parser.AST

Methods

ppPrec :: Int -> Type name -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> Type name -> Doc Source #

PPName name => PP (TypeInst name) Source # 
Instance details

Defined in Cryptol.Parser.AST

Methods

ppPrec :: Int -> TypeInst name -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> TypeInst name -> Doc Source #

(Show name, PPName name) => PP (UpdField name) Source # 
Instance details

Defined in Cryptol.Parser.AST

Methods

ppPrec :: Int -> UpdField name -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> UpdField name -> Doc Source #

PP a => PP (Located a) Source # 
Instance details

Defined in Cryptol.Parser.Position

Methods

ppPrec :: Int -> Located a -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> Located a -> Doc Source #

PP n => PP (ModuleG n) Source # 
Instance details

Defined in Cryptol.TypeCheck.AST

Methods

ppPrec :: Int -> ModuleG n -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> ModuleG n -> Doc Source #

PP (WithNames Decl) Source # 
Instance details

Defined in Cryptol.TypeCheck.AST

PP (WithNames DeclDef) Source # 
Instance details

Defined in Cryptol.TypeCheck.AST

PP (WithNames DeclGroup) Source # 
Instance details

Defined in Cryptol.TypeCheck.AST

PP (WithNames Expr) Source # 
Instance details

Defined in Cryptol.TypeCheck.AST

PP (WithNames Match) Source # 
Instance details

Defined in Cryptol.TypeCheck.AST

PP n => PP (WithNames (ModuleG n)) Source # 
Instance details

Defined in Cryptol.TypeCheck.AST

PP (WithNames TCTopEntity) Source # 
Instance details

Defined in Cryptol.TypeCheck.AST

PP (WithNames Error) Source # 
Instance details

Defined in Cryptol.TypeCheck.Error

PP (WithNames Warning) Source # 
Instance details

Defined in Cryptol.TypeCheck.Error

PP (WithNames FFITypeError) Source # 
Instance details

Defined in Cryptol.TypeCheck.FFI.Error

PP (WithNames FFITypeErrorReason) Source # 
Instance details

Defined in Cryptol.TypeCheck.FFI.Error

PP (WithNames DelayedCt) Source # 
Instance details

Defined in Cryptol.TypeCheck.InferTypes

PP (WithNames Goal) Source # 
Instance details

Defined in Cryptol.TypeCheck.InferTypes

PP (WithNames Subst) Source # 
Instance details

Defined in Cryptol.TypeCheck.Subst.Type

PP (WithNames NominalType) Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

PP (WithNames Schema) Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

PP (WithNames TParam) Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

PP (WithNames TVar) Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

PP (WithNames TySyn) Source # 
Instance details

Defined in Cryptol.TypeCheck.Type

PP (WithNames Type) Source #

The precedence levels used by this pretty-printing instance correspond with parser non-terminals as follows:

  • 0-1: type
  • 2: infix_type
  • 3: app_type
  • 4: dimensions atype
  • 5: atype
Instance details

Defined in Cryptol.TypeCheck.Type

PPName name => PP [Prop name] Source # 
Instance details

Defined in Cryptol.Parser.AST

Methods

ppPrec :: Int -> [Prop name] -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> [Prop name] -> Doc Source #

(Show name, PPName mname, PPName name) => PP (ModuleG mname name) Source # 
Instance details

Defined in Cryptol.Parser.AST

Methods

ppPrec :: Int -> ModuleG mname name -> Doc Source #

ppPrecWithAnnot :: [([Int], PPAnnot)] -> Int -> ModuleG mname name -> Doc Source #

class PP a => PPName a where Source #

Methods

ppNameFixity :: a -> Maybe Fixity Source #

Fixity information for infix operators

ppPrefixName :: a -> Doc Source #

Print a name in prefix: f a b or (+) a b)

ppInfixName :: a -> Doc Source #

Print a name as an infix operator: a + b

pp :: PP a => a -> Doc Source #

pretty :: PP a => a -> String Source #

data Infix op thing Source #

Information about an infix expression of some sort.

Constructors

Infix 

Fields

ppInfix Source #

Arguments

:: (PP thing, PP op) 
=> Int

Non-infix leaves are printed with this precedence

-> (thing -> Maybe (Infix op thing))

pattern to check if sub-thing is also infix

-> Infix op thing

Pretty print this infix expression

-> Doc 

Pretty print an infix expression of some sort.

ordinal :: (Integral a, Show a, Eq a) => a -> Doc Source #

Display a numeric value as an ordinal (e.g., 2nd)

ordSuffix :: (Integral a, Eq a) => a -> String Source #

The suffix to use when displaying a number as an oridinal

liftPP1 :: (PPDoc -> PPDoc) -> Doc -> Doc Source #

liftPP2 :: (PPDoc -> PPDoc -> PPDoc) -> Doc -> Doc -> Doc Source #

liftSep :: ([PPDoc] -> PPDoc) -> [Doc] -> Doc Source #

(<.>) :: Doc -> Doc -> Doc infixl 6 Source #

(<+>) :: Doc -> Doc -> Doc infixl 6 Source #

(</>) :: Doc -> Doc -> Doc infixl 6 Source #

($$) :: Doc -> Doc -> Doc infixl 5 Source #

sep :: [Doc] -> Doc Source #

fsep :: [Doc] -> Doc Source #

hsep :: [Doc] -> Doc Source #

hcat :: [Doc] -> Doc Source #

vcat :: [Doc] -> Doc Source #

vsep :: [Doc] -> Doc Source #

hang :: Doc -> Int -> Doc -> Doc Source #

nest :: Int -> Doc -> Doc Source #

commaSepFill :: [Doc] -> Doc Source #

Print a comma-separated list. Lay out each item on a single line if it will fit. If an item requires multiple lines, then start it on its own line.