cryptol-2.8.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 NameDisp
  - = EmptyNameDisp
  - | NameDisp (ModName -> Ident -> Maybe NameFormat)
- data NameFormat
  - = UnQualified
  - | Qualified !ModName
  - | NotInScope
- neverQualifyMod :: ModName -> NameDisp
- alwaysQualify :: NameDisp
- neverQualify :: NameDisp
- fmtModName :: ModName -> NameFormat -> Text
- extend :: NameDisp -> NameDisp -> NameDisp
- getNameFormat :: ModName -> Ident -> NameDisp -> NameFormat
- withNameDisp :: (NameDisp -> Doc) -> Doc
- fixNameDisp :: NameDisp -> Doc -> Doc
- newtype Doc = Doc (NameDisp -> Doc)
- runDoc :: NameDisp -> Doc -> Doc
- render :: Doc -> String
- renderOneLine :: Doc -> String
- class PP a where
  - ppPrec :: Int -> a -> Doc
- class PP a => PPName a where
  - ppNameFixity :: a -> Maybe (Assoc, Int)
  - ppPrefixName :: a -> Doc
  - ppInfixName :: a -> Doc
- pp :: PP a => a -> Doc
- pretty :: PP a => a -> String
- optParens :: Bool -> Doc -> Doc
- data Assoc
  - = LeftAssoc
  - | RightAssoc
  - | NonAssoc
- data Infix op thing = Infix {
  - ieOp :: op
  - ieLeft :: thing
  - ieRight :: thing
  - iePrec :: Int
  - ieAssoc :: Assoc
  }
- commaSep :: [Doc] -> Doc
- 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
- liftPJ :: Doc -> Doc
- liftPJ1 :: (Doc -> Doc) -> Doc -> Doc
- liftPJ2 :: (Doc -> Doc -> Doc) -> Doc -> Doc -> Doc
- liftSep :: ([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
- hang :: Doc -> Int -> Doc -> Doc
- nest :: Int -> Doc -> Doc
- parens :: Doc -> Doc
- braces :: Doc -> Doc
- brackets :: Doc -> Doc
- quotes :: Doc -> Doc
- backticks :: Doc -> Doc
- punctuate :: Doc -> [Doc] -> [Doc]
- text :: String -> Doc
- char :: Char -> Doc
- integer :: Integer -> Doc
- int :: Int -> Doc
- comma :: Doc
- empty :: Doc
- colon :: Doc

# Documentation

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 (ModName -> Ident -> Maybe NameFormat) |

#### Instances

Instances details

Show NameDisp Source # |
Instance details Defined in Cryptol.Utils.PP Methods showsPrec :: Int -> NameDisp -> ShowS Source # show :: NameDisp -> String Source # showList :: [NameDisp] -> ShowS 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 #
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 #
Monoid NameDisp Source # |
Instance details Defined in Cryptol.Utils.PP Methods mempty :: NameDisp Source # mappend :: NameDisp -> NameDisp -> NameDisp Source # mconcat :: [NameDisp] -> NameDisp 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-2.8.0-11Z6ZaBuQbo1UTYpHYMeUg" 'False) (C1 ('MetaCons "EmptyNameDisp" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "NameDisp" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ModName -> Ident -> 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 :: ModName -> NameDisp Source #

Never qualify names from this module.

alwaysQualify :: NameDisp Source #

neverQualify :: NameDisp Source #

fmtModName :: ModName -> NameFormat -> Text Source #

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

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

getNameFormat :: ModName -> Ident -> NameDisp -> NameFormat Source #

Get the format for a name. When `Nothing` is returned, the name is not currently in scope.

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

Produce a document in the context of the current `NameDisp`.

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

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

newtype Doc Source #

Constructors

Doc (NameDisp -> Doc) |

#### Instances

Instances details

Show Doc Source # |
Instance details Defined in Cryptol.Utils.PP Methods showsPrec :: Int -> Doc -> ShowS Source # show :: Doc -> String Source # showList :: [Doc] -> ShowS Source #
IsString Doc Source # |
Instance details Defined in Cryptol.Utils.PP Methods fromString :: String -> 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 #
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 #
Monoid Doc Source # |
Instance details Defined in Cryptol.Utils.PP Methods mempty :: Doc Source # mappend :: Doc -> Doc -> Doc Source # mconcat :: [Doc] -> Doc 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-2.8.0-11Z6ZaBuQbo1UTYpHYMeUg" 'True) (C1 ('MetaCons "Doc" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NameDisp -> Doc))))

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

render :: Doc -> String Source #

renderOneLine :: Doc -> String Source #

class PP a where Source #

Methods

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

#### Instances

Instances details

PP Text Source # |
Instance details Defined in Cryptol.Utils.PP Methods ppPrec :: Int -> Text -> 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 Assoc Source # |
Instance details Defined in Cryptol.Utils.PP Methods ppPrec :: Int -> Assoc -> Doc Source #
PP Selector Source # |
Instance details Defined in Cryptol.Parser.Selector Methods ppPrec :: Int -> Selector -> Doc Source #
PP Range Source # |
Instance details Defined in Cryptol.Parser.Position Methods ppPrec :: Int -> Range -> Doc Source #
PP Position Source # |
Instance details Defined in Cryptol.Parser.Position Methods ppPrec :: Int -> Position -> Doc Source #
PP Fixity Source # |
Instance details Defined in Cryptol.Parser.Fixity Methods ppPrec :: Int -> Fixity -> Doc Source #
PP PName Source # |
Instance details Defined in Cryptol.Parser.Name Methods ppPrec :: Int -> PName -> Doc Source #
PP Kind Source # |
Instance details Defined in Cryptol.Parser.AST Methods ppPrec :: Int -> Kind -> Doc Source #
PP UpdHow Source # |
Instance details Defined in Cryptol.Parser.AST Methods ppPrec :: Int -> UpdHow -> 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 ImportSpec Source # |
Instance details Defined in Cryptol.Parser.AST Methods ppPrec :: Int -> ImportSpec -> Doc Source #
PP Import Source # |
Instance details Defined in Cryptol.Parser.AST Methods ppPrec :: Int -> Import -> Doc Source #
PP Error Source # |
Instance details Defined in Cryptol.Parser.NoPat Methods ppPrec :: Int -> Error -> Doc Source #
PP Token Source # |
Instance details Defined in Cryptol.Parser.LexerUtils Methods ppPrec :: Int -> Token -> Doc Source #
PP Name Source # |
Instance details Defined in Cryptol.ModuleSystem.Name Methods ppPrec :: Int -> Name -> Doc Source #
PP TFun Source # |
Instance details Defined in Cryptol.TypeCheck.TCon Methods ppPrec :: Int -> TFun -> Doc Source #
PP TCErrorMessage Source # |
Instance details Defined in Cryptol.TypeCheck.TCon Methods ppPrec :: Int -> TCErrorMessage -> Doc Source #
PP UserTC Source # |
Instance details Defined in Cryptol.TypeCheck.TCon Methods ppPrec :: Int -> UserTC -> Doc Source #
PP TC Source # |
Instance details Defined in Cryptol.TypeCheck.TCon Methods ppPrec :: Int -> TC -> Doc Source #
PP PC Source # |
Instance details Defined in Cryptol.TypeCheck.TCon Methods ppPrec :: Int -> PC -> Doc Source #
PP TCon Source # |
Instance details Defined in Cryptol.TypeCheck.TCon Methods ppPrec :: Int -> TCon -> Doc Source #
PP Kind Source # |
Instance details Defined in Cryptol.TypeCheck.TCon Methods ppPrec :: Int -> Kind -> Doc Source #
PP Newtype Source # |
Instance details Defined in Cryptol.TypeCheck.Type Methods ppPrec :: Int -> Newtype -> Doc Source #
PP TySyn Source # |
Instance details Defined in Cryptol.TypeCheck.Type Methods ppPrec :: Int -> TySyn -> Doc Source #
PP TVarSource Source # |
Instance details Defined in Cryptol.TypeCheck.Type Methods ppPrec :: Int -> TVarSource -> Doc Source #
PP TVarInfo Source # |
Instance details Defined in Cryptol.TypeCheck.Type Methods ppPrec :: Int -> TVarInfo -> Doc Source #
PP TVar Source # |
Instance details Defined in Cryptol.TypeCheck.Type Methods ppPrec :: Int -> TVar -> Doc Source #
PP Type Source # |
Instance details Defined in Cryptol.TypeCheck.Type Methods ppPrec :: Int -> Type -> Doc Source #
PP TParam Source # |
Instance details Defined in Cryptol.TypeCheck.Type Methods ppPrec :: Int -> TParam -> Doc Source #
PP Schema Source # |
Instance details Defined in Cryptol.TypeCheck.Type Methods ppPrec :: Int -> Schema -> 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 Match Source # |
Instance details Defined in Cryptol.TypeCheck.AST Methods ppPrec :: Int -> Match -> Doc Source #
PP Expr Source # |
Instance details Defined in Cryptol.TypeCheck.AST Methods ppPrec :: Int -> Expr -> Doc Source #
PP Module Source # |
Instance details Defined in Cryptol.TypeCheck.AST Methods ppPrec :: Int -> Module -> Doc Source #
PP Solved Source # |
Instance details Defined in Cryptol.TypeCheck.Solver.Types Methods ppPrec :: Int -> Solved -> Doc Source #
PP RenamerWarning Source # |
Instance details Defined in Cryptol.ModuleSystem.Renamer Methods ppPrec :: Int -> RenamerWarning -> Doc Source #
PP RenamerError Source # |
Instance details Defined in Cryptol.ModuleSystem.Renamer Methods ppPrec :: Int -> RenamerError -> Doc Source #
PP EvalError Source # |
Instance details Defined in Cryptol.Eval.Monad Methods ppPrec :: Int -> EvalError -> Doc Source #
PP Subst Source # |
Instance details Defined in Cryptol.TypeCheck.Subst Methods ppPrec :: Int -> Subst -> 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.Error Methods ppPrec :: Int -> Error -> Doc Source #
PP Warning Source # |
Instance details Defined in Cryptol.TypeCheck.Error Methods ppPrec :: Int -> Warning -> Doc Source #
PP ModulePath Source # |
Instance details Defined in Cryptol.ModuleSystem.Env Methods ppPrec :: Int -> ModulePath -> Doc Source #
PP ModuleWarning Source # |
Instance details Defined in Cryptol.ModuleSystem.Monad Methods ppPrec :: Int -> ModuleWarning -> Doc Source #
PP ModuleError Source # |
Instance details Defined in Cryptol.ModuleSystem.Monad Methods ppPrec :: Int -> ModuleError -> Doc Source #
PP ImportSource Source # |
Instance details Defined in Cryptol.ModuleSystem.Monad Methods ppPrec :: Int -> ImportSource -> Doc Source #
PP Smoke Source # |
Instance details Defined in Cryptol.REPL.Monad Methods ppPrec :: Int -> Smoke -> Doc Source #
PP REPLException Source # |
Instance details Defined in Cryptol.REPL.Monad Methods ppPrec :: Int -> REPLException -> Doc Source #
PP (WithNames Newtype) Source # |
Instance details Defined in Cryptol.TypeCheck.Type Methods ppPrec :: Int -> WithNames Newtype -> Doc Source #
PP (WithNames TySyn) Source # |
Instance details Defined in Cryptol.TypeCheck.Type Methods ppPrec :: Int -> WithNames TySyn -> Doc Source #
PP (WithNames TVar) Source # |
Instance details Defined in Cryptol.TypeCheck.Type Methods ppPrec :: Int -> WithNames TVar -> Doc Source #
PP (WithNames Type) Source # |
Instance details Defined in Cryptol.TypeCheck.Type Methods ppPrec :: Int -> WithNames Type -> Doc Source #
PP (WithNames TParam) Source # |
Instance details Defined in Cryptol.TypeCheck.Type Methods ppPrec :: Int -> WithNames TParam -> Doc Source #
PP (WithNames Schema) Source # |
Instance details Defined in Cryptol.TypeCheck.Type Methods ppPrec :: Int -> WithNames Schema -> Doc Source #
PP (WithNames DeclDef) Source # |
Instance details Defined in Cryptol.TypeCheck.AST Methods ppPrec :: Int -> WithNames DeclDef -> Doc Source #
PP (WithNames Decl) Source # |
Instance details Defined in Cryptol.TypeCheck.AST Methods ppPrec :: Int -> WithNames Decl -> Doc Source #
PP (WithNames DeclGroup) Source # |
Instance details Defined in Cryptol.TypeCheck.AST Methods ppPrec :: Int -> WithNames DeclGroup -> Doc Source #
PP (WithNames Match) Source # |
Instance details Defined in Cryptol.TypeCheck.AST Methods ppPrec :: Int -> WithNames Match -> Doc Source #
PP (WithNames Expr) Source # |
Instance details Defined in Cryptol.TypeCheck.AST Methods ppPrec :: Int -> WithNames Expr -> Doc Source #
PP (WithNames Module) Source # |
Instance details Defined in Cryptol.TypeCheck.AST Methods ppPrec :: Int -> WithNames Module -> Doc Source #
PP (WithNames Subst) Source # |
Instance details Defined in Cryptol.TypeCheck.Subst Methods ppPrec :: Int -> WithNames Subst -> 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 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 a => PP (Located a) Source # |
Instance details Defined in Cryptol.Parser.Position Methods ppPrec :: Int -> Located a -> 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 (Type name) Source # |
Instance details Defined in Cryptol.Parser.AST Methods ppPrec :: Int -> Type name -> Doc Source #
PPName name => PP (TParam name) Source # |
Instance details Defined in Cryptol.Parser.AST Methods ppPrec :: Int -> TParam name -> Doc Source #
PPName name => PP (Schema name) Source # |
Instance details Defined in Cryptol.Parser.AST Methods ppPrec :: Int -> Schema 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 (Match name) Source # |
Instance details Defined in Cryptol.Parser.AST Methods ppPrec :: Int -> Match 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 #
(Show name, PPName name) => PP (Expr name) Source # |
Instance details Defined in Cryptol.Parser.AST Methods ppPrec :: Int -> Expr name -> Doc Source #
PP a => PP (TopLevel a) Source # |
Instance details Defined in Cryptol.Parser.AST Methods ppPrec :: Int -> TopLevel a -> Doc Source #
(Show name, PPName name) => PP (PrimType name) Source # |
Instance details Defined in Cryptol.Parser.AST Methods ppPrec :: Int -> PrimType 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 (BindDef name) Source # |
Instance details Defined in Cryptol.Parser.AST Methods ppPrec :: Int -> BindDef name -> Doc Source #
(Show name, PPName name) => PP (Bind name) Source # |
Instance details Defined in Cryptol.Parser.AST Methods ppPrec :: Int -> Bind 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 (TySyn name) Source # |
Instance details Defined in Cryptol.Parser.AST Methods ppPrec :: Int -> TySyn 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 #
(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 (TopDecl name) Source # |
Instance details Defined in Cryptol.Parser.AST Methods ppPrec :: Int -> TopDecl name -> Doc Source #
(Show name, PPName name) => PP (Module name) Source # |
Instance details Defined in Cryptol.Parser.AST Methods ppPrec :: Int -> Module 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 #

class PP a => PPName a where Source #

Methods

ppNameFixity :: a -> Maybe (Assoc, Int) 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 PName Source # |
Instance details Defined in Cryptol.Parser.Name Methods ppNameFixity :: PName -> Maybe (Assoc, Int) Source # ppPrefixName :: PName -> Doc Source # ppInfixName :: PName -> Doc Source #
PPName Name Source # |
Instance details Defined in Cryptol.ModuleSystem.Name Methods ppNameFixity :: Name -> Maybe (Assoc, Int) Source # ppPrefixName :: Name -> Doc Source # ppInfixName :: Name -> Doc Source #
PPName a => PPName (Located a) Source # |
Instance details Defined in Cryptol.Parser.Position Methods ppNameFixity :: Located a -> Maybe (Assoc, Int) 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 Assoc Source #

Information about associativity.

Constructors

LeftAssoc |
RightAssoc |
NonAssoc |

#### Instances

Instances details

Eq Assoc Source # |
Instance details Defined in Cryptol.Utils.PP Methods (==) :: Assoc -> Assoc -> Bool Source # (/=) :: Assoc -> Assoc -> Bool Source #
Show Assoc Source # |
Instance details Defined in Cryptol.Utils.PP Methods showsPrec :: Int -> Assoc -> ShowS Source # show :: Assoc -> String Source # showList :: [Assoc] -> ShowS Source #
Generic Assoc Source # |
Instance details Defined in Cryptol.Utils.PP Associated Types type Rep Assoc :: Type -> Type Source # Methods from :: Assoc -> Rep Assoc x Source # to :: Rep Assoc x -> Assoc Source #
NFData Assoc Source # |
Instance details Defined in Cryptol.Utils.PP Methods rnf :: Assoc -> () Source #
PP Assoc Source # |
Instance details Defined in Cryptol.Utils.PP Methods ppPrec :: Int -> Assoc -> Doc Source #
type Rep Assoc Source # |
Instance details Defined in Cryptol.Utils.PP type Rep Assoc = D1 ('MetaData "Assoc" "Cryptol.Utils.PP" "cryptol-2.8.0-11Z6ZaBuQbo1UTYpHYMeUg" 'False) (C1 ('MetaCons "LeftAssoc" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "RightAssoc" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "NonAssoc" 'PrefixI 'False) (U1 :: Type -> Type)))

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

- iePrec :: Int

  operator precedence

- ieAssoc :: Assoc

  operator associativity

commaSep :: [Doc] -> Doc Source #

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

liftPJ :: Doc -> Doc Source #

liftPJ1 :: (Doc -> Doc) -> Doc -> Doc Source #

liftPJ2 :: (Doc -> Doc -> Doc) -> Doc -> Doc -> Doc Source #

liftSep :: ([Doc] -> Doc) -> [Doc] -> Doc 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 #

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

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

parens :: Doc -> Doc Source #

braces :: Doc -> Doc Source #

brackets :: Doc -> Doc Source #

quotes :: Doc -> Doc Source #

backticks :: Doc -> Doc Source #

punctuate :: Doc -> [Doc] -> [Doc] Source #

text :: String -> Doc Source #

char :: Char -> Doc Source #

integer :: Integer -> Doc Source #

int :: Int -> Doc Source #

comma :: Doc Source #

empty :: Doc Source #

colon :: Doc Source #