cryptol-3.0.0: Cryptol: The Language of Cryptography

Copyright | (c) 2013-2016 Galois Inc.
License | BSD3
Maintainer | cryptol@galois.com
Stability | provisional
Portability | portable
Safe Haskell | Safe
Language | Haskell2010

Cryptol.Utils.PP

Description

Synopsis

- data PPOpts = PPOpts {
  - useAscii :: Bool
  - useBase :: Int
  - useInfLength :: Int
  - useFPBase :: Int
  - useFPFormat :: PPFloatFormat
  - useFieldOrder :: FieldOrder
  }
- asciiMode :: PPOpts -> Integer -> Bool
- data PPFloatFormat
  - = FloatFixed Int PPFloatExp
  - | FloatFrac Int
  - | FloatFree PPFloatExp
- data PPFloatExp
  - = ForceExponent
  - | AutoExponent
- data FieldOrder
  - = DisplayOrder
  - | CanonicalOrder
- defaultPPOpts :: PPOpts
- data NameDisp
  - = EmptyNameDisp
  - | NameDisp (OrigName -> Maybe NameFormat)
- data NameFormat
  - = UnQualified
  - | Qualified !ModName
  - | NotInScope
- neverQualifyMod :: ModPath -> NameDisp
- neverQualify :: NameDisp
- extend :: NameDisp -> NameDisp -> NameDisp
- getNameFormat :: OrigName -> NameDisp -> NameFormat
- withNameDisp :: (NameDisp -> Doc) -> Doc
- withPPCfg :: (PPCfg -> Doc) -> Doc
- fixNameDisp :: NameDisp -> Doc -> Doc
- fixPPCfg :: PPCfg -> Doc -> Doc
- updPPCfg :: (PPCfg -> PPCfg) -> Doc -> Doc
- debugShowUniques :: Doc -> Doc
- data PPCfg = PPCfg {
  - ppcfgNameDisp :: NameDisp
  - ppcfgShowNameUniques :: Bool
  }
- defaultPPCfg :: PPCfg
- newtype Doc = Doc (PPCfg -> Doc Void)
- runDocWith :: PPCfg -> Doc -> Doc Void
- runDoc :: NameDisp -> Doc -> Doc Void
- renderOneLine :: Doc -> String
- class PP a where
  - ppPrec :: Int -> a -> Doc
- class PP a => PPName a where
  - ppNameFixity :: a -> Maybe Fixity
  - ppPrefixName :: a -> Doc
  - ppInfixName :: a -> Doc
- pp :: PP a => a -> Doc
- pretty :: PP a => a -> String
- optParens :: Bool -> Doc -> Doc
- data Infix op thing = Infix {
  - ieOp :: op
  - ieLeft :: thing
  - ieRight :: thing
  - ieFixity :: Fixity
  }
- ppInfix :: (PP thing, PP op) => Int -> (thing -> Maybe (Infix op thing)) -> Infix op thing -> Doc
- ordinal :: (Integral a, Show a, Eq a) => a -> Doc
- ordSuffix :: (Integral a, Eq a) => a -> String
- liftPP :: Doc Void -> Doc
- liftPP1 :: (Doc Void -> Doc Void) -> Doc -> Doc
- liftPP2 :: (Doc Void -> Doc Void -> Doc Void) -> Doc -> Doc -> Doc
- liftSep :: ([Doc Void] -> Doc Void) -> [Doc] -> Doc
- reflow :: Text -> Doc
- (<.>) :: Doc -> Doc -> Doc
- (<+>) :: Doc -> Doc -> Doc
- (</>) :: Doc -> Doc -> Doc
- ($$) :: Doc -> Doc -> Doc
- sep :: [Doc] -> Doc
- fsep :: [Doc] -> Doc
- hsep :: [Doc] -> Doc
- hcat :: [Doc] -> Doc
- vcat :: [Doc] -> Doc
- vsep :: [Doc] -> Doc
- group :: Doc -> Doc
- hang :: Doc -> Int -> Doc -> Doc
- nest :: Int -> Doc -> Doc
- indent :: Int -> Doc -> Doc
- align :: Doc -> Doc
- parens :: Doc -> Doc
- braces :: Doc -> Doc
- brackets :: Doc -> Doc
- quotes :: Doc -> Doc
- commaSep :: [Doc] -> Doc
- commaSepFill :: [Doc] -> Doc
- ppList :: [Doc] -> Doc
- ppTuple :: [Doc] -> Doc
- ppRecord :: [Doc] -> Doc
- backticks :: Doc -> Doc
- text :: String -> Doc
- char :: Char -> Doc
- integer :: Integer -> Doc
- int :: Int -> Doc
- comma :: Doc
- colon :: Doc
- pipe :: Doc

# Documentation

data PPOpts Source #

How to pretty print things when evaluating

Constructors

PPOpts |

Fields

- useAscii :: Bool
- useBase :: Int
- useInfLength :: Int
- useFPBase :: Int
- useFPFormat :: PPFloatFormat
- useFieldOrder :: FieldOrder

#### Instances

Instances details

Show PPOpts Source # |
Instance details Defined in Cryptol.Utils.PP Methods showsPrec :: Int -> PPOpts -> ShowS Source # show :: PPOpts -> String Source # showList :: [PPOpts] -> ShowS Source #

asciiMode :: PPOpts -> Integer -> Bool Source #

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 Methods showsPrec :: Int -> PPFloatFormat -> ShowS Source # show :: PPFloatFormat -> String Source # showList :: [PPFloatFormat] -> ShowS Source #

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 Methods showsPrec :: Int -> PPFloatExp -> ShowS Source # show :: PPFloatExp -> String Source # showList :: [PPFloatExp] -> ShowS Source #

data FieldOrder Source #

Constructors

DisplayOrder |
CanonicalOrder |

#### Instances

Instances details

Bounded FieldOrder Source # |
Instance details Defined in Cryptol.Utils.PP Methods minBound :: FieldOrder Source # maxBound :: FieldOrder Source #
Enum FieldOrder Source # |

Instance details

Defined in Cryptol.Utils.PP

Methods

succ :: FieldOrder -> FieldOrder Source #

pred :: FieldOrder -> FieldOrder Source #

toEnum :: Int -> FieldOrder Source #

fromEnum :: FieldOrder -> Int Source #

enumFrom :: FieldOrder -> [FieldOrder] Source #

enumFromThen :: FieldOrder -> FieldOrder -> [FieldOrder] Source #

enumFromTo :: FieldOrder -> FieldOrder -> [FieldOrder] Source #

enumFromThenTo :: FieldOrder -> FieldOrder -> FieldOrder -> [FieldOrder] Source #

Read FieldOrder Source # |
Instance details Defined in Cryptol.Utils.PP Methods readsPrec :: Int -> ReadS FieldOrder Source # readList :: ReadS [FieldOrder] Source # readPrec :: ReadPrec FieldOrder Source # readListPrec :: ReadPrec [FieldOrder] Source #
Show FieldOrder Source # |
Instance details Defined in Cryptol.Utils.PP Methods showsPrec :: Int -> FieldOrder -> ShowS Source # show :: FieldOrder -> String Source # showList :: [FieldOrder] -> ShowS Source #
Eq FieldOrder Source # |
Instance details Defined in Cryptol.Utils.PP Methods (==) :: FieldOrder -> FieldOrder -> Bool Source # (/=) :: FieldOrder -> FieldOrder -> Bool Source #
Ord FieldOrder Source # |

Instance details

Defined in Cryptol.Utils.PP

Methods

compare :: FieldOrder -> FieldOrder -> Ordering Source #

(<) :: FieldOrder -> FieldOrder -> Bool Source #

(<=) :: FieldOrder -> FieldOrder -> Bool Source #

(>) :: FieldOrder -> FieldOrder -> Bool Source #

(>=) :: FieldOrder -> FieldOrder -> Bool Source #

max :: FieldOrder -> FieldOrder -> FieldOrder Source #

min :: FieldOrder -> FieldOrder -> FieldOrder Source #

defaultPPOpts :: PPOpts Source #

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.

Constructors

EmptyNameDisp |
NameDisp (OrigName -> Maybe NameFormat) |

#### Instances

Instances details

Monoid NameDisp Source # |
Instance details Defined in Cryptol.Utils.PP Methods mempty :: NameDisp Source # mappend :: NameDisp -> NameDisp -> NameDisp Source # mconcat :: [NameDisp] -> NameDisp Source #
Semigroup NameDisp Source # |
Instance details Defined in Cryptol.Utils.PP Methods (<>) :: NameDisp -> NameDisp -> NameDisp Source # sconcat :: NonEmpty NameDisp -> NameDisp Source # stimes :: Integral b => b -> NameDisp -> NameDisp Source #
Generic NameDisp Source # |
Instance details Defined in Cryptol.Utils.PP Associated Types type Rep NameDisp :: Type -> Type Source # Methods from :: NameDisp -> Rep NameDisp x Source # to :: Rep NameDisp x -> NameDisp Source #
Show NameDisp Source # |
Instance details Defined in Cryptol.Utils.PP Methods showsPrec :: Int -> NameDisp -> ShowS Source # show :: NameDisp -> String Source # showList :: [NameDisp] -> ShowS Source #
NFData NameDisp Source # |
Instance details Defined in Cryptol.Utils.PP Methods rnf :: NameDisp -> () Source #
type Rep NameDisp Source # |

Instance details

Defined in Cryptol.Utils.PP

type Rep NameDisp = D1 ('MetaData "NameDisp" "Cryptol.Utils.PP" "cryptol-3.0.0-DBVDUAjB1JeD0WzkHH4ckn" '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 #

Constructors

UnQualified |
Qualified !ModName |
NotInScope |

#### Instances

Instances details

Show NameFormat Source # |
Instance details Defined in Cryptol.Utils.PP Methods showsPrec :: Int -> NameFormat -> ShowS Source # show :: NameFormat -> String Source # showList :: [NameFormat] -> ShowS Source #

neverQualifyMod :: ModPath -> NameDisp Source #

Never qualify names from this module.

neverQualify :: NameDisp Source #

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.

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

debugShowUniques :: Doc -> Doc Source #

data PPCfg Source #

Constructors

PPCfg |

Fields

- ppcfgNameDisp :: NameDisp
- ppcfgShowNameUniques :: Bool

defaultPPCfg :: PPCfg Source #

newtype Doc Source #

Constructors

Doc (PPCfg -> Doc Void) |

#### Instances

Instances details

IsString Doc Source # |
Instance details Defined in Cryptol.Utils.PP Methods fromString :: String -> Doc Source #
Monoid Doc Source # |
Instance details Defined in Cryptol.Utils.PP Methods mempty :: Doc Source # mappend :: Doc -> Doc -> Doc Source # mconcat :: [Doc] -> Doc Source #
Semigroup Doc Source # |
Instance details Defined in Cryptol.Utils.PP Methods (<>) :: Doc -> Doc -> Doc Source # sconcat :: NonEmpty Doc -> Doc Source # stimes :: Integral b => b -> Doc -> Doc Source #
Generic Doc Source # |
Instance details Defined in Cryptol.Utils.PP Associated Types type Rep Doc :: Type -> Type Source # Methods from :: Doc -> Rep Doc x Source # to :: Rep Doc x -> Doc Source #
Show Doc Source # |
Instance details Defined in Cryptol.Utils.PP Methods showsPrec :: Int -> Doc -> ShowS Source # show :: Doc -> String Source # showList :: [Doc] -> ShowS Source #
NFData Doc Source # |
Instance details Defined in Cryptol.Utils.PP Methods rnf :: Doc -> () Source #
type Rep Doc Source # |
Instance details Defined in Cryptol.Utils.PP type Rep Doc = D1 ('MetaData "Doc" "Cryptol.Utils.PP" "cryptol-3.0.0-DBVDUAjB1JeD0WzkHH4ckn" 'True) (C1 ('MetaCons "Doc" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (PPCfg -> Doc Void))))

runDocWith :: PPCfg -> Doc -> Doc Void Source #

runDoc :: NameDisp -> Doc -> Doc Void Source #

renderOneLine :: Doc -> String Source #

class PP a where Source #

Methods

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

#### Instances

Instances details

PP FFILoadError Source # |
Instance details Defined in Cryptol.Backend.FFI.Error Methods ppPrec :: Int -> FFILoadError -> Doc Source #
PP EvalError Source # |
Instance details Defined in Cryptol.Backend.Monad Methods ppPrec :: Int -> EvalError -> Doc Source #
PP EvalErrorEx Source # |
Instance details Defined in Cryptol.Backend.Monad Methods ppPrec :: Int -> EvalErrorEx -> Doc Source #
PP Unsupported Source # |
Instance details Defined in Cryptol.Backend.Monad Methods ppPrec :: Int -> Unsupported -> Doc Source #
PP WordTooWide Source # |
Instance details Defined in Cryptol.Backend.Monad Methods ppPrec :: Int -> WordTooWide -> Doc Source #
PP ModulePath Source # |
Instance details Defined in Cryptol.ModuleSystem.Env Methods ppPrec :: Int -> ModulePath -> Doc Source #
PP ImportSource Source # |
Instance details Defined in Cryptol.ModuleSystem.Monad Methods ppPrec :: Int -> ImportSource -> Doc Source #
PP ModuleError Source # |
Instance details Defined in Cryptol.ModuleSystem.Monad Methods ppPrec :: Int -> ModuleError -> Doc Source #
PP ModuleWarning Source # |
Instance details Defined in Cryptol.ModuleSystem.Monad Methods ppPrec :: Int -> ModuleWarning -> Doc Source #
PP Name Source # |
Instance details Defined in Cryptol.ModuleSystem.Name Methods ppPrec :: Int -> Name -> Doc Source #
PP NamingEnv Source # |
Instance details Defined in Cryptol.ModuleSystem.NamingEnv Methods ppPrec :: Int -> NamingEnv -> Doc Source #
PP RenamedModule Source # |
Instance details Defined in Cryptol.ModuleSystem.Renamer Methods ppPrec :: Int -> RenamedModule -> Doc Source #
PP DepName Source # |
Instance details Defined in Cryptol.ModuleSystem.Renamer.Error Methods ppPrec :: Int -> DepName -> Doc Source #
PP ModKind Source # |
Instance details Defined in Cryptol.ModuleSystem.Renamer.Error Methods ppPrec :: Int -> ModKind -> Doc Source #
PP RenamerError Source # |
Instance details Defined in Cryptol.ModuleSystem.Renamer.Error Methods ppPrec :: Int -> RenamerError -> Doc Source #
PP RenamerWarning Source # |
Instance details Defined in Cryptol.ModuleSystem.Renamer.Error Methods ppPrec :: Int -> RenamerWarning -> Doc Source #
PP ImportSpec Source # |
Instance details Defined in Cryptol.Parser.AST Methods ppPrec :: Int -> ImportSpec -> Doc Source #
PP Kind Source # |
Instance details Defined in Cryptol.Parser.AST Methods ppPrec :: Int -> Kind -> Doc Source #
PP Literal Source # |
Instance details Defined in Cryptol.Parser.AST Methods ppPrec :: Int -> Literal -> Doc Source #
PP Pragma Source # |
Instance details Defined in Cryptol.Parser.AST Methods ppPrec :: Int -> Pragma -> Doc Source #
PP UpdHow Source # |
Instance details Defined in Cryptol.Parser.AST Methods ppPrec :: Int -> UpdHow -> Doc Source #
PP Error Source # |
Instance details Defined in Cryptol.Parser.ExpandPropGuards Methods ppPrec :: Int -> Error -> Doc Source #
PP PName Source # |
Instance details Defined in Cryptol.Parser.Name Methods ppPrec :: Int -> PName -> Doc Source #
PP Error Source # |
Instance details Defined in Cryptol.Parser.NoPat Methods ppPrec :: Int -> Error -> Doc Source #
PP Position Source # |
Instance details Defined in Cryptol.Parser.Position Methods ppPrec :: Int -> Position -> Doc Source #
PP Range Source # |
Instance details Defined in Cryptol.Parser.Position Methods ppPrec :: Int -> Range -> Doc Source #
PP Selector Source # |
Instance details Defined in Cryptol.Parser.Selector Methods ppPrec :: Int -> Selector -> Doc Source #
PP Token Source # |
Instance details Defined in Cryptol.Parser.Token Methods ppPrec :: Int -> Token -> Doc Source #
PP REPLException Source # |
Instance details Defined in Cryptol.REPL.Monad Methods ppPrec :: Int -> REPLException -> Doc Source #
PP Smoke Source # |
Instance details Defined in Cryptol.REPL.Monad Methods ppPrec :: Int -> Smoke -> Doc Source #
PP Decl Source # |
Instance details Defined in Cryptol.TypeCheck.AST Methods ppPrec :: Int -> Decl -> Doc Source #
PP DeclGroup Source # |
Instance details Defined in Cryptol.TypeCheck.AST Methods ppPrec :: Int -> DeclGroup -> Doc Source #
PP Expr Source # |
Instance details Defined in Cryptol.TypeCheck.AST Methods ppPrec :: Int -> Expr -> Doc Source #
PP Match Source # |
Instance details Defined in Cryptol.TypeCheck.AST Methods ppPrec :: Int -> Match -> Doc Source #
PP TCTopEntity Source # |
Instance details Defined in Cryptol.TypeCheck.AST Methods ppPrec :: Int -> TCTopEntity -> Doc Source #
PP Error Source # |
Instance details Defined in Cryptol.TypeCheck.Error Methods ppPrec :: Int -> Error -> Doc Source #
PP Warning Source # |
Instance details Defined in Cryptol.TypeCheck.Error Methods ppPrec :: Int -> Warning -> Doc Source #
PP ConstraintSource Source # |
Instance details Defined in Cryptol.TypeCheck.InferTypes Methods ppPrec :: Int -> ConstraintSource -> Doc Source #
PP Error Source # |
Instance details Defined in Cryptol.TypeCheck.Sanity Methods ppPrec :: Int -> Error -> Doc Source #
PP Solved Source # |
Instance details Defined in Cryptol.TypeCheck.Solver.Types Methods ppPrec :: Int -> Solved -> Doc Source #
PP Subst Source # |
Instance details Defined in Cryptol.TypeCheck.Subst Methods ppPrec :: Int -> Subst -> Doc Source #
PP Kind Source # |
Instance details Defined in Cryptol.TypeCheck.TCon Methods ppPrec :: Int -> Kind -> Doc Source #
PP PC Source # |
Instance details Defined in Cryptol.TypeCheck.TCon Methods ppPrec :: Int -> PC -> Doc Source #
PP TC Source # |
Instance details Defined in Cryptol.TypeCheck.TCon Methods ppPrec :: Int -> TC -> Doc Source #
PP TCon Source # |
Instance details Defined in Cryptol.TypeCheck.TCon Methods ppPrec :: Int -> TCon -> Doc Source #
PP TFun Source # |
Instance details Defined in Cryptol.TypeCheck.TCon Methods ppPrec :: Int -> TFun -> Doc Source #
PP UserTC Source # |
Instance details Defined in Cryptol.TypeCheck.TCon Methods ppPrec :: Int -> UserTC -> Doc Source #
PP ArgDescr Source # |
Instance details Defined in Cryptol.TypeCheck.Type Methods ppPrec :: Int -> ArgDescr -> Doc Source #
PP ModParamNames Source # |
Instance details Defined in Cryptol.TypeCheck.Type Methods ppPrec :: Int -> ModParamNames -> Doc Source #
PP ModTParam Source # |
Instance details Defined in Cryptol.TypeCheck.Type Methods ppPrec :: Int -> ModTParam -> Doc Source #
PP ModVParam Source # |
Instance details Defined in Cryptol.TypeCheck.Type Methods ppPrec :: Int -> ModVParam -> Doc Source #
PP Newtype Source # |
Instance details Defined in Cryptol.TypeCheck.Type Methods ppPrec :: Int -> Newtype -> Doc Source #
PP Schema Source # |
Instance details Defined in Cryptol.TypeCheck.Type Methods ppPrec :: Int -> Schema -> Doc Source #
PP TParam Source # |
Instance details Defined in Cryptol.TypeCheck.Type Methods ppPrec :: Int -> TParam -> Doc Source #
PP TVar Source # |
Instance details Defined in Cryptol.TypeCheck.Type Methods ppPrec :: Int -> TVar -> Doc Source #
PP TVarInfo Source # |
Instance details Defined in Cryptol.TypeCheck.Type Methods ppPrec :: Int -> TVarInfo -> Doc Source #
PP TySyn Source # |
Instance details Defined in Cryptol.TypeCheck.Type Methods ppPrec :: Int -> TySyn -> Doc Source #
PP Type Source # |
Instance details Defined in Cryptol.TypeCheck.Type Methods ppPrec :: Int -> Type -> Doc Source #
PP TypeSource Source # |
Instance details Defined in Cryptol.TypeCheck.Type Methods ppPrec :: Int -> TypeSource -> Doc Source #
PP Path Source # |
Instance details Defined in Cryptol.TypeCheck.Unify Methods ppPrec :: Int -> Path -> Doc Source #
PP Assoc Source # |
Instance details Defined in Cryptol.Utils.PP Methods ppPrec :: Int -> Assoc -> Doc Source #
PP Fixity Source # |
Instance details Defined in Cryptol.Utils.PP Methods ppPrec :: Int -> Fixity -> Doc Source #
PP Ident Source # |
Instance details Defined in Cryptol.Utils.PP Methods ppPrec :: Int -> Ident -> Doc Source #
PP ModName Source # |
Instance details Defined in Cryptol.Utils.PP Methods ppPrec :: Int -> ModName -> Doc Source #
PP ModPath Source # |
Instance details Defined in Cryptol.Utils.PP Methods ppPrec :: Int -> ModPath -> Doc Source #
PP Namespace Source # |
Instance details Defined in Cryptol.Utils.PP Methods ppPrec :: Int -> Namespace -> Doc Source #
PP OrigName Source # |
Instance details Defined in Cryptol.Utils.PP Methods ppPrec :: Int -> OrigName -> Doc Source #
PP PrimIdent Source # |
Instance details Defined in Cryptol.Utils.PP Methods ppPrec :: Int -> PrimIdent -> Doc Source #
PP Text Source # |
Instance details Defined in Cryptol.Utils.PP Methods ppPrec :: 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 #
(Show name, PPName name) => PP (BindDef name) Source # |
Instance details Defined in Cryptol.Parser.AST Methods ppPrec :: Int -> BindDef 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 #
(Show name, PPName name) => PP (Expr name) Source # |
Instance details Defined in Cryptol.Parser.AST Methods ppPrec :: 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 #
PP mname => PP (ImportG mname) Source # |
Instance details Defined in Cryptol.Parser.AST Methods ppPrec :: 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 #
(Show name, PPName name) => PP (ModParam name) Source # |
Instance details Defined in Cryptol.Parser.AST Methods ppPrec :: Int -> ModParam name -> Doc Source #
(Show name, PPName name) => PP (ModuleDefinition name) Source # |
Instance details Defined in Cryptol.Parser.AST Methods ppPrec :: Int -> ModuleDefinition name -> Doc Source #
(Show name, PPName name) => PP (ModuleInstanceArg name) Source # |
Instance details Defined in Cryptol.Parser.AST Methods ppPrec :: Int -> ModuleInstanceArg name -> Doc Source #
(Show name, PPName name) => PP (ModuleInstanceArgs name) Source # |
Instance details Defined in Cryptol.Parser.AST Methods ppPrec :: Int -> ModuleInstanceArgs name -> Doc Source #
(Show name, PPName name) => PP (ModuleInstanceNamedArg name) Source # |
Instance details Defined in Cryptol.Parser.AST Methods ppPrec :: Int -> ModuleInstanceNamedArg name -> Doc Source #
(Show name, PPName name) => PP (NestedModule name) Source # |
Instance details Defined in Cryptol.Parser.AST Methods ppPrec :: 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 #
(Show name, PPName name) => PP (ParamDecl name) Source # |
Instance details Defined in Cryptol.Parser.AST Methods ppPrec :: Int -> ParamDecl name -> Doc Source #
(Show name, PPName name) => PP (ParameterFun name) Source # |
Instance details Defined in Cryptol.Parser.AST Methods ppPrec :: 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 #
PPName name => PP (Pattern name) Source # |
Instance details Defined in Cryptol.Parser.AST Methods ppPrec :: 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 #
(Show name, PPName name) => PP (Program name) Source # |
Instance details Defined in Cryptol.Parser.AST Methods ppPrec :: 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 #
PPName name => PP (PropSyn name) Source # |
Instance details Defined in Cryptol.Parser.AST Methods ppPrec :: 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 #
(Show name, PPName name) => PP (SigDecl name) Source # |
Instance details Defined in Cryptol.Parser.AST Methods ppPrec :: 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 #
(Show name, PPName name) => PP (TopDecl name) Source # |
Instance details Defined in Cryptol.Parser.AST Methods ppPrec :: 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 #
PPName name => PP (TySyn name) Source # |
Instance details Defined in Cryptol.Parser.AST Methods ppPrec :: 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 #
PPName name => PP (TypeInst name) Source # |
Instance details Defined in Cryptol.Parser.AST Methods ppPrec :: 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 #
PP a => PP (Located a) Source # |
Instance details Defined in Cryptol.Parser.Position Methods ppPrec :: 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 #
PP (WithNames Decl) Source # |
Instance details Defined in Cryptol.TypeCheck.AST Methods ppPrec :: Int -> WithNames Decl -> Doc Source #
PP (WithNames DeclDef) Source # |
Instance details Defined in Cryptol.TypeCheck.AST Methods ppPrec :: Int -> WithNames DeclDef -> Doc Source #
PP (WithNames DeclGroup) Source # |
Instance details Defined in Cryptol.TypeCheck.AST Methods ppPrec :: Int -> WithNames DeclGroup -> Doc Source #
PP (WithNames Expr) Source # |
Instance details Defined in Cryptol.TypeCheck.AST Methods ppPrec :: Int -> WithNames Expr -> Doc Source #
PP (WithNames Match) Source # |
Instance details Defined in Cryptol.TypeCheck.AST Methods ppPrec :: Int -> WithNames Match -> Doc Source #
PP n => PP (WithNames (ModuleG n)) Source # |
Instance details Defined in Cryptol.TypeCheck.AST Methods ppPrec :: Int -> WithNames (ModuleG n) -> Doc Source #
PP (WithNames TCTopEntity) Source # |
Instance details Defined in Cryptol.TypeCheck.AST Methods ppPrec :: Int -> WithNames TCTopEntity -> Doc Source #
PP (WithNames Error) Source # |
Instance details Defined in Cryptol.TypeCheck.Error Methods ppPrec :: Int -> WithNames Error -> Doc Source #
PP (WithNames Warning) Source # |
Instance details Defined in Cryptol.TypeCheck.Error Methods ppPrec :: Int -> WithNames Warning -> Doc Source #
PP (WithNames FFITypeError) Source # |
Instance details Defined in Cryptol.TypeCheck.FFI.Error Methods ppPrec :: Int -> WithNames FFITypeError -> Doc Source #
PP (WithNames FFITypeErrorReason) Source # |
Instance details Defined in Cryptol.TypeCheck.FFI.Error Methods ppPrec :: Int -> WithNames FFITypeErrorReason -> Doc Source #
PP (WithNames DelayedCt) Source # |
Instance details Defined in Cryptol.TypeCheck.InferTypes Methods ppPrec :: Int -> WithNames DelayedCt -> Doc Source #
PP (WithNames Goal) Source # |
Instance details Defined in Cryptol.TypeCheck.InferTypes Methods ppPrec :: Int -> WithNames Goal -> Doc Source #
PP (WithNames Subst) Source # |
Instance details Defined in Cryptol.TypeCheck.Subst Methods ppPrec :: Int -> WithNames Subst -> Doc Source #
PP (WithNames Newtype) Source # |
Instance details Defined in Cryptol.TypeCheck.Type Methods ppPrec :: Int -> WithNames Newtype -> Doc Source #
PP (WithNames Schema) Source # |
Instance details Defined in Cryptol.TypeCheck.Type Methods ppPrec :: Int -> WithNames Schema -> Doc Source #
PP (WithNames TParam) Source # |
Instance details Defined in Cryptol.TypeCheck.Type Methods ppPrec :: Int -> WithNames TParam -> Doc Source #
PP (WithNames TVar) Source # |
Instance details Defined in Cryptol.TypeCheck.Type Methods ppPrec :: Int -> WithNames TVar -> Doc Source #
PP (WithNames TySyn) Source # |
Instance details Defined in Cryptol.TypeCheck.Type Methods ppPrec :: Int -> WithNames TySyn -> Doc Source #

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 Methods ppPrec :: Int -> WithNames Type -> Doc Source #
PPName name => PP [Prop name] Source # |
Instance details Defined in Cryptol.Parser.AST Methods ppPrec :: 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 #

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`

#### Instances

Instances details

PPName Name Source # |
Instance details Defined in Cryptol.ModuleSystem.Name Methods ppNameFixity :: Name -> Maybe Fixity Source # ppPrefixName :: Name -> Doc Source # ppInfixName :: Name -> Doc Source #
PPName PName Source # |
Instance details Defined in Cryptol.Parser.Name Methods ppNameFixity :: PName -> Maybe Fixity Source # ppPrefixName :: PName -> Doc Source # ppInfixName :: PName -> Doc Source #
PPName ModName Source # |
Instance details Defined in Cryptol.Utils.PP Methods ppNameFixity :: ModName -> Maybe Fixity Source # ppPrefixName :: ModName -> Doc Source # ppInfixName :: ModName -> Doc Source #
PPName a => PPName (Located a) Source # |
Instance details Defined in Cryptol.Parser.Position Methods ppNameFixity :: Located a -> Maybe Fixity Source # ppPrefixName :: Located a -> Doc Source # ppInfixName :: Located a -> Doc Source #

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

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

optParens :: Bool -> Doc -> Doc Source #

data Infix op thing Source #

Information about an infix expression of some sort.

Constructors

Infix |

Fields

- ieOp :: op

  operator

- ieLeft :: thing

  left argument

- ieRight :: thing

  right argument

- ieFixity :: Fixity

  operator fixity

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

liftPP :: Doc Void -> Doc Source #

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

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

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

reflow :: Text -> 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 #

group :: Doc -> Doc Source #

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

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

indent :: Int -> Doc -> Doc Source #

align :: Doc -> Doc Source #

parens :: Doc -> Doc Source #

braces :: Doc -> Doc Source #

brackets :: Doc -> Doc Source #

quotes :: Doc -> Doc Source #

commaSep :: [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.

ppList :: [Doc] -> Doc Source #

ppTuple :: [Doc] -> Doc Source #

ppRecord :: [Doc] -> Doc Source #

backticks :: Doc -> Doc Source #

text :: String -> Doc Source #

char :: Char -> Doc Source #

integer :: Integer -> Doc Source #

int :: Int -> Doc Source #

comma :: Doc Source #

colon :: Doc Source #

pipe :: Doc Source #