Mikan
Safe HaskellNone
LanguageHaskell2010

Mikan.Syntax.Common.Pretty

Description

Pretty printing functions.

Synopsis

Documentation

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

a ? b = hang a 2 b

align :: Int -> [(String, Doc)] -> Doc Source #

align max rows lays out the elements of rows in two columns, with the second components aligned. The alignment column of the second components is at most max characters to the right of the left-most column.

Precondition: max > 0.

annotate :: Aspects -> Doc -> Doc Source #

Only adds an annotation node if the Aspects is non-null.

annotateAspect :: Aspect -> Doc -> Doc Source #

Attach a simple Aspect, rather than a full set of Aspects, to a document.

braces Source #

Arguments

:: Doc 
-> Doc

Wrap document in {...}

brackets Source #

Arguments

:: Doc 
-> Doc

Wrap document in [...]

definedAt :: HasRange a => Doc -> a -> Doc Source #

Attach the position of something as the "binding site" of a Doc.

doubleQuotes Source #

Arguments

:: Doc 
-> Doc

Wrap document in "..."

fsep :: Foldable t => t Doc -> Doc Source #

githubIssue :: Int -> Doc Source #

Link to an issue on the Agda bug tracker.

hcat :: Foldable t => t Doc -> Doc Source #

href :: Text -> Doc -> Doc Source #

Attach a link to a document (cf. LaTeX href).

hsep :: Foldable t => t Doc -> Doc Source #

hsepWith :: Doc -> Doc -> Doc -> Doc Source #

Separate, but only if both separees are not null.

mparens :: Bool -> Doc -> Doc Source #

Apply parens to Doc if boolean is true.

multiLineText :: String -> Doc Source #

Handles strings with newlines properly (preserving indentation)

parens Source #

Arguments

:: Doc 
-> Doc

Wrap document in (...)

parensNonEmpty :: Doc -> Doc Source #

Only wrap in parens if not empty

pluralS :: Sized a => a -> Doc -> Doc Source #

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

Used for with-like telescopes

prettyAssign :: (Pretty k, Pretty v) => (k, v) -> Doc Source #

Pretty print a single association.

prettyList_ :: Pretty a => [a] -> Doc Source #

Comma separated list, without the brackets.

prettyMap :: (Pretty k, Pretty v) => [(k, v)] -> Doc Source #

Pretty print an association list.

prettySet :: Pretty a => [a] -> Doc Source #

Pretty print a set.

prettyShow :: Pretty a => a -> String Source #

Use instead of show when printing to world.

pshow :: Show a => a -> Doc Source #

pshow = text . show

punctuate :: Foldable t => Doc -> t Doc -> [Doc] Source #

quotes Source #

Arguments

:: Doc 
-> Doc

Wrap document in '...'

sep :: Foldable t => t Doc -> Doc Source #

singPlural :: Sized a => a -> c -> c -> c Source #

textNonEmpty :: String -> Doc Source #

Return empty for empty strings.

url :: String -> Doc Source #

A URL formatted as link (cf. LaTeX url).

vcat :: Foldable t => t Doc -> Doc Source #

vsep :: [Doc] -> Doc Source #

type Doc = Doc Aspects Source #

The type of documents. We use documents annotated by Aspects to record syntactic highlighting information that is generated during pretty-printing.

class Pretty a where Source #

While Show is for rendering data in Haskell syntax, Pretty is for displaying data to the world, i.e., the user and the environment.

Atomic data has no inner document structure, so just implement pretty as pretty a = text $ ... a ....

Minimal complete definition

pretty | prettyPrec

Methods

pretty :: a -> Doc Source #

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

prettyList :: [a] -> Doc Source #

Instances

Instances details
Pretty Phase Source # 
Instance details

Defined in Mikan.Benchmarking

Pretty CompilerBackend Source # 
Instance details

Defined in Mikan.Interaction.Base

Pretty InterfaceFile Source # 
Instance details

Defined in Mikan.Interaction.FindFile

Pretty LibError' Source #

Pretty-print library management error without position info.

Instance details

Defined in Mikan.Interaction.Library.Base

Pretty LibName Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

Pretty LibParseError Source #

Print library file parse error without position info.

Instance details

Defined in Mikan.Interaction.Library.Base

Pretty LibWarning Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

Pretty LibWarning' Source # 
Instance details

Defined in Mikan.Interaction.Library.Base

Pretty OptionWarning Source # 
Instance details

Defined in Mikan.Interaction.Options.Base

Pretty HintMode Source # 
Instance details

Defined in Mikan.Mimer.Options

Pretty BaseComponents Source # 
Instance details

Defined in Mikan.Mimer.Types

Pretty Component Source # 
Instance details

Defined in Mikan.Mimer.Types

Pretty Costs Source # 
Instance details

Defined in Mikan.Mimer.Types

Pretty Goal Source # 
Instance details

Defined in Mikan.Mimer.Types

Pretty SearchBranch Source # 
Instance details

Defined in Mikan.Mimer.Types

Pretty SearchOptions Source # 
Instance details

Defined in Mikan.Mimer.Types

Pretty ScopeCopyInfo Source # 
Instance details

Defined in Mikan.Syntax.Abstract

Pretty AbstractModule Source # 
Instance details

Defined in Mikan.Syntax.Abstract.Name

Pretty AbstractName Source # 
Instance details

Defined in Mikan.Syntax.Abstract.Name

Pretty AmbiguousQName Source # 
Instance details

Defined in Mikan.Syntax.Abstract.Name

Pretty ConHead Source # 
Instance details

Defined in Mikan.Syntax.Abstract.Name

Pretty ModuleName Source # 
Instance details

Defined in Mikan.Syntax.Abstract.Name

Pretty Name Source # 
Instance details

Defined in Mikan.Syntax.Abstract.Name

Pretty QName Source # 
Instance details

Defined in Mikan.Syntax.Abstract.Name

Pretty Suffix Source # 
Instance details

Defined in Mikan.Syntax.Abstract.Name

Pretty BuiltinId Source # 
Instance details

Defined in Mikan.Syntax.Builtin

Pretty PrimitiveId Source # 
Instance details

Defined in Mikan.Syntax.Builtin

Pretty Access Source # 
Instance details

Defined in Mikan.Syntax.Common

Pretty Associativity Source # 
Instance details

Defined in Mikan.Syntax.Common

Pretty ConstructorOrPatternSynonym Source # 
Instance details

Defined in Mikan.Syntax.Common

Pretty FileType Source # 
Instance details

Defined in Mikan.Syntax.Common

Pretty Fixity Source # 
Instance details

Defined in Mikan.Syntax.Common

Pretty Fixity' Source # 
Instance details

Defined in Mikan.Syntax.Common

Pretty FixityLevel Source # 
Instance details

Defined in Mikan.Syntax.Common

Pretty Hiding Source # 
Instance details

Defined in Mikan.Syntax.Common

Pretty InteractionId Source # 
Instance details

Defined in Mikan.Syntax.Common

Pretty MetaId Source # 
Instance details

Defined in Mikan.Syntax.Common

Pretty NameId Source # 
Instance details

Defined in Mikan.Syntax.Common

Pretty NotationPart Source # 
Instance details

Defined in Mikan.Syntax.Common

Pretty OpaqueId Source # 
Instance details

Defined in Mikan.Syntax.Common

Pretty OverlapMode Source # 
Instance details

Defined in Mikan.Syntax.Common

Pretty ProblemId Source # 
Instance details

Defined in Mikan.Syntax.Common

Pretty Induction Source # 
Instance details

Defined in Mikan.Syntax.Common

Pretty KwRange Source # 
Instance details

Defined in Mikan.Syntax.Common.KeywordRange

Pretty BoundName Source # 
Instance details

Defined in Mikan.Syntax.Concrete.Pretty

Pretty Declaration Source # 
Instance details

Defined in Mikan.Syntax.Concrete.Pretty

Pretty DoStmt Source # 
Instance details

Defined in Mikan.Syntax.Concrete.Pretty

Pretty Expr Source # 
Instance details

Defined in Mikan.Syntax.Concrete.Pretty

Pretty LHS Source # 
Instance details

Defined in Mikan.Syntax.Concrete.Pretty

Pretty LHSCore Source # 
Instance details

Defined in Mikan.Syntax.Concrete.Pretty

Pretty LamBinding Source # 
Instance details

Defined in Mikan.Syntax.Concrete.Pretty

Pretty LamClause Source # 
Instance details

Defined in Mikan.Syntax.Concrete.Pretty

Pretty ModuleApplication Source # 
Instance details

Defined in Mikan.Syntax.Concrete.Pretty

Pretty ModuleAssignment Source # 
Instance details

Defined in Mikan.Syntax.Concrete.Pretty

Pretty OpenShortHand Source # 
Instance details

Defined in Mikan.Syntax.Concrete.Pretty

Pretty Pattern Source # 
Instance details

Defined in Mikan.Syntax.Concrete.Pretty

Pretty Pragma Source # 
Instance details

Defined in Mikan.Syntax.Concrete.Pretty

Pretty RHS Source # 
Instance details

Defined in Mikan.Syntax.Concrete.Pretty

Pretty RecordDirective Source # 
Instance details

Defined in Mikan.Syntax.Concrete.Pretty

Pretty TypedBinding Source # 
Instance details

Defined in Mikan.Syntax.Concrete.Pretty

Pretty WhereClause Source # 
Instance details

Defined in Mikan.Syntax.Concrete.Pretty

Pretty DeclarationException' Source # 
Instance details

Defined in Mikan.Syntax.Concrete.Definitions.Errors

Pretty DeclarationWarning Source # 
Instance details

Defined in Mikan.Syntax.Concrete.Definitions.Errors

Pretty DeclarationWarning' Source # 
Instance details

Defined in Mikan.Syntax.Concrete.Definitions.Errors

Pretty OpenOrImport Source # 
Instance details

Defined in Mikan.Syntax.Concrete.Definitions.Errors

Pretty DataRecOrFun Source # 
Instance details

Defined in Mikan.Syntax.Concrete.Definitions.Types

Pretty NiceDeclaration Source # 
Instance details

Defined in Mikan.Syntax.Concrete.Definitions.Types

Pretty Name Source # 
Instance details

Defined in Mikan.Syntax.Concrete.Name

Pretty NamePart Source # 
Instance details

Defined in Mikan.Syntax.Concrete.Name

Pretty QName Source # 
Instance details

Defined in Mikan.Syntax.Concrete.Name

Pretty MemoKey Source # 
Instance details

Defined in Mikan.Syntax.Concrete.Operators.Parser.Monad

Pretty PrecedenceKey Source # 
Instance details

Defined in Mikan.Syntax.Concrete.Operators.Parser.Monad

Pretty NamedBinding Source # 
Instance details

Defined in Mikan.Syntax.Concrete.Pretty

Pretty Tel Source # 
Instance details

Defined in Mikan.Syntax.Concrete.Pretty

Pretty Precedence Source # 
Instance details

Defined in Mikan.Syntax.Fixity

Pretty Blocker Source # 
Instance details

Defined in Mikan.Syntax.Internal.Blockers

Pretty Clause Source # 
Instance details

Defined in Mikan.Syntax.Internal.Clause

Pretty ClauseRecursive Source # 
Instance details

Defined in Mikan.Syntax.Internal.Clause

Pretty DBPatVar Source # 
Instance details

Defined in Mikan.Syntax.Internal.Pattern

Pretty Teletype Source # 
Instance details

Defined in Mikan.Syntax.Internal.Telescope

Pretty Level Source # 
Instance details

Defined in Mikan.Syntax.Internal.Term

Pretty PlusLevel Source # 
Instance details

Defined in Mikan.Syntax.Internal.Term

Pretty Sort Source # 
Instance details

Defined in Mikan.Syntax.Internal.Term

Pretty Term Source # 
Instance details

Defined in Mikan.Syntax.Internal.Term

Pretty Type Source # 
Instance details

Defined in Mikan.Syntax.Internal.Term

Pretty Literal Source # 
Instance details

Defined in Mikan.Syntax.Literal

Pretty NewNotation Source # 
Instance details

Defined in Mikan.Syntax.Notation

Pretty NotationKind Source # 
Instance details

Defined in Mikan.Syntax.Notation

Pretty NotationSection Source # 
Instance details

Defined in Mikan.Syntax.Notation

Pretty ParseError Source # 
Instance details

Defined in Mikan.Syntax.Parser.Monad

Pretty ParseWarning Source #

Does not include printing of the range.

Instance details

Defined in Mikan.Syntax.Parser.Monad

Pretty PositionWithoutFile Source # 
Instance details

Defined in Mikan.Syntax.Common.Pretty

Pretty RangeFile Source # 
Instance details

Defined in Mikan.Syntax.Common.Pretty

Pretty BindingSource Source # 
Instance details

Defined in Mikan.Syntax.Scope.Base

Pretty LiveNames Source # 
Instance details

Defined in Mikan.Syntax.Scope.Base

Pretty LocalVar Source #

We show shadowed variables as prefixed by a ".", as not in scope.

Instance details

Defined in Mikan.Syntax.Scope.Base

Pretty NameSpace Source # 
Instance details

Defined in Mikan.Syntax.Scope.Base

Pretty NameSpaceId Source # 
Instance details

Defined in Mikan.Syntax.Scope.Base

Pretty OperatorScope Source # 
Instance details

Defined in Mikan.Syntax.Scope.Base

Pretty ResolvedName Source # 
Instance details

Defined in Mikan.Syntax.Scope.Base

Pretty Scope Source # 
Instance details

Defined in Mikan.Syntax.Scope.Base

Pretty ScopeInfo Source # 
Instance details

Defined in Mikan.Syntax.Scope.Base

Pretty RawTopLevelModuleName Source # 
Instance details

Defined in Mikan.Syntax.TopLevelModuleName

Pretty TopLevelModuleName Source # 
Instance details

Defined in Mikan.Syntax.TopLevelModuleName

Pretty CallMatrix Source # 
Instance details

Defined in Mikan.Termination.CallMatrix

Pretty CallPath Source #

Only show intermediate nodes. (Drop last CallInfo).

Instance details

Defined in Mikan.Termination.Monad

Pretty Order Source # 
Instance details

Defined in Mikan.Termination.Order

Pretty Cl Source # 
Instance details

Defined in Mikan.TypeChecking.CompiledClause.Compile

Pretty BlockingVar Source # 
Instance details

Defined in Mikan.TypeChecking.Coverage.Match

Pretty SplitClause Source # 
Instance details

Defined in Mikan.TypeChecking.Coverage.SplitClause

Pretty SplitPatVar Source # 
Instance details

Defined in Mikan.TypeChecking.Coverage.SplitPattern

Pretty SplitTag Source # 
Instance details

Defined in Mikan.TypeChecking.Coverage.SplitTree

Pretty MetaSet Source # 
Instance details

Defined in Mikan.TypeChecking.Free.Base

Pretty Call Source # 
Instance details

Defined in Mikan.TypeChecking.Monad.Base

Pretty CallInfo Source #

We only show the name of the callee.

Instance details

Defined in Mikan.TypeChecking.Monad.Base

Pretty CheckpointId Source # 
Instance details

Defined in Mikan.TypeChecking.Monad.Base

Pretty CompareAs Source # 
Instance details

Defined in Mikan.TypeChecking.Monad.Base

Pretty CompareDirection Source # 
Instance details

Defined in Mikan.TypeChecking.Monad.Base

Pretty ConstructorData Source # 
Instance details

Defined in Mikan.TypeChecking.Monad.Base

Pretty DataOrRecSigData Source # 
Instance details

Defined in Mikan.TypeChecking.Monad.Base

Pretty DatatypeData Source # 
Instance details

Defined in Mikan.TypeChecking.Monad.Base

Pretty Definition Source # 
Instance details

Defined in Mikan.TypeChecking.Monad.Base

Pretty Defn Source # 
Instance details

Defined in Mikan.TypeChecking.Monad.Base

Pretty DisplayForm Source # 
Instance details

Defined in Mikan.TypeChecking.Monad.Base

Pretty DisplayTerm Source # 
Instance details

Defined in Mikan.TypeChecking.Monad.Base

Pretty FunctionData Source # 
Instance details

Defined in Mikan.TypeChecking.Monad.Base

Pretty Interface Source # 
Instance details

Defined in Mikan.TypeChecking.Monad.Base

Pretty MetaInstantiation Source # 
Instance details

Defined in Mikan.TypeChecking.Monad.Base

Pretty ModuleCheckpoints Source # 
Instance details

Defined in Mikan.TypeChecking.Monad.Base

Pretty MutualId Source # 
Instance details

Defined in Mikan.TypeChecking.Monad.Base

Pretty OpaqueBlock Source # 
Instance details

Defined in Mikan.TypeChecking.Monad.Base

Pretty PrimitiveData Source # 
Instance details

Defined in Mikan.TypeChecking.Monad.Base

Pretty PrimitiveSortData Source # 
Instance details

Defined in Mikan.TypeChecking.Monad.Base

Pretty ProjLams Source # 
Instance details

Defined in Mikan.TypeChecking.Monad.Base

Pretty Projection Source # 
Instance details

Defined in Mikan.TypeChecking.Monad.Base

Pretty ProjectionLikenessMissing Source # 
Instance details

Defined in Mikan.TypeChecking.Monad.Base

Pretty RecordData Source # 
Instance details

Defined in Mikan.TypeChecking.Monad.Base

Pretty Section Source # 
Instance details

Defined in Mikan.TypeChecking.Monad.Base

Pretty TermHead Source # 
Instance details

Defined in Mikan.TypeChecking.Monad.Base

Pretty WithFunInfo Source # 
Instance details

Defined in Mikan.TypeChecking.Monad.Base

Pretty Comparison Source # 
Instance details

Defined in Mikan.TypeChecking.Monad.Base

Pretty ModuleToSource Source # 
Instance details

Defined in Mikan.TypeChecking.Monad.Base

Pretty NamedMeta Source # 
Instance details

Defined in Mikan.TypeChecking.Monad.Base

Pretty Polarity Source # 
Instance details

Defined in Mikan.TypeChecking.Monad.Base

Pretty Node Source # 
Instance details

Defined in Mikan.TypeChecking.Positivity.Occurrence

Pretty Occurrence Source # 
Instance details

Defined in Mikan.TypeChecking.Positivity.Occurrence

Pretty OccursPath Source # 
Instance details

Defined in Mikan.TypeChecking.Positivity.Occurrence

Pretty OccursWhere Source # 
Instance details

Defined in Mikan.TypeChecking.Positivity.Occurrence

Pretty OccursWhere Source # 
Instance details

Defined in Mikan.TypeChecking.Positivity.Warnings

Pretty Where Source # 
Instance details

Defined in Mikan.TypeChecking.Positivity.Warnings

Pretty Lvl Source # 
Instance details

Defined in Mikan.TypeChecking.Primitive

Pretty Nat Source # 
Instance details

Defined in Mikan.TypeChecking.Primitive

Pretty CType Source # 
Instance details

Defined in Mikan.TypeChecking.Primitive.Cubical

Pretty AsBinding Source # 
Instance details

Defined in Mikan.TypeChecking.Rules.LHS.Problem

Pretty CallSite Source # 
Instance details

Defined in Mikan.Utils.CallStack.Pretty

Pretty AbsolutePath Source # 
Instance details

Defined in Mikan.Syntax.Common.Pretty

Pretty Regex Source # 
Instance details

Defined in Mikan.Utils.Parser.MemoisedCPS

Pretty CPUTime Source #

Print CPU time in milli (10^-3) seconds.

Instance details

Defined in Mikan.Utils.Time

Pretty IntSet Source # 
Instance details

Defined in Mikan.Syntax.Common.Pretty

Pretty Int32 Source # 
Instance details

Defined in Mikan.Syntax.Common.Pretty

Pretty CallStack Source # 
Instance details

Defined in Mikan.Utils.CallStack.Pretty

Pretty SrcLoc Source # 
Instance details

Defined in Mikan.Utils.CallStack.Pretty

Pretty Word32 Source # 
Instance details

Defined in Mikan.Syntax.Common.Pretty

Pretty Word64 Source # 
Instance details

Defined in Mikan.Syntax.Common.Pretty

Pretty Text Source # 
Instance details

Defined in Mikan.Syntax.Common.Pretty

Pretty ShortText Source # 
Instance details

Defined in Mikan.Syntax.Common.Pretty

Pretty Integer Source # 
Instance details

Defined in Mikan.Syntax.Common.Pretty

Pretty () Source # 
Instance details

Defined in Mikan.Syntax.Common.Pretty

Methods

pretty :: () -> Doc Source #

prettyPrec :: Int -> () -> Doc Source #

prettyList :: [()] -> Doc Source #

Pretty Bool Source # 
Instance details

Defined in Mikan.Syntax.Common.Pretty

Pretty Char Source # 
Instance details

Defined in Mikan.Syntax.Common.Pretty

Pretty Double Source # 
Instance details

Defined in Mikan.Syntax.Common.Pretty

Pretty Int Source # 
Instance details

Defined in Mikan.Syntax.Common.Pretty

Pretty a => Pretty (Lisp a) Source # 
Instance details

Defined in Mikan.Interaction.Emacs.Lisp

Methods

pretty :: Lisp a -> Doc Source #

prettyPrec :: Int -> Lisp a -> Doc Source #

prettyList :: [Lisp a] -> Doc Source #

Pretty a => Pretty (QNamed a) Source # 
Instance details

Defined in Mikan.Syntax.Abstract.Name

Pretty a => Pretty (Arg a) Source # 
Instance details

Defined in Mikan.Syntax.Common

Methods

pretty :: Arg a -> Doc Source #

prettyPrec :: Int -> Arg a -> Doc Source #

prettyList :: [Arg a] -> Doc Source #

Pretty a => Pretty (MaybePlaceholder a) Source # 
Instance details

Defined in Mikan.Syntax.Concrete.Pretty

Pretty e => Pretty (Named_ e) Source # 
Instance details

Defined in Mikan.Syntax.Common

Pretty a => Pretty (Ranged a) Source #

Ignores range.

Instance details

Defined in Mikan.Syntax.Common

Pretty a => Pretty (WithHiding a) Source # 
Instance details

Defined in Mikan.Syntax.Common

Pretty a => Pretty (WithOrigin a) Source # 
Instance details

Defined in Mikan.Syntax.Common

Pretty a => Pretty (Binder' a) Source # 
Instance details

Defined in Mikan.Syntax.Concrete.Pretty

Pretty a => Pretty (FieldAssignment' a) Source # 
Instance details

Defined in Mikan.Syntax.Concrete.Pretty

Pretty (OpApp Expr) Source # 
Instance details

Defined in Mikan.Syntax.Concrete.Pretty

Pretty a => Pretty (TacticAttribute' a) Source # 
Instance details

Defined in Mikan.Syntax.Concrete.Pretty

Pretty (ThingWithFixity Name) Source # 
Instance details

Defined in Mikan.Syntax.Concrete.Pretty

Pretty t => Pretty (NotBlocked' t) Source # 
Instance details

Defined in Mikan.Syntax.Internal.Blockers

Pretty t => Pretty (Abs t) Source # 
Instance details

Defined in Mikan.Syntax.Internal.Dom

Methods

pretty :: Abs t -> Doc Source #

prettyPrec :: Int -> Abs t -> Doc Source #

prettyList :: [Abs t] -> Doc Source #

Pretty tm => Pretty (Elim' tm) Source # 
Instance details

Defined in Mikan.Syntax.Internal.Elim

Methods

pretty :: Elim' tm -> Doc Source #

prettyPrec :: Int -> Elim' tm -> Doc Source #

prettyList :: [Elim' tm] -> Doc Source #

Pretty a => Pretty (Pattern' a) Source # 
Instance details

Defined in Mikan.Syntax.Internal.Pattern

(t ~ Dom a, Pretty a) => Pretty (Tele t) Source # 
Instance details

Defined in Mikan.Syntax.Internal.Telescope

Methods

pretty :: Tele t -> Doc Source #

prettyPrec :: Int -> Tele t -> Doc Source #

prettyList :: [Tele t] -> Doc Source #

Pretty a => Pretty (Blocked a) Source # 
Instance details

Defined in Mikan.Syntax.Internal.Term

Pretty a => Pretty (Substitution' a) Source # 
Instance details

Defined in Mikan.Syntax.Internal.Term

Pretty a => Pretty (Interval' a) Source # 
Instance details

Defined in Mikan.Syntax.Common.Pretty

Pretty a => Pretty (Position' (Maybe a)) Source # 
Instance details

Defined in Mikan.Syntax.Common.Pretty

(Pretty a, HasRange a) => Pretty (PrintRange a) Source # 
Instance details

Defined in Mikan.Syntax.Common.Pretty

Pretty a => Pretty (Range' a) Source # 
Instance details

Defined in Mikan.Syntax.Common.Pretty

(HasNameBindingSite a, Pretty a) => Pretty (PrettyWithBindingSite a) Source # 
Instance details

Defined in Mikan.Syntax.Scope.Base

(IsInstanceDef a, Pretty a) => Pretty (PrettyWithInstance a) Source # 
Instance details

Defined in Mikan.Syntax.Scope.Base

Pretty cinfo => Pretty (CallGraph cinfo) Source #

Displays the recursion behaviour corresponding to a call graph.

Instance details

Defined in Mikan.Termination.CallGraph

Methods

pretty :: CallGraph cinfo -> Doc Source #

prettyPrec :: Int -> CallGraph cinfo -> Doc Source #

prettyList :: [CallGraph cinfo] -> Doc Source #

Pretty cinfo => Pretty (CMSet cinfo) Source # 
Instance details

Defined in Mikan.Termination.CallMatrix

Methods

pretty :: CMSet cinfo -> Doc Source #

prettyPrec :: Int -> CMSet cinfo -> Doc Source #

prettyList :: [CMSet cinfo] -> Doc Source #

Pretty cinfo => Pretty (CallMatrixAug cinfo) Source # 
Instance details

Defined in Mikan.Termination.CallMatrix

Pretty a => Pretty (CCDone a) Source # 
Instance details

Defined in Mikan.TypeChecking.CompiledClause

Pretty a => Pretty (Case a) Source # 
Instance details

Defined in Mikan.TypeChecking.CompiledClause

Methods

pretty :: Case a -> Doc Source #

prettyPrec :: Int -> Case a -> Doc Source #

prettyList :: [Case a] -> Doc Source #

Pretty a => Pretty (CompiledClauses' a) Source # 
Instance details

Defined in Mikan.TypeChecking.CompiledClause

Pretty a => Pretty (WithArity a) Source # 
Instance details

Defined in Mikan.TypeChecking.CompiledClause

Pretty a => Pretty (SplitTree' a) Source # 
Instance details

Defined in Mikan.TypeChecking.Coverage.SplitTree

Pretty a => Pretty (SplitTreeLabel a) Source # 
Instance details

Defined in Mikan.TypeChecking.Coverage.SplitTree

Pretty a => Pretty (FlexRig' a) Source # 
Instance details

Defined in Mikan.TypeChecking.Free.Base

Pretty a => Pretty (VarOcc' a) Source # 
Instance details

Defined in Mikan.TypeChecking.Free.Base

Pretty c => Pretty (FunctionInverse' c) Source # 
Instance details

Defined in Mikan.TypeChecking.Monad.Base

Pretty a => Pretty (Judgement a) Source # 
Instance details

Defined in Mikan.TypeChecking.Monad.Base

Pretty a => Pretty (Open a) Source # 
Instance details

Defined in Mikan.TypeChecking.Monad.Base

Methods

pretty :: Open a -> Doc Source #

prettyPrec :: Int -> Open a -> Doc Source #

prettyList :: [Open a] -> Doc Source #

Pretty c => Pretty (IPFace' c) Source # 
Instance details

Defined in Mikan.Interaction.BasicOps

(Ord a, Pretty a) => Pretty (Benchmark a) Source #

Print benchmark as three-column table with totals.

Instance details

Defined in Mikan.Utils.Benchmark

a ~ Aspects => Pretty (DocTree a) Source # 
Instance details

Defined in Mikan.Syntax.Common.Pretty

Pretty n => Pretty (WithUniqueInt n) Source # 
Instance details

Defined in Mikan.Utils.Graph.AdjacencyMap.Unidirectional

Pretty a => Pretty (List1 a) Source # 
Instance details

Defined in Mikan.Syntax.Common.Pretty

Pretty a => Pretty (IntMap a) Source # 
Instance details

Defined in Mikan.Syntax.Common.Pretty

Pretty a => Pretty (Set a) Source # 
Instance details

Defined in Mikan.Syntax.Common.Pretty

Methods

pretty :: Set a -> Doc Source #

prettyPrec :: Int -> Set a -> Doc Source #

prettyList :: [Set a] -> Doc Source #

a ~ Aspects => Pretty (Doc a) Source # 
Instance details

Defined in Mikan.Syntax.Common.Pretty

Methods

pretty :: Doc a -> Doc Source #

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

prettyList :: [Doc a] -> Doc Source #

Pretty a => Pretty (Maybe a) Source # 
Instance details

Defined in Mikan.Syntax.Common.Pretty

Pretty a => Pretty (Maybe a) Source # 
Instance details

Defined in Mikan.Syntax.Common.Pretty

Pretty a => Pretty [a] Source # 
Instance details

Defined in Mikan.Syntax.Common.Pretty

Methods

pretty :: [a] -> Doc Source #

prettyPrec :: Int -> [a] -> Doc Source #

prettyList :: [[a]] -> Doc Source #

(Pretty a, Pretty b) => Pretty (OutputConstraint' a b) Source # 
Instance details

Defined in Mikan.Interaction.BasicOps

(Pretty a, Pretty b) => Pretty (OutputConstraint a b) Source # 
Instance details

Defined in Mikan.Interaction.BasicOps

(Pretty a, Pretty b) => Pretty (OutputForm a b) Source # 
Instance details

Defined in Mikan.Interaction.BasicOps

(Pretty a, Pretty b) => Pretty (ImportDirective' a b) Source # 
Instance details

Defined in Mikan.Syntax.Common

(Pretty a, Pretty b) => Pretty (ImportedName' a b) Source # 
Instance details

Defined in Mikan.Syntax.Common

(Pretty a, Pretty b) => Pretty (Renaming' a b) Source # 
Instance details

Defined in Mikan.Syntax.Common

(Pretty a, Pretty b) => Pretty (Using' a b) Source # 
Instance details

Defined in Mikan.Syntax.Common

Methods

pretty :: Using' a b -> Doc Source #

prettyPrec :: Int -> Using' a b -> Doc Source #

prettyList :: [Using' a b] -> Doc Source #

(Pretty t, Pretty e) => Pretty (Dom' t e) Source # 
Instance details

Defined in Mikan.Syntax.Internal.Dom

Methods

pretty :: Dom' t e -> Doc Source #

prettyPrec :: Int -> Dom' t e -> Doc Source #

prettyList :: [Dom' t e] -> Doc Source #

Pretty a => Pretty (NoSubst t a) Source # 
Instance details

Defined in Mikan.Syntax.Internal.Term

Methods

pretty :: NoSubst t a -> Doc Source #

prettyPrec :: Int -> NoSubst t a -> Doc Source #

prettyList :: [NoSubst t a] -> Doc Source #

(Integral i, HasZero b, Pretty b) => Pretty (Matrix i b) Source # 
Instance details

Defined in Mikan.Termination.SparseMatrix

Methods

pretty :: Matrix i b -> Doc Source #

prettyPrec :: Int -> Matrix i b -> Doc Source #

prettyList :: [Matrix i b] -> Doc Source #

(Pretty x, Pretty a) => Pretty (Boundary' x a) Source # 
Instance details

Defined in Mikan.TypeChecking.Telescope

(Pretty n, Pretty e) => Pretty (Edge n e) Source # 
Instance details

Defined in Mikan.Utils.Graph.AdjacencyMap.Unidirectional

Methods

pretty :: Edge n e -> Doc Source #

prettyPrec :: Int -> Edge n e -> Doc Source #

prettyList :: [Edge n e] -> Doc Source #

(Ord n, Pretty n, Pretty e) => Pretty (Graph n e) Source # 
Instance details

Defined in Mikan.Utils.Graph.AdjacencyMap.Unidirectional

Methods

pretty :: Graph n e -> Doc Source #

prettyPrec :: Int -> Graph n e -> Doc Source #

prettyList :: [Graph n e] -> Doc Source #

(Pretty k, Pretty v) => Pretty (Map k v) Source # 
Instance details

Defined in Mikan.Syntax.Common.Pretty

Methods

pretty :: Map k v -> Doc Source #

prettyPrec :: Int -> Map k v -> Doc Source #

prettyList :: [Map k v] -> Doc Source #

(Pretty a, Pretty b) => Pretty (Either a b) Source # 
Instance details

Defined in Mikan.Syntax.Concrete.Pretty

Methods

pretty :: Either a b -> Doc Source #

prettyPrec :: Int -> Either a b -> Doc Source #

prettyList :: [Either a b] -> Doc Source #

(Pretty a, Pretty b) => Pretty (a, b) Source # 
Instance details

Defined in Mikan.Syntax.Common.Pretty

Methods

pretty :: (a, b) -> Doc Source #

prettyPrec :: Int -> (a, b) -> Doc Source #

prettyList :: [(a, b)] -> Doc Source #

(Pretty nm, Pretty p, Pretty e) => Pretty (RewriteEqn' qn nm p e) Source # 
Instance details

Defined in Mikan.Syntax.Common

Methods

pretty :: RewriteEqn' qn nm p e -> Doc Source #

prettyPrec :: Int -> RewriteEqn' qn nm p e -> Doc Source #

prettyList :: [RewriteEqn' qn nm p e] -> Doc Source #

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

Above, except that if the last line of the first argument stops at least one position before the first line of the second begins, these two lines are overlapped. For example:

   text "hi" $$ nest 5 (text "there")

lays out as

   hi   there

rather than

   hi
        there

$$ is associative, with identity empty, and also satisfies

  • (x $$ y) <> z = x $$ (y <> z), if y non-empty.

($+$) :: Doc a -> Doc a -> Doc a infixl 5 #

Above, with no overlapping. $+$ is associative, with identity empty.

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

Beside, separated by space, unless one of the arguments is empty. <+> is associative, with identity empty.

cat :: [Doc a] -> Doc a #

Either hcat or vcat.

char :: Char -> Doc a #

A document of height and width 1, containing a literal character.

double #

Arguments

:: Double 
-> Doc a
double n = text (show n)

fcat :: [Doc a] -> Doc a #

"Paragraph fill" version of cat.

float #

Arguments

:: Float 
-> Doc a
float n = text (show n)

fullRender #

Arguments

:: Mode

Rendering mode.

-> Int

Line length.

-> Float

Ribbons per line.

-> (TextDetails -> a -> a)

What to do with text.

-> a

What to do at the end.

-> Doc b

The document.

-> a

Result.

The general rendering interface. Please refer to the Style and Mode types for a description of rendering mode, line length and ribbons.

fullRenderAnn #

Arguments

:: Mode

Rendering mode.

-> Int

Line length.

-> Float

Ribbons per line.

-> (AnnotDetails b -> a -> a)

What to do with text.

-> a

What to do at the end.

-> Doc b

The document.

-> a

Result.

The general rendering interface, supporting annotations. Please refer to the Style and Mode types for a description of rendering mode, line length and ribbons.

hang :: Doc a -> Int -> Doc a -> Doc a #

hang d1 n d2 = sep [d1, nest n d2]

int #

Arguments

:: Int 
-> Doc a
int n = text (show n)

integer #

Arguments

:: Integer 
-> Doc a
integer n = text (show n)

isEmpty :: Doc a -> Bool #

Returns True if the document is empty

nest :: Int -> Doc a -> Doc a #

Nest (or indent) a document by a given number of positions (which may also be negative). nest satisfies the laws:

The side condition on the last law is needed because empty is a left identity for <>.

ptext :: String -> Doc a #

Same as text. Used to be used for Bytestrings.

rational #

Arguments

:: Rational 
-> Doc a
rational n = text (show n)

render :: Doc a -> String #

Render the Doc to a String using the default Style (see style).

renderSpans :: Doc ann -> (String, [Span ann]) #

Render an annotated Doc to a String and list of annotations (see Span) using the default Style (see style).

renderStyle :: Style -> Doc a -> String #

Render the Doc to a String using the given Style.

sizedText :: Int -> String -> Doc a #

Some text with any width. (text s = sizedText (length s) s)

style :: Style #

The default style (mode=PageMode, lineLength=100, ribbonsPerLine=1.5).

text :: String -> Doc a #

A document of height 1 containing a literal string. text satisfies the following laws:

The side condition on the last law is necessary because text "" has height 1, while empty has no height.

zeroWidthText :: String -> Doc a #

Some text, but without any width. Use for non-printing text such as a HTML or Latex tags

data Mode #

Rendering mode.

Constructors

PageMode

Normal rendering (lineLength and ribbonsPerLine respected').

ZigZagMode

With zig-zag cuts.

LeftMode

No indentation, infinitely long lines (lineLength ignored), but explicit new lines, i.e., text "one" $$ text "two", are respected.

OneLineMode

All on one line, lineLength ignored and explicit new lines ($$) are turned into spaces.

Instances

Instances details
Generic Mode # 
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

Associated Types

type Rep Mode 
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

type Rep Mode = D1 ('MetaData "Mode" "Text.PrettyPrint.Annotated.HughesPJ" "pretty-1.1.3.6-04bd" 'False) ((C1 ('MetaCons "PageMode" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ZigZagMode" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "LeftMode" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "OneLineMode" 'PrefixI 'False) (U1 :: Type -> Type)))

Methods

from :: Mode -> Rep Mode x #

to :: Rep Mode x -> Mode #

Show Mode # 
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

Methods

showsPrec :: Int -> Mode -> ShowS #

show :: Mode -> String #

showList :: [Mode] -> ShowS #

Eq Mode # 
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

Methods

(==) :: Mode -> Mode -> Bool #

(/=) :: Mode -> Mode -> Bool #

type Rep Mode # 
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

type Rep Mode = D1 ('MetaData "Mode" "Text.PrettyPrint.Annotated.HughesPJ" "pretty-1.1.3.6-04bd" 'False) ((C1 ('MetaCons "PageMode" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ZigZagMode" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "LeftMode" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "OneLineMode" 'PrefixI 'False) (U1 :: Type -> Type)))

data Span a #

A Span represents the result of an annotation after a Doc has been rendered, capturing where the annotation now starts and ends in the rendered output.

Constructors

Span 

Fields

Instances

Instances details
Functor Span # 
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

Methods

fmap :: (a -> b) -> Span a -> Span b #

(<$) :: a -> Span b -> Span a #

Show a => Show (Span a) # 
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

Methods

showsPrec :: Int -> Span a -> ShowS #

show :: Span a -> String #

showList :: [Span a] -> ShowS #

Eq a => Eq (Span a) # 
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

Methods

(==) :: Span a -> Span a -> Bool #

(/=) :: Span a -> Span a -> Bool #

data Style #

A rendering style. Allows us to specify constraints to choose among the many different rendering options.

Constructors

Style 

Fields

  • mode :: Mode

    The rendering mode.

  • lineLength :: Int

    Maximum length of a line, in characters.

  • ribbonsPerLine :: Float

    Ratio of line length to ribbon length. A ribbon refers to the characters on a line excluding indentation. So a lineLength of 100, with a ribbonsPerLine of 2.0 would only allow up to 50 characters of ribbon to be displayed on a line, while allowing it to be indented up to 50 characters.

Instances

Instances details
Generic Style # 
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

Associated Types

type Rep Style 
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

type Rep Style = D1 ('MetaData "Style" "Text.PrettyPrint.Annotated.HughesPJ" "pretty-1.1.3.6-04bd" 'False) (C1 ('MetaCons "Style" 'PrefixI 'True) (S1 ('MetaSel ('Just "mode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Mode) :*: (S1 ('MetaSel ('Just "lineLength") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "ribbonsPerLine") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Float))))

Methods

from :: Style -> Rep Style x #

to :: Rep Style x -> Style #

Show Style # 
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

Methods

showsPrec :: Int -> Style -> ShowS #

show :: Style -> String #

showList :: [Style] -> ShowS #

Eq Style # 
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

Methods

(==) :: Style -> Style -> Bool #

(/=) :: Style -> Style -> Bool #

type Rep Style # 
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

type Rep Style = D1 ('MetaData "Style" "Text.PrettyPrint.Annotated.HughesPJ" "pretty-1.1.3.6-04bd" 'False) (C1 ('MetaCons "Style" 'PrefixI 'True) (S1 ('MetaSel ('Just "mode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Mode) :*: (S1 ('MetaSel ('Just "lineLength") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "ribbonsPerLine") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Float))))

pattern Chr :: !Char -> TextDetails #

A single Char fragment

pattern PStr :: String -> TextDetails #

Used to represent a Fast String fragment but now deprecated and identical to the Str constructor.