module UVMHS.Lib.Pretty.Doc where
import UVMHS.Core
import UVMHS.Lib.Pretty.Annotation
import UVMHS.Lib.Pretty.Color
import UVMHS.Lib.Pretty.Common
import UVMHS.Lib.Pretty.DocA
import UVMHS.Lib.Pretty.Shape
import UVMHS.Lib.Pretty.RenderUndertags
import UVMHS.Lib.TreeAnnote
import qualified GHC.Stack as Stack
import qualified Prelude as HS
data PrettyParams = PrettyParams
{ PrettyParams -> Formats
punctuationFormat ∷ Formats
, PrettyParams -> Formats
keywordFormat ∷ Formats
, PrettyParams -> Formats
constructorFormat ∷ Formats
, PrettyParams -> Formats
operatorFormat ∷ Formats
, PrettyParams -> Formats
primitiveFormat ∷ Formats
, PrettyParams -> Formats
binderFormat ∷ Formats
, PrettyParams -> Formats
literalFormat ∷ Formats
, PrettyParams -> Formats
highlightFormat ∷ Formats
, ∷ Formats
, ∷ Formats
, PrettyParams -> Formats
errorFormat ∷ Formats
, PrettyParams -> Formats
lineNumberFormat ∷ Formats
, PrettyParams -> Formats
annotationFormat ∷ Formats
, PrettyParams -> ℕ64
appLevel ∷ ℕ64
} deriving (PrettyParams -> PrettyParams -> Bool
(PrettyParams -> PrettyParams -> Bool)
-> (PrettyParams -> PrettyParams -> Bool) -> Eq PrettyParams
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PrettyParams -> PrettyParams -> Bool
== :: PrettyParams -> PrettyParams -> Bool
$c/= :: PrettyParams -> PrettyParams -> Bool
/= :: PrettyParams -> PrettyParams -> Bool
Eq,Eq PrettyParams
Eq PrettyParams =>
(PrettyParams -> PrettyParams -> Ordering)
-> (PrettyParams -> PrettyParams -> Bool)
-> (PrettyParams -> PrettyParams -> Bool)
-> (PrettyParams -> PrettyParams -> Bool)
-> (PrettyParams -> PrettyParams -> Bool)
-> (PrettyParams -> PrettyParams -> PrettyParams)
-> (PrettyParams -> PrettyParams -> PrettyParams)
-> Ord PrettyParams
PrettyParams -> PrettyParams -> Bool
PrettyParams -> PrettyParams -> Ordering
PrettyParams -> PrettyParams -> PrettyParams
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: PrettyParams -> PrettyParams -> Ordering
compare :: PrettyParams -> PrettyParams -> Ordering
$c< :: PrettyParams -> PrettyParams -> Bool
< :: PrettyParams -> PrettyParams -> Bool
$c<= :: PrettyParams -> PrettyParams -> Bool
<= :: PrettyParams -> PrettyParams -> Bool
$c> :: PrettyParams -> PrettyParams -> Bool
> :: PrettyParams -> PrettyParams -> Bool
$c>= :: PrettyParams -> PrettyParams -> Bool
>= :: PrettyParams -> PrettyParams -> Bool
$cmax :: PrettyParams -> PrettyParams -> PrettyParams
max :: PrettyParams -> PrettyParams -> PrettyParams
$cmin :: PrettyParams -> PrettyParams -> PrettyParams
min :: PrettyParams -> PrettyParams -> PrettyParams
Ord,Int -> PrettyParams -> ShowS
[PrettyParams] -> ShowS
PrettyParams -> String
(Int -> PrettyParams -> ShowS)
-> (PrettyParams -> String)
-> ([PrettyParams] -> ShowS)
-> Show PrettyParams
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PrettyParams -> ShowS
showsPrec :: Int -> PrettyParams -> ShowS
$cshow :: PrettyParams -> String
show :: PrettyParams -> String
$cshowList :: [PrettyParams] -> ShowS
showList :: [PrettyParams] -> ShowS
Show)
prettyParams₀ ∷ PrettyParams
prettyParams₀ :: PrettyParams
prettyParams₀ = PrettyParams
{ punctuationFormat :: Formats
punctuationFormat = [Format] -> Formats
forall t. ToIter Format t => t -> Formats
formats [Color -> Format
FG Color
grayDark]
, keywordFormat :: Formats
keywordFormat = [Format] -> Formats
forall t. ToIter Format t => t -> Formats
formats [Format
BD,Color -> Format
FG Color
yellow]
, constructorFormat :: Formats
constructorFormat = [Format] -> Formats
forall t. ToIter Format t => t -> Formats
formats [Format
BD,Color -> Format
FG Color
green]
, operatorFormat :: Formats
operatorFormat = [Format] -> Formats
forall t. ToIter Format t => t -> Formats
formats [Color -> Format
FG Color
teal]
, primitiveFormat :: Formats
primitiveFormat = [Format] -> Formats
forall t. ToIter Format t => t -> Formats
formats [Color -> Format
FG Color
green]
, binderFormat :: Formats
binderFormat = [Format] -> Formats
forall t. ToIter Format t => t -> Formats
formats [Color -> Format
FG Color
blue]
, literalFormat :: Formats
literalFormat = [Format] -> Formats
forall t. ToIter Format t => t -> Formats
formats [Color -> Format
FG Color
red]
, highlightFormat :: Formats
highlightFormat = [Format] -> Formats
forall t. ToIter Format t => t -> Formats
formats [Color -> Format
BG Color
highlight]
, headerFormat :: Formats
headerFormat = [Format] -> Formats
forall t. ToIter Format t => t -> Formats
formats [Format
BD,Format
UL,Color -> Format
FG Color
pink]
, commentFormat :: Formats
commentFormat = [Format] -> Formats
forall t. ToIter Format t => t -> Formats
formats [Format
IT,Color -> Format
FG Color
grayLight]
, errorFormat :: Formats
errorFormat = [Format] -> Formats
forall t. ToIter Format t => t -> Formats
formats [Color -> Format
FG Color
white,Color -> Format
BG Color
red]
, lineNumberFormat :: Formats
lineNumberFormat = [Format] -> Formats
forall t. ToIter Format t => t -> Formats
formats [Color -> Format
FG Color
grayLight]
, annotationFormat :: Formats
annotationFormat = [Format] -> Formats
forall t. ToIter Format t => t -> Formats
formats [Color -> Format
BG Color
grayLight]
, appLevel :: ℕ64
appLevel = ℕ -> ℕ64
𝕟64 ℕ
100
}
data DocEnv = DocEnv
{ DocEnv -> PrettyParams
docEnvPrettyParams ∷ PrettyParams
, DocEnv -> ℕ64
docEnvPrecLevel ∷ ℕ64
, DocEnv -> Bool
docEnvPrecBumped ∷ 𝔹
} deriving (DocEnv -> DocEnv -> Bool
(DocEnv -> DocEnv -> Bool)
-> (DocEnv -> DocEnv -> Bool) -> Eq DocEnv
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DocEnv -> DocEnv -> Bool
== :: DocEnv -> DocEnv -> Bool
$c/= :: DocEnv -> DocEnv -> Bool
/= :: DocEnv -> DocEnv -> Bool
Eq,Eq DocEnv
Eq DocEnv =>
(DocEnv -> DocEnv -> Ordering)
-> (DocEnv -> DocEnv -> Bool)
-> (DocEnv -> DocEnv -> Bool)
-> (DocEnv -> DocEnv -> Bool)
-> (DocEnv -> DocEnv -> Bool)
-> (DocEnv -> DocEnv -> DocEnv)
-> (DocEnv -> DocEnv -> DocEnv)
-> Ord DocEnv
DocEnv -> DocEnv -> Bool
DocEnv -> DocEnv -> Ordering
DocEnv -> DocEnv -> DocEnv
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: DocEnv -> DocEnv -> Ordering
compare :: DocEnv -> DocEnv -> Ordering
$c< :: DocEnv -> DocEnv -> Bool
< :: DocEnv -> DocEnv -> Bool
$c<= :: DocEnv -> DocEnv -> Bool
<= :: DocEnv -> DocEnv -> Bool
$c> :: DocEnv -> DocEnv -> Bool
> :: DocEnv -> DocEnv -> Bool
$c>= :: DocEnv -> DocEnv -> Bool
>= :: DocEnv -> DocEnv -> Bool
$cmax :: DocEnv -> DocEnv -> DocEnv
max :: DocEnv -> DocEnv -> DocEnv
$cmin :: DocEnv -> DocEnv -> DocEnv
min :: DocEnv -> DocEnv -> DocEnv
Ord,Int -> DocEnv -> ShowS
[DocEnv] -> ShowS
DocEnv -> String
(Int -> DocEnv -> ShowS)
-> (DocEnv -> String) -> ([DocEnv] -> ShowS) -> Show DocEnv
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DocEnv -> ShowS
showsPrec :: Int -> DocEnv -> ShowS
$cshow :: DocEnv -> String
show :: DocEnv -> String
$cshowList :: [DocEnv] -> ShowS
showList :: [DocEnv] -> ShowS
Show)
makeLenses ''DocEnv
docEnv₀ ∷ DocEnv
docEnv₀ :: DocEnv
docEnv₀ = DocEnv
{ docEnvPrettyParams :: PrettyParams
docEnvPrettyParams = PrettyParams
prettyParams₀
, docEnvPrecLevel :: ℕ64
docEnvPrecLevel = ℕ -> ℕ64
𝕟64 ℕ
0
, docEnvPrecBumped :: Bool
docEnvPrecBumped = Bool
False
}
type DocM = RWS DocEnv DocA ()
newtype Doc = Doc { Doc -> DocM ()
unDoc ∷ DocM () }
execDocWith ∷ (DocM () → DocM ()) → Doc → DocA
execDocWith :: (DocM () -> DocM ()) -> Doc -> DocA
execDocWith DocM () -> DocM ()
f = DocEnv -> () -> RWS DocEnv DocA () DocA -> DocA
forall r o s a. r -> s -> RWS r o s a -> a
evalRWS DocEnv
docEnv₀ () (RWS DocEnv DocA () DocA -> DocA)
-> (DocM () -> RWS DocEnv DocA () DocA) -> DocM () -> DocA
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ DocM () -> RWS DocEnv DocA () DocA
forall o (m :: * -> *) a. (Monad m, MonadWriter o m) => m a -> m o
retOut (DocM () -> DocA) -> (DocM () -> DocM ()) -> DocM () -> DocA
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ DocM () -> DocM ()
f (DocM () -> DocA) -> (Doc -> DocM ()) -> Doc -> DocA
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ Doc -> DocM ()
unDoc
execDoc ∷ Doc → DocA
execDoc :: Doc -> DocA
execDoc = (DocM () -> DocM ()) -> Doc -> DocA
execDocWith DocM () -> DocM ()
forall a. a -> a
id
onDoc ∷ (DocM () → DocM ()) → Doc → Doc
onDoc :: (DocM () -> DocM ()) -> Doc -> Doc
onDoc DocM () -> DocM ()
f (Doc DocM ()
xM) = DocM () -> Doc
Doc (DocM () -> Doc) -> DocM () -> Doc
forall a b. (a -> b) -> a -> b
$ DocM () -> DocM ()
f DocM ()
xM
onDoc2 ∷ (DocM () → DocM () → DocM ()) → Doc → Doc → Doc
onDoc2 :: (DocM () -> DocM () -> DocM ()) -> Doc -> Doc -> Doc
onDoc2 DocM () -> DocM () -> DocM ()
f (Doc DocM ()
xM₁) (Doc DocM ()
xM₂) = DocM () -> Doc
Doc (DocM () -> Doc) -> DocM () -> Doc
forall a b. (a -> b) -> a -> b
$ DocM () -> DocM () -> DocM ()
f DocM ()
xM₁ DocM ()
xM₂
instance Null Doc where null :: Doc
null = DocM () -> Doc
Doc DocM ()
forall (m :: * -> *). Return m => m ()
skip
instance Append Doc where ⧺ :: Doc -> Doc -> Doc
(⧺) = (DocM () -> DocM () -> DocM ()) -> Doc -> Doc -> Doc
onDoc2 DocM () -> DocM () -> DocM ()
forall (m :: * -> *) a b. Bind m => m a -> m b -> m b
(≫)
instance Monoid Doc
docShape ∷ Doc → ShapeA
docShape :: Doc -> ShapeA
docShape = SummaryI -> ShapeA
summaryIShape (SummaryI -> ShapeA) -> (DocA -> SummaryI) -> DocA -> ShapeA
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ DocA -> SummaryI
staticDocA (DocA -> ShapeA) -> (Doc -> DocA) -> Doc -> ShapeA
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ Doc -> DocA
execDoc
ppForceBreak ∷ Doc
ppForceBreak :: Doc
ppForceBreak = DocM () -> Doc
Doc (DocM () -> Doc) -> DocM () -> Doc
forall a b. (a -> b) -> a -> b
$ DocA -> DocM ()
forall o (m :: * -> *). MonadWriter o m => o -> m ()
tell (DocA -> DocM ()) -> DocA -> DocM ()
forall a b. (a -> b) -> a -> b
$ SummaryI -> DocA
StaticDocA (SummaryI -> DocA) -> SummaryI -> DocA
forall a b. (a -> b) -> a -> b
$ Bool -> ShapeA -> TreeI -> SummaryI
SummaryI Bool
True ShapeA
forall a. Null a => a
null TreeI
forall a. Null a => a
null
ppWithForcedBreak ∷ Doc → Doc
ppWithForcedBreak :: Doc -> Doc
ppWithForcedBreak Doc
d = Doc
ppForceBreak Doc -> Doc -> Doc
forall a. Append a => a -> a -> a
⧺ Doc
d
ppAnnotate ∷ Annotation → Doc → Doc
ppAnnotate :: Annotation -> Doc -> Doc
ppAnnotate = (DocM () -> DocM ()) -> Doc -> Doc
onDoc ((DocM () -> DocM ()) -> Doc -> Doc)
-> ((DocA -> DocA) -> DocM () -> DocM ())
-> (DocA -> DocA)
-> Doc
-> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ (DocA -> DocA) -> DocM () -> DocM ()
forall (m :: * -> *) o a.
(Monad m, MonadWriter o m) =>
(o -> o) -> m a -> m a
mapOut ((DocA -> DocA) -> Doc -> Doc)
-> (Annotation -> DocA -> DocA) -> Annotation -> Doc -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ Annotation -> DocA -> DocA
annotateDocA
ppFormat ∷ Formats → Doc → Doc
ppFormat :: Formats -> Doc -> Doc
ppFormat = Annotation -> Doc -> Doc
ppAnnotate (Annotation -> Doc -> Doc)
-> (Formats -> Annotation) -> Formats -> Doc -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ Formats -> Annotation
formatAnnotation
ppFormatParam ∷ PrettyParams ⟢ Formats → Doc → Doc
ppFormatParam :: (PrettyParams ⟢ Formats) -> Doc -> Doc
ppFormatParam PrettyParams ⟢ Formats
l Doc
d = DocM () -> Doc
Doc (DocM () -> Doc) -> DocM () -> Doc
forall a b. (a -> b) -> a -> b
$ do
Formats
fmt ← (DocEnv ⟢ Formats) -> RWST DocEnv DocA () ID Formats
forall r'. (DocEnv ⟢ r') -> RWST DocEnv DocA () ID r'
forall r (m :: * -> *) r'. MonadReader r m => (r ⟢ r') -> m r'
askL ((DocEnv ⟢ Formats) -> RWST DocEnv DocA () ID Formats)
-> (DocEnv ⟢ Formats) -> RWST DocEnv DocA () ID Formats
forall a b. (a -> b) -> a -> b
$ PrettyParams ⟢ Formats
l (PrettyParams ⟢ Formats)
-> (DocEnv ⟢ PrettyParams) -> DocEnv ⟢ Formats
forall b c a. (b ⟢ c) -> (a ⟢ b) -> a ⟢ c
forall {k} (t :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Transitive t =>
t b c -> t a b -> t a c
⊚ DocEnv ⟢ PrettyParams
docEnvPrettyParamsL
Doc -> DocM ()
unDoc (Doc -> DocM ()) -> Doc -> DocM ()
forall a b. (a -> b) -> a -> b
$ Formats -> Doc -> Doc
ppFormat Formats
fmt Doc
d
ppUndertag ∷ ℂ → Formats → Doc → Doc
ppUndertag :: ℂ -> Formats -> Doc -> Doc
ppUndertag = Annotation -> Doc -> Doc
ppAnnotate (Annotation -> Doc -> Doc)
-> (ℂ -> Formats -> Annotation) -> ℂ -> Formats -> Doc -> Doc
forall c d a b. (c -> d) -> (a -> b -> c) -> a -> b -> d
∘∘ ℂ -> Formats -> Annotation
undertagAnnotation
ppGroup ∷ Doc → Doc
ppGroup :: Doc -> Doc
ppGroup = (DocM () -> DocM ()) -> Doc -> Doc
onDoc ((DocM () -> DocM ()) -> Doc -> Doc)
-> (DocM () -> DocM ()) -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ (DocA -> DocA) -> DocM () -> DocM ()
forall (m :: * -> *) o a.
(Monad m, MonadWriter o m) =>
(o -> o) -> m a -> m a
mapOut DocA -> DocA
groupDocA
ppAlign ∷ Doc → Doc
ppAlign :: Doc -> Doc
ppAlign = (DocM () -> DocM ()) -> Doc -> Doc
onDoc ((DocM () -> DocM ()) -> Doc -> Doc)
-> (DocM () -> DocM ()) -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ (DocA -> DocA) -> DocM () -> DocM ()
forall (m :: * -> *) o a.
(Monad m, MonadWriter o m) =>
(o -> o) -> m a -> m a
mapOut DocA -> DocA
alignDocA
ppGA ∷ Doc → Doc
ppGA :: Doc -> Doc
ppGA = Doc -> Doc
ppAlign (Doc -> Doc) -> (Doc -> Doc) -> Doc -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ Doc -> Doc
ppGroup
ppString ∷ 𝕊 → Doc
ppString :: 𝕊 -> Doc
ppString = DocM () -> Doc
Doc (DocM () -> Doc) -> (DocA -> DocM ()) -> DocA -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ DocA -> DocM ()
forall o (m :: * -> *). MonadWriter o m => o -> m ()
tell (DocA -> Doc) -> (𝕊 -> DocA) -> 𝕊 -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ 𝕊 -> DocA
stringDocA
ppStringModal ∷ 𝕊 → 𝕊 → Doc
ppStringModal :: 𝕊 -> 𝕊 -> Doc
ppStringModal 𝕊
sf 𝕊
sb = Doc -> Doc -> Doc
ppModal (𝕊 -> Doc
ppString 𝕊
sf) (Doc -> Doc) -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ 𝕊 -> Doc
ppString 𝕊
sb
ppModal ∷ Doc → Doc → Doc
ppModal :: Doc -> Doc -> Doc
ppModal Doc
d₁ Doc
d₂ = DocM () -> Doc
Doc (DocM () -> Doc) -> DocM () -> Doc
forall a b. (a -> b) -> a -> b
$ do
DocA
da₁ ← DocM () -> RWS DocEnv DocA () DocA
forall o (m :: * -> *) a. (Monad m, MonadWriter o m) => m a -> m o
retOut (DocM () -> RWS DocEnv DocA () DocA)
-> DocM () -> RWS DocEnv DocA () DocA
forall a b. (a -> b) -> a -> b
$ Doc -> DocM ()
unDoc Doc
d₁
DocA
da₂ ← DocM () -> RWS DocEnv DocA () DocA
forall o (m :: * -> *) a. (Monad m, MonadWriter o m) => m a -> m o
retOut (DocM () -> RWS DocEnv DocA () DocA)
-> DocM () -> RWS DocEnv DocA () DocA
forall a b. (a -> b) -> a -> b
$ Doc -> DocM ()
unDoc Doc
d₂
DocA -> DocM ()
forall o (m :: * -> *). MonadWriter o m => o -> m ()
tell (DocA -> DocM ()) -> DocA -> DocM ()
forall a b. (a -> b) -> a -> b
$ DocA -> DocA -> DocA
docAModal DocA
da₁ DocA
da₂
ppFG ∷ Color → Doc → Doc
ppFG :: Color -> Doc -> Doc
ppFG Color
c = Formats -> Doc -> Doc
ppFormat (Formats -> Doc -> Doc) -> Formats -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ [Format] -> Formats
forall t. ToIter Format t => t -> Formats
formats [Color -> Format
FG Color
c]
ppBG ∷ Color → Doc → Doc
ppBG :: Color -> Doc -> Doc
ppBG Color
c = Formats -> Doc -> Doc
ppFormat (Formats -> Doc -> Doc) -> Formats -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ [Format] -> Formats
forall t. ToIter Format t => t -> Formats
formats [Color -> Format
BG Color
c]
ppUL ∷ Doc → Doc
ppUL :: Doc -> Doc
ppUL = Formats -> Doc -> Doc
ppFormat (Formats -> Doc -> Doc) -> Formats -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ [Format] -> Formats
forall t. ToIter Format t => t -> Formats
formats [Format
UL]
ppBD ∷ Doc → Doc
ppBD :: Doc -> Doc
ppBD = Formats -> Doc -> Doc
ppFormat (Formats -> Doc -> Doc) -> Formats -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ [Format] -> Formats
forall t. ToIter Format t => t -> Formats
formats [Format
BD]
ppIT ∷ Doc → Doc
ppIT :: Doc -> Doc
ppIT = Formats -> Doc -> Doc
ppFormat (Formats -> Doc -> Doc) -> Formats -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ [Format] -> Formats
forall t. ToIter Format t => t -> Formats
formats [Format
IT]
ppUT ∷ ℂ → Color → Doc → Doc
ppUT :: ℂ -> Color -> Doc -> Doc
ppUT ℂ
c Color
o = ℂ -> Formats -> Doc -> Doc
ppUndertag ℂ
c ([Format] -> Formats
forall t. ToIter Format t => t -> Formats
formats [Color -> Format
FG Color
o])
ppPunFmt ∷ Doc → Doc
ppPunFmt :: Doc -> Doc
ppPunFmt = (PrettyParams ⟢ Formats) -> Doc -> Doc
ppFormatParam PrettyParams ⟢ Formats
punctuationFormatL
ppPun ∷ 𝕊 → Doc
ppPun :: 𝕊 -> Doc
ppPun = Doc -> Doc
ppPunFmt (Doc -> Doc) -> (𝕊 -> Doc) -> 𝕊 -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ 𝕊 -> Doc
ppString
ppKeyFmt ∷ Doc → Doc
ppKeyFmt :: Doc -> Doc
ppKeyFmt = (PrettyParams ⟢ Formats) -> Doc -> Doc
ppFormatParam PrettyParams ⟢ Formats
keywordFormatL
ppKey ∷ 𝕊 → Doc
ppKey :: 𝕊 -> Doc
ppKey = Doc -> Doc
ppKeyFmt (Doc -> Doc) -> (𝕊 -> Doc) -> 𝕊 -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ 𝕊 -> Doc
ppString
ppConFmt ∷ Doc → Doc
ppConFmt :: Doc -> Doc
ppConFmt = (PrettyParams ⟢ Formats) -> Doc -> Doc
ppFormatParam PrettyParams ⟢ Formats
constructorFormatL
ppCon ∷ 𝕊 → Doc
ppCon :: 𝕊 -> Doc
ppCon = Doc -> Doc
ppConFmt (Doc -> Doc) -> (𝕊 -> Doc) -> 𝕊 -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ 𝕊 -> Doc
ppString
ppOpFmt ∷ Doc → Doc
ppOpFmt :: Doc -> Doc
ppOpFmt = (PrettyParams ⟢ Formats) -> Doc -> Doc
ppFormatParam PrettyParams ⟢ Formats
operatorFormatL
ppOp ∷ 𝕊 → Doc
ppOp :: 𝕊 -> Doc
ppOp = Doc -> Doc
ppOpFmt (Doc -> Doc) -> (𝕊 -> Doc) -> 𝕊 -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ 𝕊 -> Doc
ppString
ppPrimFmt ∷ Doc → Doc
ppPrimFmt :: Doc -> Doc
ppPrimFmt = (PrettyParams ⟢ Formats) -> Doc -> Doc
ppFormatParam PrettyParams ⟢ Formats
primitiveFormatL
ppPrim ∷ 𝕊 → Doc
ppPrim :: 𝕊 -> Doc
ppPrim = Doc -> Doc
ppPrimFmt (Doc -> Doc) -> (𝕊 -> Doc) -> 𝕊 -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ 𝕊 -> Doc
ppString
ppBdrFmt ∷ Doc → Doc
ppBdrFmt :: Doc -> Doc
ppBdrFmt = (PrettyParams ⟢ Formats) -> Doc -> Doc
ppFormatParam PrettyParams ⟢ Formats
binderFormatL
ppBdr ∷ 𝕊 → Doc
ppBdr :: 𝕊 -> Doc
ppBdr = Doc -> Doc
ppBdrFmt (Doc -> Doc) -> (𝕊 -> Doc) -> 𝕊 -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ 𝕊 -> Doc
ppString
ppLitFmt ∷ Doc → Doc
ppLitFmt :: Doc -> Doc
ppLitFmt = (PrettyParams ⟢ Formats) -> Doc -> Doc
ppFormatParam PrettyParams ⟢ Formats
literalFormatL
ppLit ∷ 𝕊 → Doc
ppLit :: 𝕊 -> Doc
ppLit = Doc -> Doc
ppLitFmt (Doc -> Doc) -> (𝕊 -> Doc) -> 𝕊 -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ 𝕊 -> Doc
ppString
ppHlFmt ∷ Doc → Doc
ppHlFmt :: Doc -> Doc
ppHlFmt = (PrettyParams ⟢ Formats) -> Doc -> Doc
ppFormatParam PrettyParams ⟢ Formats
highlightFormatL
ppHl ∷ 𝕊 → Doc
ppHl :: 𝕊 -> Doc
ppHl = Doc -> Doc
ppHlFmt (Doc -> Doc) -> (𝕊 -> Doc) -> 𝕊 -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ 𝕊 -> Doc
ppString
ppHeaderFmt ∷ Doc → Doc
= (PrettyParams ⟢ Formats) -> Doc -> Doc
ppFormatParam PrettyParams ⟢ Formats
headerFormatL
ppHeader ∷ 𝕊 → Doc
= Doc -> Doc
ppHeaderFmt (Doc -> Doc) -> (𝕊 -> Doc) -> 𝕊 -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ 𝕊 -> Doc
ppString
ppCommentFmt ∷ Doc → Doc
= (PrettyParams ⟢ Formats) -> Doc -> Doc
ppFormatParam PrettyParams ⟢ Formats
commentFormatL
ppComment ∷ 𝕊 → Doc
= Doc -> Doc
ppCommentFmt (Doc -> Doc) -> (𝕊 -> Doc) -> 𝕊 -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ 𝕊 -> Doc
ppString
ppErrFmt ∷ Doc → Doc
ppErrFmt :: Doc -> Doc
ppErrFmt = (PrettyParams ⟢ Formats) -> Doc -> Doc
ppFormatParam PrettyParams ⟢ Formats
errorFormatL
ppErr ∷ 𝕊 → Doc
ppErr :: 𝕊 -> Doc
ppErr = Doc -> Doc
ppErrFmt (Doc -> Doc) -> (𝕊 -> Doc) -> 𝕊 -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ 𝕊 -> Doc
ppString
ppLineNumFmt ∷ Doc → Doc
ppLineNumFmt :: Doc -> Doc
ppLineNumFmt = (PrettyParams ⟢ Formats) -> Doc -> Doc
ppFormatParam PrettyParams ⟢ Formats
lineNumberFormatL
ppLineNum ∷ 𝕊 → Doc
ppLineNum :: 𝕊 -> Doc
ppLineNum = Doc -> Doc
ppLineNumFmt (Doc -> Doc) -> (𝕊 -> Doc) -> 𝕊 -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ 𝕊 -> Doc
ppString
ppAnnotation ∷ Doc → Doc
ppAnnotation :: Doc -> Doc
ppAnnotation = (PrettyParams ⟢ Formats) -> Doc -> Doc
ppFormatParam PrettyParams ⟢ Formats
annotationFormatL
ppCxt ∷ 𝕊 → Doc → Doc
ppCxt :: 𝕊 -> Doc -> Doc
ppCxt 𝕊
k Doc
v = [Doc] -> Doc
forall t. ToIter Doc t => t -> Doc
ppHorizontal
[ Color -> Doc -> Doc
ppFG Color
teal (Doc -> Doc) -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ Doc -> Doc
ppBD (Doc -> Doc) -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ 𝕊 -> Doc
ppString 𝕊
k
, Doc -> Doc
ppGA Doc
v
]
ppSpace ∷ ℕ64 → Doc
ppSpace :: ℕ64 -> Doc
ppSpace ℕ64
n = 𝕊 -> Doc
ppString (𝕊 -> Doc) -> 𝕊 -> Doc
forall a b. (a -> b) -> a -> b
$ 𝐼 ℂ -> 𝕊
forall t. ToIter ℂ t => t -> 𝕊
string (𝐼 ℂ -> 𝕊) -> 𝐼 ℂ -> 𝕊
forall a b. (a -> b) -> a -> b
$ ℕ64 -> ℂ -> 𝐼 ℂ
forall n a. (Eq n, Zero n, One n, Plus n) => n -> a -> 𝐼 a
replicate ℕ64
n ℂ
' '
ppNewline ∷ Doc
ppNewline :: Doc
ppNewline = 𝕊 -> Doc
ppString 𝕊
"\n"
ppIndented ∷ Doc → Doc
ppIndented :: Doc -> Doc
ppIndented Doc
d = [Doc] -> Doc
forall a t. (Monoid a, ToIter a t) => t -> a
concat
[ ℕ64 -> Doc
ppSpace ℕ64
2
, Doc -> Doc
ppGA Doc
d
]
ppSpaceIfBreak ∷ Doc
ppSpaceIfBreak :: Doc
ppSpaceIfBreak = 𝕊 -> 𝕊 -> Doc
ppStringModal 𝕊
"" 𝕊
" "
ppSpaceIfNoBreak ∷ Doc
ppSpaceIfNoBreak :: Doc
ppSpaceIfNoBreak = 𝕊 -> 𝕊 -> Doc
ppStringModal 𝕊
" " 𝕊
""
ppNewlineIfBreak ∷ Doc
ppNewlineIfBreak :: Doc
ppNewlineIfBreak = 𝕊 -> 𝕊 -> Doc
ppStringModal 𝕊
"" 𝕊
"\n"
ppSpaceNewlineIfBreak ∷ Doc
ppSpaceNewlineIfBreak :: Doc
ppSpaceNewlineIfBreak = 𝕊 -> 𝕊 -> Doc
ppStringModal 𝕊
" " 𝕊
"\n"
ppHangIfBreak ∷ Doc → Doc
ppHangIfBreak :: Doc -> Doc
ppHangIfBreak Doc
d = [Doc] -> Doc
forall a t. (Monoid a, ToIter a t) => t -> a
concat
[ Doc
ppNewlineIfBreak
, Doc
ppSpaceIfBreak
, Doc
ppSpaceIfBreak
, Doc -> Doc
ppGA Doc
d
]
ppHorizontal ∷ (ToIter Doc t) ⇒ t → Doc
ppHorizontal :: forall t. ToIter Doc t => t -> Doc
ppHorizontal = 𝐼 Doc -> Doc
forall a t. (Monoid a, ToIter a t) => t -> a
concat (𝐼 Doc -> Doc) -> (𝐼 Doc -> 𝐼 Doc) -> 𝐼 Doc -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ Doc -> 𝐼 Doc -> 𝐼 Doc
forall a t. ToIter a t => a -> t -> 𝐼 a
inbetween (ℕ64 -> Doc
ppSpace (ℕ64 -> Doc) -> ℕ64 -> Doc
forall a b. (a -> b) -> a -> b
$ ℕ -> ℕ64
𝕟64 ℕ
1) (𝐼 Doc -> Doc) -> (t -> 𝐼 Doc) -> t -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ t -> 𝐼 Doc
forall a t. ToIter a t => t -> 𝐼 a
iter
ppVertical ∷ (ToIter Doc t) ⇒ t → Doc
ppVertical :: forall t. ToIter Doc t => t -> Doc
ppVertical = 𝐼 Doc -> Doc
forall a t. (Monoid a, ToIter a t) => t -> a
concat (𝐼 Doc -> Doc) -> (𝐼 Doc -> 𝐼 Doc) -> 𝐼 Doc -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ Doc -> 𝐼 Doc -> 𝐼 Doc
forall a t. ToIter a t => a -> t -> 𝐼 a
inbetween Doc
ppNewline (𝐼 Doc -> Doc) -> (t -> 𝐼 Doc) -> t -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ t -> 𝐼 Doc
forall a t. ToIter a t => t -> 𝐼 a
iter
ppSeparated ∷ (ToIter Doc t) ⇒ t → Doc
ppSeparated :: forall t. ToIter Doc t => t -> Doc
ppSeparated = Doc -> Doc
ppGroup (Doc -> Doc) -> (𝐼 Doc -> Doc) -> 𝐼 Doc -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ 𝐼 Doc -> Doc
forall a t. (Monoid a, ToIter a t) => t -> a
concat (𝐼 Doc -> Doc) -> (𝐼 Doc -> 𝐼 Doc) -> 𝐼 Doc -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ Doc -> 𝐼 Doc -> 𝐼 Doc
forall a t. ToIter a t => a -> t -> 𝐼 a
inbetween Doc
ppSpaceNewlineIfBreak (𝐼 Doc -> Doc) -> (t -> 𝐼 Doc) -> t -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ t -> 𝐼 Doc
forall a t. ToIter a t => t -> 𝐼 a
iter
ppSetLevel ∷ ℕ64 → Doc → Doc
ppSetLevel :: ℕ64 -> Doc -> Doc
ppSetLevel ℕ64
n = (DocM () -> DocM ()) -> Doc -> Doc
onDoc ((DocM () -> DocM ()) -> Doc -> Doc)
-> (DocM () -> DocM ()) -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ (DocEnv -> DocEnv) -> DocM () -> DocM ()
forall (m :: * -> *) r a.
(Monad m, MonadReader r m) =>
(r -> r) -> m a -> m a
mapEnv ((DocEnv -> DocEnv) -> DocM () -> DocM ())
-> (DocEnv -> DocEnv) -> DocM () -> DocM ()
forall a b. (a -> b) -> a -> b
$ (DocEnv ⟢ ℕ64) -> ℕ64 -> DocEnv -> DocEnv
forall (t :: * -> * -> *) a b. Alter t => t a b -> b -> a -> a
update DocEnv ⟢ ℕ64
docEnvPrecLevelL ℕ64
n (DocEnv -> DocEnv) -> (DocEnv -> DocEnv) -> DocEnv -> DocEnv
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ (DocEnv ⟢ Bool) -> Bool -> DocEnv -> DocEnv
forall (t :: * -> * -> *) a b. Alter t => t a b -> b -> a -> a
update DocEnv ⟢ Bool
docEnvPrecBumpedL Bool
False
ppSetBotLevel ∷ Doc → Doc
ppSetBotLevel :: Doc -> Doc
ppSetBotLevel = ℕ64 -> Doc -> Doc
ppSetLevel ℕ64
forall a. Zero a => a
zero
ppBump ∷ Doc → Doc
ppBump :: Doc -> Doc
ppBump = (DocM () -> DocM ()) -> Doc -> Doc
onDoc ((DocM () -> DocM ()) -> Doc -> Doc)
-> (DocM () -> DocM ()) -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ (DocEnv -> DocEnv) -> DocM () -> DocM ()
forall (m :: * -> *) r a.
(Monad m, MonadReader r m) =>
(r -> r) -> m a -> m a
mapEnv ((DocEnv -> DocEnv) -> DocM () -> DocM ())
-> (DocEnv -> DocEnv) -> DocM () -> DocM ()
forall a b. (a -> b) -> a -> b
$ (DocEnv ⟢ Bool) -> Bool -> DocEnv -> DocEnv
forall (t :: * -> * -> *) a b. Alter t => t a b -> b -> a -> a
update DocEnv ⟢ Bool
docEnvPrecBumpedL Bool
True
ppClosed ∷ Doc → Doc → Doc → Doc
ppClosed :: Doc -> Doc -> Doc -> Doc
ppClosed Doc
alM Doc
arM Doc
aM = Doc -> Doc
ppSetBotLevel (Doc -> Doc) -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ [Doc] -> Doc
forall a t. (Monoid a, ToIter a t) => t -> a
concat
[ Doc
alM
, Doc -> Doc
ppGA Doc
aM
, Doc
arM
]
ppParens ∷ Doc → Doc
ppParens :: Doc -> Doc
ppParens = Doc -> Doc -> Doc -> Doc
ppClosed (𝕊 -> Doc
ppPun 𝕊
"(") (𝕊 -> Doc
ppPun 𝕊
")")
ppLevel ∷ ℕ64 → Doc → Doc
ppLevel :: ℕ64 -> Doc -> Doc
ppLevel ℕ64
i' Doc
aM = DocM () -> Doc
Doc (DocM () -> Doc) -> DocM () -> Doc
forall a b. (a -> b) -> a -> b
$ do
ℕ64
i ← (DocEnv ⟢ ℕ64) -> RWST DocEnv DocA () ID ℕ64
forall r'. (DocEnv ⟢ r') -> RWST DocEnv DocA () ID r'
forall r (m :: * -> *) r'. MonadReader r m => (r ⟢ r') -> m r'
askL ((DocEnv ⟢ ℕ64) -> RWST DocEnv DocA () ID ℕ64)
-> (DocEnv ⟢ ℕ64) -> RWST DocEnv DocA () ID ℕ64
forall a b. (a -> b) -> a -> b
$ DocEnv ⟢ ℕ64
docEnvPrecLevelL
Bool
b ← (DocEnv ⟢ Bool) -> RWST DocEnv DocA () ID Bool
forall r'. (DocEnv ⟢ r') -> RWST DocEnv DocA () ID r'
forall r (m :: * -> *) r'. MonadReader r m => (r ⟢ r') -> m r'
askL ((DocEnv ⟢ Bool) -> RWST DocEnv DocA () ID Bool)
-> (DocEnv ⟢ Bool) -> RWST DocEnv DocA () ID Bool
forall a b. (a -> b) -> a -> b
$ DocEnv ⟢ Bool
docEnvPrecBumpedL
Doc -> DocM ()
unDoc (Doc -> DocM ()) -> Doc -> DocM ()
forall a b. (a -> b) -> a -> b
$ case (ℕ64
i ℕ64 -> ℕ64 -> Bool
forall a. Ord a => a -> a -> Bool
< ℕ64
i') Bool -> Bool -> Bool
⩔ ((ℕ64
i ℕ64 -> ℕ64 -> Bool
forall a. Eq a => a -> a -> Bool
≡ ℕ64
i') Bool -> Bool -> Bool
⩓ Bool -> Bool
not Bool
b) of
Bool
True → ℕ64 -> Doc -> Doc
ppSetLevel ℕ64
i' Doc
aM
Bool
False → Doc -> Doc
ppParens (Doc -> Doc) -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ ℕ64 -> Doc -> Doc
ppSetLevel ℕ64
i' Doc
aM
ppInfLevel ∷ ℕ64 → Doc → Doc → Doc → Doc
ppInfLevel :: ℕ64 -> Doc -> Doc -> Doc -> Doc
ppInfLevel ℕ64
i Doc
oM Doc
x₁M Doc
x₂M = ℕ64 -> Doc -> Doc
ppLevel ℕ64
i (Doc -> Doc) -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ 𝐼 Doc -> Doc
forall a t. (Monoid a, ToIter a t) => t -> a
concat (𝐼 Doc -> Doc) -> 𝐼 Doc -> Doc
forall a b. (a -> b) -> a -> b
$ [Doc] -> 𝐼 Doc
forall a t. ToIter a t => t -> 𝐼 a
iter [Doc -> Doc
ppBump Doc
x₁M,Doc
oM,Doc -> Doc
ppBump Doc
x₂M]
ppInflLevel ∷ ℕ64 → Doc → Doc → Doc → Doc
ppInflLevel :: ℕ64 -> Doc -> Doc -> Doc -> Doc
ppInflLevel ℕ64
i Doc
oM Doc
x₁M Doc
x₂M = ℕ64 -> Doc -> Doc
ppLevel ℕ64
i (Doc -> Doc) -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ 𝐼 Doc -> Doc
forall a t. (Monoid a, ToIter a t) => t -> a
concat (𝐼 Doc -> Doc) -> 𝐼 Doc -> Doc
forall a b. (a -> b) -> a -> b
$ [Doc] -> 𝐼 Doc
forall a t. ToIter a t => t -> 𝐼 a
iter [Doc
x₁M,Doc
oM,Doc -> Doc
ppBump Doc
x₂M]
ppInfrLevel ∷ ℕ64 → Doc → Doc → Doc → Doc
ppInfrLevel :: ℕ64 -> Doc -> Doc -> Doc -> Doc
ppInfrLevel ℕ64
i Doc
oM Doc
x₁M Doc
x₂M = ℕ64 -> Doc -> Doc
ppLevel ℕ64
i (Doc -> Doc) -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ 𝐼 Doc -> Doc
forall a t. (Monoid a, ToIter a t) => t -> a
concat (𝐼 Doc -> Doc) -> 𝐼 Doc -> Doc
forall a b. (a -> b) -> a -> b
$ [Doc] -> 𝐼 Doc
forall a t. ToIter a t => t -> 𝐼 a
iter [Doc -> Doc
ppBump Doc
x₁M,Doc
oM,Doc
x₂M]
ppPreLevel ∷ ℕ64 → Doc → Doc → Doc
ppPreLevel :: ℕ64 -> Doc -> Doc -> Doc
ppPreLevel ℕ64
i Doc
oM Doc
xM = ℕ64 -> Doc -> Doc
ppLevel ℕ64
i (Doc -> Doc) -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ 𝐼 Doc -> Doc
forall a t. (Monoid a, ToIter a t) => t -> a
concat (𝐼 Doc -> Doc) -> 𝐼 Doc -> Doc
forall a b. (a -> b) -> a -> b
$ [Doc] -> 𝐼 Doc
forall a t. ToIter a t => t -> 𝐼 a
iter [Doc
oM,Doc
xM]
ppPostLevel ∷ ℕ64 → Doc → Doc → Doc
ppPostLevel :: ℕ64 -> Doc -> Doc -> Doc
ppPostLevel ℕ64
i Doc
oM Doc
xM = ℕ64 -> Doc -> Doc
ppLevel ℕ64
i (Doc -> Doc) -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ 𝐼 Doc -> Doc
forall a t. (Monoid a, ToIter a t) => t -> a
concat (𝐼 Doc -> Doc) -> 𝐼 Doc -> Doc
forall a b. (a -> b) -> a -> b
$ [Doc] -> 𝐼 Doc
forall a t. ToIter a t => t -> 𝐼 a
iter [Doc
xM,Doc
oM]
ppInf ∷ ℕ64 → Doc → Doc → Doc → Doc
ppInf :: ℕ64 -> Doc -> Doc -> Doc -> Doc
ppInf ℕ64
i Doc
o Doc
e₁ Doc
e₂ =
ℕ64 -> Doc -> Doc -> Doc -> Doc
ppInfLevel ℕ64
i ([Doc] -> Doc
forall a t. (Monoid a, ToIter a t) => t -> a
concat [Doc
ppNewlineIfBreak,Doc -> Doc
ppAlign Doc
o,Doc
ppSpaceIfBreak]) (Doc -> Doc
ppGA Doc
e₁) (Doc -> Doc) -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ Doc -> Doc
ppGA Doc
e₂
ppInfl ∷ ℕ64 → Doc → Doc → Doc → Doc
ppInfl :: ℕ64 -> Doc -> Doc -> Doc -> Doc
ppInfl ℕ64
i Doc
o Doc
e₁ Doc
e₂ =
ℕ64 -> Doc -> Doc -> Doc -> Doc
ppInflLevel ℕ64
i ([Doc] -> Doc
forall a t. (Monoid a, ToIter a t) => t -> a
concat [Doc
ppNewlineIfBreak,Doc -> Doc
ppAlign Doc
o,Doc
ppSpaceIfBreak]) (Doc -> Doc
ppGA Doc
e₁) (Doc -> Doc) -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ Doc -> Doc
ppGA Doc
e₂
ppInfr ∷ ℕ64 → Doc → Doc → Doc → Doc
ppInfr :: ℕ64 -> Doc -> Doc -> Doc -> Doc
ppInfr ℕ64
i Doc
o Doc
e₁ Doc
e₂ =
ℕ64 -> Doc -> Doc -> Doc -> Doc
ppInfrLevel ℕ64
i ([Doc] -> Doc
forall a t. (Monoid a, ToIter a t) => t -> a
concat [Doc
ppNewlineIfBreak,Doc -> Doc
ppAlign Doc
o,Doc
ppSpaceIfBreak]) (Doc -> Doc
ppGA Doc
e₁) (Doc -> Doc) -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ Doc -> Doc
ppGA Doc
e₂
ppPre ∷ ℕ64 → Doc → Doc → Doc
ppPre :: ℕ64 -> Doc -> Doc -> Doc
ppPre ℕ64
i Doc
o Doc
e = ℕ64 -> Doc -> Doc -> Doc
ppPreLevel ℕ64
i ([Doc] -> Doc
forall a t. (Monoid a, ToIter a t) => t -> a
concat [Doc -> Doc
ppAlign Doc
o,Doc
ppNewlineIfBreak]) (Doc -> Doc) -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ Doc -> Doc
ppGA Doc
e
ppPost ∷ ℕ64 → Doc → Doc → Doc
ppPost :: ℕ64 -> Doc -> Doc -> Doc
ppPost ℕ64
i Doc
o Doc
e = ℕ64 -> Doc -> Doc -> Doc
ppPostLevel ℕ64
i ([Doc] -> Doc
forall a t. (Monoid a, ToIter a t) => t -> a
concat [Doc
ppNewlineIfBreak,Doc -> Doc
ppAlign Doc
o]) (Doc -> Doc) -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ Doc -> Doc
ppGA Doc
e
ppInfSep ∷ ℕ64 → Doc → Doc → Doc → Doc
ppInfSep :: ℕ64 -> Doc -> Doc -> Doc -> Doc
ppInfSep ℕ64
i Doc
o = ℕ64 -> Doc -> Doc -> Doc -> Doc
ppInf ℕ64
i (Doc -> Doc -> Doc -> Doc) -> Doc -> Doc -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ Doc
ppSpaceIfNoBreak Doc -> Doc -> Doc
forall a. Append a => a -> a -> a
⧺ Doc
o Doc -> Doc -> Doc
forall a. Append a => a -> a -> a
⧺ Doc
ppSpaceIfNoBreak
ppInflSep ∷ ℕ64 → Doc → Doc → Doc → Doc
ppInflSep :: ℕ64 -> Doc -> Doc -> Doc -> Doc
ppInflSep ℕ64
i Doc
o = ℕ64 -> Doc -> Doc -> Doc -> Doc
ppInfl ℕ64
i (Doc -> Doc -> Doc -> Doc) -> Doc -> Doc -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ Doc
ppSpaceIfNoBreak Doc -> Doc -> Doc
forall a. Append a => a -> a -> a
⧺ Doc
o Doc -> Doc -> Doc
forall a. Append a => a -> a -> a
⧺ Doc
ppSpaceIfNoBreak
ppInfrSep ∷ ℕ64 → Doc → Doc → Doc → Doc
ppInfrSep :: ℕ64 -> Doc -> Doc -> Doc -> Doc
ppInfrSep ℕ64
i Doc
o = ℕ64 -> Doc -> Doc -> Doc -> Doc
ppInfr ℕ64
i (Doc -> Doc -> Doc -> Doc) -> Doc -> Doc -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ Doc
ppSpaceIfNoBreak Doc -> Doc -> Doc
forall a. Append a => a -> a -> a
⧺ Doc
o Doc -> Doc -> Doc
forall a. Append a => a -> a -> a
⧺ Doc
ppSpaceIfNoBreak
ppPreSep ∷ ℕ64 → Doc → Doc → Doc
ppPreSep :: ℕ64 -> Doc -> Doc -> Doc
ppPreSep ℕ64
i Doc
o = ℕ64 -> Doc -> Doc -> Doc
ppPre ℕ64
i (Doc -> Doc -> Doc) -> Doc -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ Doc
o Doc -> Doc -> Doc
forall a. Append a => a -> a -> a
⧺ Doc
ppSpaceIfNoBreak
ppPostSep ∷ ℕ64 → Doc → Doc → Doc
ppPostSep :: ℕ64 -> Doc -> Doc -> Doc
ppPostSep ℕ64
i Doc
o = ℕ64 -> Doc -> Doc -> Doc
ppPost ℕ64
i (Doc -> Doc -> Doc) -> Doc -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ Doc
ppSpaceIfNoBreak Doc -> Doc -> Doc
forall a. Append a => a -> a -> a
⧺ Doc
o
ppInf' ∷ ℕ64 → Doc → Doc → Doc → Doc
ppInf' :: ℕ64 -> Doc -> Doc -> Doc -> Doc
ppInf' ℕ64
i Doc
o Doc
e₁ Doc
e₂ =
ℕ64 -> Doc -> Doc -> Doc -> Doc
ppInfLevel ℕ64
i ([Doc] -> Doc
forall a t. (Monoid a, ToIter a t) => t -> a
concat [Doc
ppNewlineIfBreak,Doc -> Doc
ppAlign Doc
o,Doc
ppNewlineIfBreak]) (Doc -> Doc
ppGA Doc
e₁) (Doc -> Doc) -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ Doc -> Doc
ppGA Doc
e₂
ppInfl' ∷ ℕ64 → Doc → Doc → Doc → Doc
ppInfl' :: ℕ64 -> Doc -> Doc -> Doc -> Doc
ppInfl' ℕ64
i Doc
o Doc
e₁ Doc
e₂ =
ℕ64 -> Doc -> Doc -> Doc -> Doc
ppInflLevel ℕ64
i ([Doc] -> Doc
forall a t. (Monoid a, ToIter a t) => t -> a
concat [Doc
ppNewlineIfBreak,Doc -> Doc
ppAlign Doc
o,Doc
ppNewlineIfBreak]) (Doc -> Doc
ppGA Doc
e₁) (Doc -> Doc) -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ Doc -> Doc
ppGA Doc
e₂
ppInfr' ∷ ℕ64 → Doc → Doc → Doc → Doc
ppInfr' :: ℕ64 -> Doc -> Doc -> Doc -> Doc
ppInfr' ℕ64
i Doc
o Doc
e₁ Doc
e₂ =
ℕ64 -> Doc -> Doc -> Doc -> Doc
ppInfrLevel ℕ64
i ([Doc] -> Doc
forall a t. (Monoid a, ToIter a t) => t -> a
concat [Doc
ppNewlineIfBreak,Doc -> Doc
ppAlign Doc
o,Doc
ppNewlineIfBreak]) (Doc -> Doc
ppGA Doc
e₁) (Doc -> Doc) -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ Doc -> Doc
ppGA Doc
e₂
ppInfSep' ∷ ℕ64 → Doc → Doc → Doc → Doc
ppInfSep' :: ℕ64 -> Doc -> Doc -> Doc -> Doc
ppInfSep' ℕ64
i Doc
o = ℕ64 -> Doc -> Doc -> Doc -> Doc
ppInf' ℕ64
i (Doc -> Doc -> Doc -> Doc) -> Doc -> Doc -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ Doc
ppSpaceIfNoBreak Doc -> Doc -> Doc
forall a. Append a => a -> a -> a
⧺ Doc
o Doc -> Doc -> Doc
forall a. Append a => a -> a -> a
⧺ Doc
ppSpaceIfNoBreak
ppInflSep' ∷ ℕ64 → Doc → Doc → Doc → Doc
ppInflSep' :: ℕ64 -> Doc -> Doc -> Doc -> Doc
ppInflSep' ℕ64
i Doc
o = ℕ64 -> Doc -> Doc -> Doc -> Doc
ppInfl' ℕ64
i (Doc -> Doc -> Doc -> Doc) -> Doc -> Doc -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ Doc
ppSpaceIfNoBreak Doc -> Doc -> Doc
forall a. Append a => a -> a -> a
⧺ Doc
o Doc -> Doc -> Doc
forall a. Append a => a -> a -> a
⧺ Doc
ppSpaceIfNoBreak
ppInfrSep' ∷ ℕ64 → Doc → Doc → Doc → Doc
ppInfrSep' :: ℕ64 -> Doc -> Doc -> Doc -> Doc
ppInfrSep' ℕ64
i Doc
o = ℕ64 -> Doc -> Doc -> Doc -> Doc
ppInfr' ℕ64
i (Doc -> Doc -> Doc -> Doc) -> Doc -> Doc -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ Doc
ppSpaceIfNoBreak Doc -> Doc -> Doc
forall a. Append a => a -> a -> a
⧺ Doc
o Doc -> Doc -> Doc
forall a. Append a => a -> a -> a
⧺ Doc
ppSpaceIfNoBreak
ppApp ∷ (ToIter Doc t) ⇒ Doc → t → Doc
ppApp :: forall t. ToIter Doc t => Doc -> t -> Doc
ppApp Doc
x t
xs
| t -> ℕ64
forall n t a. (Zero n, One n, Plus n, ToIter a t) => t -> n
count t
xs ℕ64 -> ℕ64 -> Bool
forall a. Eq a => a -> a -> Bool
≡ ℕ -> ℕ64
𝕟64 ℕ
0 = Doc -> Doc
ppAlign Doc
x
| Bool
otherwise = DocM () -> Doc
Doc (DocM () -> Doc) -> DocM () -> Doc
forall a b. (a -> b) -> a -> b
$ do
ℕ64
l ← (DocEnv ⟢ ℕ64) -> RWST DocEnv DocA () ID ℕ64
forall r'. (DocEnv ⟢ r') -> RWST DocEnv DocA () ID r'
forall r (m :: * -> *) r'. MonadReader r m => (r ⟢ r') -> m r'
askL ((DocEnv ⟢ ℕ64) -> RWST DocEnv DocA () ID ℕ64)
-> (DocEnv ⟢ ℕ64) -> RWST DocEnv DocA () ID ℕ64
forall a b. (a -> b) -> a -> b
$ PrettyParams ⟢ ℕ64
appLevelL (PrettyParams ⟢ ℕ64) -> (DocEnv ⟢ PrettyParams) -> DocEnv ⟢ ℕ64
forall b c a. (b ⟢ c) -> (a ⟢ b) -> a ⟢ c
forall {k} (t :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Transitive t =>
t b c -> t a b -> t a c
⊚ DocEnv ⟢ PrettyParams
docEnvPrettyParamsL
Doc -> DocM ()
unDoc (Doc -> DocM ()) -> Doc -> DocM ()
forall a b. (a -> b) -> a -> b
$ ℕ64 -> Doc -> Doc
ppLevel ℕ64
l (Doc -> Doc) -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ [Doc] -> Doc
forall a t. (Monoid a, ToIter a t) => t -> a
concat
[ Doc -> Doc
ppGA Doc
x
, Doc
ppSpaceNewlineIfBreak
, 𝐼 Doc -> Doc
forall a t. (Monoid a, ToIter a t) => t -> a
concat (𝐼 Doc -> Doc) -> 𝐼 Doc -> Doc
forall a b. (a -> b) -> a -> b
$ Doc -> 𝐼 Doc -> 𝐼 Doc
forall a t. ToIter a t => a -> t -> 𝐼 a
inbetween Doc
ppSpaceNewlineIfBreak (𝐼 Doc -> 𝐼 Doc) -> 𝐼 Doc -> 𝐼 Doc
forall a b. (a -> b) -> a -> b
$ (Doc -> Doc) -> 𝐼 Doc -> 𝐼 Doc
forall a b. (a -> b) -> 𝐼 a -> 𝐼 b
forall (t :: * -> *) a b. Functor t => (a -> b) -> t a -> t b
map (Doc -> Doc
ppGA (Doc -> Doc) -> (Doc -> Doc) -> Doc -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ Doc -> Doc
ppBump) (𝐼 Doc -> 𝐼 Doc) -> 𝐼 Doc -> 𝐼 Doc
forall a b. (a -> b) -> a -> b
$ t -> 𝐼 Doc
forall a t. ToIter a t => t -> 𝐼 a
iter t
xs
]
ppCollection ∷ (ToIter Doc t) ⇒ Doc → Doc → Doc → t → Doc
ppCollection :: forall t. ToIter Doc t => Doc -> Doc -> Doc -> t -> Doc
ppCollection Doc
l Doc
r Doc
i t
xs = Doc -> Doc
ppSetBotLevel (Doc -> Doc) -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ [Doc] -> Doc
forall a t. (Monoid a, ToIter a t) => t -> a
concat
[ Doc
l
, Doc
ppSpaceIfBreak
, 𝐼 Doc -> Doc
forall a t. (Monoid a, ToIter a t) => t -> a
concat (𝐼 Doc -> Doc) -> 𝐼 Doc -> Doc
forall a b. (a -> b) -> a -> b
$ Doc -> 𝐼 Doc -> 𝐼 Doc
forall a t. ToIter a t => a -> t -> 𝐼 a
inbetween Doc
spacer (𝐼 Doc -> 𝐼 Doc) -> 𝐼 Doc -> 𝐼 Doc
forall a b. (a -> b) -> a -> b
$ (Doc -> Doc) -> 𝐼 Doc -> 𝐼 Doc
forall a b. (a -> b) -> 𝐼 a -> 𝐼 b
forall (t :: * -> *) a b. Functor t => (a -> b) -> t a -> t b
map Doc -> Doc
ppGA (𝐼 Doc -> 𝐼 Doc) -> 𝐼 Doc -> 𝐼 Doc
forall a b. (a -> b) -> a -> b
$ t -> 𝐼 Doc
forall a t. ToIter a t => t -> 𝐼 a
iter t
xs
, Doc
ppNewlineIfBreak
, Doc
r
]
where
spacer ∷ Doc
spacer :: Doc
spacer = [Doc] -> Doc
forall a t. (Monoid a, ToIter a t) => t -> a
concat
[ Doc
ppNewlineIfBreak
, Doc
i
, Doc
ppSpaceIfBreak
]
ppRecord ∷ (ToIter (Doc ∧ Doc) t) ⇒ Doc → t → Doc
ppRecord :: forall t. ToIter (Doc ∧ Doc) t => Doc -> t -> Doc
ppRecord Doc
rel t
kvs = Doc -> Doc -> Doc -> 𝐼 Doc -> Doc
forall t. ToIter Doc t => Doc -> Doc -> Doc -> t -> Doc
ppCollection (𝕊 -> Doc
ppPun 𝕊
"{") (𝕊 -> Doc
ppPun 𝕊
"}") (𝕊 -> Doc
ppPun 𝕊
",") (𝐼 Doc -> Doc) -> 𝐼 Doc -> Doc
forall a b. (a -> b) -> a -> b
$ ((Doc ∧ Doc) -> Doc) -> 𝐼 (Doc ∧ Doc) -> 𝐼 Doc
forall a b. (a -> b) -> 𝐼 a -> 𝐼 b
forall (t :: * -> *) a b. Functor t => (a -> b) -> t a -> t b
map (Doc ∧ Doc) -> Doc
mapping (𝐼 (Doc ∧ Doc) -> 𝐼 Doc) -> 𝐼 (Doc ∧ Doc) -> 𝐼 Doc
forall a b. (a -> b) -> a -> b
$ t -> 𝐼 (Doc ∧ Doc)
forall a t. ToIter a t => t -> 𝐼 a
iter t
kvs
where
mapping :: (Doc ∧ Doc) -> Doc
mapping (Doc
k :* Doc
v) = [Doc] -> Doc
forall a t. (Monoid a, ToIter a t) => t -> a
concat
[ Doc -> Doc
ppGA Doc
k
, Doc
ppSpaceIfBreak
, Doc
rel
, Doc
ppNewlineIfBreak
, Doc
ppSpaceIfBreak
, Doc
ppSpaceIfBreak
, Doc -> Doc
ppGA Doc
v
]
ppBake ∷ Doc → TreeI
ppBake :: Doc -> TreeI
ppBake = DocA -> TreeI
execDocA (DocA -> TreeI) -> (Doc -> DocA) -> Doc -> TreeI
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ Doc -> DocA
execDoc
ppEmbed ∷ TreeI → Doc
ppEmbed :: TreeI -> Doc
ppEmbed TreeI
is =
let s :: SummaryI
s = TreeI
-> (𝐼 ChunkI -> SummaryI)
-> (Annotation -> SummaryI -> SummaryI)
-> SummaryI
forall b i a. Monoid b => 𝑇V i a -> (a -> b) -> (i -> b -> b) -> b
fold𝑇VOn TreeI
is 𝐼 ChunkI -> SummaryI
summaryChunksI Annotation -> SummaryI -> SummaryI
annotateSummaryI
in DocM () -> Doc
Doc (DocM () -> Doc) -> DocM () -> Doc
forall a b. (a -> b) -> a -> b
$ DocA -> DocM ()
forall o (m :: * -> *). MonadWriter o m => o -> m ()
tell (DocA -> DocM ()) -> DocA -> DocM ()
forall a b. (a -> b) -> a -> b
$ SummaryI -> DocA
StaticDocA SummaryI
s
matrixHelper ∷ (𝒩 m,𝒩 n) ⇒ 𝕍S n HAlign → 𝕍S m VAlign → 𝕍S m (𝕍S n SummaryO) → 𝕍S n ℕ64 ∧ 𝕍S m (𝕍S n SummaryO)
matrixHelper :: forall (m :: ℕ) (n :: ℕ).
(𝒩 m, 𝒩 n) =>
𝕍S n HAlign
-> 𝕍S m VAlign
-> 𝕍S m (𝕍S n SummaryO)
-> 𝕍S n ℕ64 ∧ 𝕍S m (𝕍S n SummaryO)
matrixHelper 𝕍S n HAlign
has 𝕍S m VAlign
vas 𝕍S m (𝕍S n SummaryO)
sss =
let sssT :: 𝕍S n (𝕍S m SummaryO)
sssT = 𝕍S m (𝕍S n SummaryO) -> 𝕍S n (𝕍S m SummaryO)
forall (m :: ℕ) (n :: ℕ) a.
(𝒩 m, 𝒩 n) =>
𝕍S m (𝕍S n a) -> 𝕍S n (𝕍S m a)
𝐭 𝕍S m (𝕍S n SummaryO)
sss
rowHeights :: 𝕍S m ℕ64
rowHeights = 𝕍S m (𝕍S n SummaryO) -> (𝕍S n SummaryO -> ℕ64) -> 𝕍S m ℕ64
forall (t :: * -> *) a b. Functor t => t a -> (a -> b) -> t b
mapOn 𝕍S m (𝕍S n SummaryO)
sss ((𝕍S n SummaryO -> ℕ64) -> 𝕍S m ℕ64)
-> (𝕍S n SummaryO -> ℕ64) -> 𝕍S m ℕ64
forall a b. (a -> b) -> a -> b
$ \ 𝕍S n SummaryO
ss → 𝕍S n ℕ64 -> ℕ64
forall a t. (JoinLattice a, ToIter a t) => t -> a
joins (𝕍S n ℕ64 -> ℕ64) -> 𝕍S n ℕ64 -> ℕ64
forall a b. (a -> b) -> a -> b
$ 𝕍S n SummaryO -> (SummaryO -> ℕ64) -> 𝕍S n ℕ64
forall (t :: * -> *) a b. Functor t => t a -> (a -> b) -> t b
mapOn 𝕍S n SummaryO
ss ((SummaryO -> ℕ64) -> 𝕍S n ℕ64) -> (SummaryO -> ℕ64) -> 𝕍S n ℕ64
forall a b. (a -> b) -> a -> b
$ \ SummaryO
s → Shape -> ℕ64
shapeNewlines (Shape -> ℕ64) -> Shape -> ℕ64
forall a b. (a -> b) -> a -> b
$ SummaryO -> Shape
summaryOShape SummaryO
s
colWidths :: 𝕍S n ℕ64
colWidths = 𝕍S n (𝕍S m SummaryO) -> (𝕍S m SummaryO -> ℕ64) -> 𝕍S n ℕ64
forall (t :: * -> *) a b. Functor t => t a -> (a -> b) -> t b
mapOn 𝕍S n (𝕍S m SummaryO)
sssT ((𝕍S m SummaryO -> ℕ64) -> 𝕍S n ℕ64)
-> (𝕍S m SummaryO -> ℕ64) -> 𝕍S n ℕ64
forall a b. (a -> b) -> a -> b
$ \ 𝕍S m SummaryO
ss → 𝕍S m ℕ64 -> ℕ64
forall a t. (JoinLattice a, ToIter a t) => t -> a
joins (𝕍S m ℕ64 -> ℕ64) -> 𝕍S m ℕ64 -> ℕ64
forall a b. (a -> b) -> a -> b
$ 𝕍S m SummaryO -> (SummaryO -> ℕ64) -> 𝕍S m ℕ64
forall (t :: * -> *) a b. Functor t => t a -> (a -> b) -> t b
mapOn 𝕍S m SummaryO
ss ((SummaryO -> ℕ64) -> 𝕍S m ℕ64) -> (SummaryO -> ℕ64) -> 𝕍S m ℕ64
forall a b. (a -> b) -> a -> b
$ \ SummaryO
s → Shape -> ℕ64
shapeWidth (Shape -> ℕ64) -> Shape -> ℕ64
forall a b. (a -> b) -> a -> b
$ SummaryO -> Shape
summaryOShape SummaryO
s
sss' :: 𝕍S m (𝕍S n SummaryO)
sss' = ℕ64S m -> (𝕀64 m -> 𝕍S n SummaryO) -> 𝕍S m (𝕍S n SummaryO)
forall (n :: ℕ) a. 𝒩 n => ℕ64S n -> (𝕀64 n -> a) -> 𝕍S n a
svecF ℕ64S m
forall (n :: ℕ). 𝒩64 n => ℕ64S n
𝕟64s ((𝕀64 m -> 𝕍S n SummaryO) -> 𝕍S m (𝕍S n SummaryO))
-> (𝕀64 m -> 𝕍S n SummaryO) -> 𝕍S m (𝕍S n SummaryO)
forall a b. (a -> b) -> a -> b
$ \ 𝕀64 m
i → ℕ64S n -> (𝕀64 n -> SummaryO) -> 𝕍S n SummaryO
forall (n :: ℕ) a. 𝒩 n => ℕ64S n -> (𝕀64 n -> a) -> 𝕍S n a
svecF ℕ64S n
forall (n :: ℕ). 𝒩64 n => ℕ64S n
𝕟64s ((𝕀64 n -> SummaryO) -> 𝕍S n SummaryO)
-> (𝕀64 n -> SummaryO) -> 𝕍S n SummaryO
forall a b. (a -> b) -> a -> b
$ \ 𝕀64 n
j → HAlign -> VAlign -> ℕ64 -> ℕ64 -> SummaryO -> SummaryO
hvalign (𝕍S n HAlign
has 𝕍S n HAlign -> 𝕀64 n -> HAlign
forall k v t. Access k v t => t -> k -> v
⋕ 𝕀64 n
j) (𝕍S m VAlign
vas 𝕍S m VAlign -> 𝕀64 m -> VAlign
forall k v t. Access k v t => t -> k -> v
⋕ 𝕀64 m
i) (𝕍S n ℕ64
colWidths 𝕍S n ℕ64 -> 𝕀64 n -> ℕ64
forall k v t. Access k v t => t -> k -> v
⋕ 𝕀64 n
j) (𝕍S m ℕ64
rowHeights 𝕍S m ℕ64 -> 𝕀64 m -> ℕ64
forall k v t. Access k v t => t -> k -> v
⋕ 𝕀64 m
i) (SummaryO -> SummaryO) -> SummaryO -> SummaryO
forall a b. (a -> b) -> a -> b
$ 𝕍S m (𝕍S n SummaryO)
sss 𝕍S m (𝕍S n SummaryO) -> 𝕀64 m -> 𝕍S n SummaryO
forall k v t. Access k v t => t -> k -> v
⋕ 𝕀64 m
i 𝕍S n SummaryO -> 𝕀64 n -> SummaryO
forall k v t. Access k v t => t -> k -> v
⋕ 𝕀64 n
j
in 𝕍S n ℕ64
colWidths 𝕍S n ℕ64 -> 𝕍S m (𝕍S n SummaryO) -> 𝕍S n ℕ64 ∧ 𝕍S m (𝕍S n SummaryO)
forall a b. a -> b -> a ∧ b
:* 𝕍S m (𝕍S n SummaryO)
sss'
ppMatrix ∷ (𝒩 m,𝒩 n) ⇒ 𝕍S n HAlign → 𝕍S m VAlign → 𝕍S m (𝕍S n Doc) → Doc
ppMatrix :: forall (m :: ℕ) (n :: ℕ).
(𝒩 m, 𝒩 n) =>
𝕍S n HAlign -> 𝕍S m VAlign -> 𝕍S m (𝕍S n Doc) -> Doc
ppMatrix 𝕍S n HAlign
has 𝕍S m VAlign
vas 𝕍S m (𝕍S n Doc)
dss =
let sss :: 𝕍S m (𝕍S n SummaryO)
sss = (Doc -> SummaryO) -> 𝕍S m (𝕍S n Doc) -> 𝕍S m (𝕍S n SummaryO)
forall (t :: * -> *) (u :: * -> *) a b.
(Functor t, Functor u) =>
(a -> b) -> t (u a) -> t (u b)
mapp (TreeI -> SummaryO
execRenderUT (TreeI -> SummaryO) -> (SummaryI -> TreeI) -> SummaryI -> SummaryO
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ SummaryI -> TreeI
summaryIContents (SummaryI -> SummaryO) -> (DocA -> SummaryI) -> DocA -> SummaryO
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ DocA -> SummaryI
staticDocA (DocA -> SummaryO) -> (Doc -> DocA) -> Doc -> SummaryO
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ Doc -> DocA
execDoc) 𝕍S m (𝕍S n Doc)
dss
𝕍S n ℕ64
_ :* 𝕍S m (𝕍S n SummaryO)
sss' = 𝕍S n HAlign
-> 𝕍S m VAlign
-> 𝕍S m (𝕍S n SummaryO)
-> 𝕍S n ℕ64 ∧ 𝕍S m (𝕍S n SummaryO)
forall (m :: ℕ) (n :: ℕ).
(𝒩 m, 𝒩 n) =>
𝕍S n HAlign
-> 𝕍S m VAlign
-> 𝕍S m (𝕍S n SummaryO)
-> 𝕍S n ℕ64 ∧ 𝕍S m (𝕍S n SummaryO)
matrixHelper 𝕍S n HAlign
has 𝕍S m VAlign
vas 𝕍S m (𝕍S n SummaryO)
sss
dss' :: 𝕍S m (𝕍S n Doc)
dss' = ℕ64S m -> (𝕀64 m -> 𝕍S n Doc) -> 𝕍S m (𝕍S n Doc)
forall (n :: ℕ) a. 𝒩 n => ℕ64S n -> (𝕀64 n -> a) -> 𝕍S n a
svecF ℕ64S m
forall (n :: ℕ). 𝒩64 n => ℕ64S n
𝕟64s ((𝕀64 m -> 𝕍S n Doc) -> 𝕍S m (𝕍S n Doc))
-> (𝕀64 m -> 𝕍S n Doc) -> 𝕍S m (𝕍S n Doc)
forall a b. (a -> b) -> a -> b
$ \ 𝕀64 m
i → ℕ64S n -> (𝕀64 n -> Doc) -> 𝕍S n Doc
forall (n :: ℕ) a. 𝒩 n => ℕ64S n -> (𝕀64 n -> a) -> 𝕍S n a
svecF ℕ64S n
forall (n :: ℕ). 𝒩64 n => ℕ64S n
𝕟64s ((𝕀64 n -> Doc) -> 𝕍S n Doc) -> (𝕀64 n -> Doc) -> 𝕍S n Doc
forall a b. (a -> b) -> a -> b
$ \ 𝕀64 n
j →
let SummaryO Shape
sh TreeO
t = 𝕍S m (𝕍S n SummaryO)
sss' 𝕍S m (𝕍S n SummaryO) -> 𝕀64 m -> 𝕍S n SummaryO
forall k v t. Access k v t => t -> k -> v
⋕ 𝕀64 m
i 𝕍S n SummaryO -> 𝕀64 n -> SummaryO
forall k v t. Access k v t => t -> k -> v
⋕ 𝕀64 n
j
in DocM () -> Doc
Doc (DocM () -> Doc) -> DocM () -> Doc
forall a b. (a -> b) -> a -> b
$ DocA -> DocM ()
forall o (m :: * -> *). MonadWriter o m => o -> m ()
tell (DocA -> DocM ()) -> DocA -> DocM ()
forall a b. (a -> b) -> a -> b
$ SummaryI -> DocA
StaticDocA (SummaryI -> DocA) -> SummaryI -> DocA
forall a b. (a -> b) -> a -> b
$ Bool -> ShapeA -> TreeI -> SummaryI
SummaryI Bool
True (Bool -> Shape -> ShapeA
ShapeA Bool
False Shape
sh) (TreeI -> SummaryI) -> TreeI -> SummaryI
forall a b. (a -> b) -> a -> b
$ TreeO -> TreeI
treeIO TreeO
t
in
𝕍S m Doc -> Doc
forall t. ToIter Doc t => t -> Doc
ppVertical (𝕍S m Doc -> Doc) -> 𝕍S m Doc -> Doc
forall a b. (a -> b) -> a -> b
$ 𝕍S m (𝕍S n Doc) -> (𝕍S n Doc -> Doc) -> 𝕍S m Doc
forall (t :: * -> *) a b. Functor t => t a -> (a -> b) -> t b
mapOn 𝕍S m (𝕍S n Doc)
dss' ((𝕍S n Doc -> Doc) -> 𝕍S m Doc) -> (𝕍S n Doc -> Doc) -> 𝕍S m Doc
forall a b. (a -> b) -> a -> b
$ \ 𝕍S n Doc
ds →
𝐼 Doc -> Doc
forall t. ToIter Doc t => t -> Doc
ppHorizontal (𝐼 Doc -> Doc) -> 𝐼 Doc -> Doc
forall a b. (a -> b) -> a -> b
$ Doc -> 𝕍S n Doc -> 𝐼 Doc
forall a t. ToIter a t => a -> t -> 𝐼 a
inbetween Doc
forall a. Null a => a
null 𝕍S n Doc
ds
ppMatrixCells ∷ (𝒩 m,𝒩 n) ⇒ 𝕍S n HAlign → 𝕍S m VAlign → 𝕍S m (𝕍S n Doc) → Doc
ppMatrixCells :: forall (m :: ℕ) (n :: ℕ).
(𝒩 m, 𝒩 n) =>
𝕍S n HAlign -> 𝕍S m VAlign -> 𝕍S m (𝕍S n Doc) -> Doc
ppMatrixCells 𝕍S n HAlign
has 𝕍S m VAlign
vas 𝕍S m (𝕍S n Doc)
dss =
let sss :: 𝕍S m (𝕍S n SummaryO)
sss = (Doc -> SummaryO) -> 𝕍S m (𝕍S n Doc) -> 𝕍S m (𝕍S n SummaryO)
forall (t :: * -> *) (u :: * -> *) a b.
(Functor t, Functor u) =>
(a -> b) -> t (u a) -> t (u b)
mapp (TreeI -> SummaryO
execRenderUT (TreeI -> SummaryO) -> (SummaryI -> TreeI) -> SummaryI -> SummaryO
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ SummaryI -> TreeI
summaryIContents (SummaryI -> SummaryO) -> (DocA -> SummaryI) -> DocA -> SummaryO
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ DocA -> SummaryI
staticDocA (DocA -> SummaryO) -> (Doc -> DocA) -> Doc -> SummaryO
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ Doc -> DocA
execDoc) 𝕍S m (𝕍S n Doc)
dss
𝕍S n ℕ64
ws :* 𝕍S m (𝕍S n SummaryO)
sss' = 𝕍S n HAlign
-> 𝕍S m VAlign
-> 𝕍S m (𝕍S n SummaryO)
-> 𝕍S n ℕ64 ∧ 𝕍S m (𝕍S n SummaryO)
forall (m :: ℕ) (n :: ℕ).
(𝒩 m, 𝒩 n) =>
𝕍S n HAlign
-> 𝕍S m VAlign
-> 𝕍S m (𝕍S n SummaryO)
-> 𝕍S n ℕ64 ∧ 𝕍S m (𝕍S n SummaryO)
matrixHelper 𝕍S n HAlign
has 𝕍S m VAlign
vas 𝕍S m (𝕍S n SummaryO)
sss
sep :: Doc
sep = Color -> Doc -> Doc
ppFG Color
white (Doc -> Doc) -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ 𝐼 Doc -> Doc
forall a t. (Monoid a, ToIter a t) => t -> a
concat (𝐼 Doc -> Doc) -> 𝐼 Doc -> Doc
forall a b. (a -> b) -> a -> b
$ Doc -> 𝕍S n Doc -> 𝐼 Doc
forall a t. ToIter a t => a -> t -> 𝐼 a
inbetween (𝕊 -> Doc
ppString 𝕊
"─┼─") (𝕍S n Doc -> 𝐼 Doc) -> 𝕍S n Doc -> 𝐼 Doc
forall a b. (a -> b) -> a -> b
$ 𝕍S n ℕ64 -> (ℕ64 -> Doc) -> 𝕍S n Doc
forall (t :: * -> *) a b. Functor t => t a -> (a -> b) -> t b
mapOn 𝕍S n ℕ64
ws ((ℕ64 -> Doc) -> 𝕍S n Doc) -> (ℕ64 -> Doc) -> 𝕍S n Doc
forall a b. (a -> b) -> a -> b
$ \ ℕ64
w → 𝕊 -> Doc
ppString (𝕊 -> Doc) -> 𝕊 -> Doc
forall a b. (a -> b) -> a -> b
$ 𝐼 ℂ -> 𝕊
forall t. ToIter ℂ t => t -> 𝕊
string (𝐼 ℂ -> 𝕊) -> 𝐼 ℂ -> 𝕊
forall a b. (a -> b) -> a -> b
$ ℕ64 -> ℂ -> 𝐼 ℂ
forall n a. (Eq n, Zero n, One n, Plus n) => n -> a -> 𝐼 a
replicate ℕ64
w ℂ
'─'
dss' :: 𝕍S m (𝕍S n Doc)
dss' = ℕ64S m -> (𝕀64 m -> 𝕍S n Doc) -> 𝕍S m (𝕍S n Doc)
forall (n :: ℕ) a. 𝒩 n => ℕ64S n -> (𝕀64 n -> a) -> 𝕍S n a
svecF ℕ64S m
forall (n :: ℕ). 𝒩64 n => ℕ64S n
𝕟64s ((𝕀64 m -> 𝕍S n Doc) -> 𝕍S m (𝕍S n Doc))
-> (𝕀64 m -> 𝕍S n Doc) -> 𝕍S m (𝕍S n Doc)
forall a b. (a -> b) -> a -> b
$ \ 𝕀64 m
i → ℕ64S n -> (𝕀64 n -> Doc) -> 𝕍S n Doc
forall (n :: ℕ) a. 𝒩 n => ℕ64S n -> (𝕀64 n -> a) -> 𝕍S n a
svecF ℕ64S n
forall (n :: ℕ). 𝒩64 n => ℕ64S n
𝕟64s ((𝕀64 n -> Doc) -> 𝕍S n Doc) -> (𝕀64 n -> Doc) -> 𝕍S n Doc
forall a b. (a -> b) -> a -> b
$ \ 𝕀64 n
j →
let SummaryO Shape
sh TreeO
t = 𝕍S m (𝕍S n SummaryO)
sss' 𝕍S m (𝕍S n SummaryO) -> 𝕀64 m -> 𝕍S n SummaryO
forall k v t. Access k v t => t -> k -> v
⋕ 𝕀64 m
i 𝕍S n SummaryO -> 𝕀64 n -> SummaryO
forall k v t. Access k v t => t -> k -> v
⋕ 𝕀64 n
j
in DocM () -> Doc
Doc (DocM () -> Doc) -> DocM () -> Doc
forall a b. (a -> b) -> a -> b
$ DocA -> DocM ()
forall o (m :: * -> *). MonadWriter o m => o -> m ()
tell (DocA -> DocM ()) -> DocA -> DocM ()
forall a b. (a -> b) -> a -> b
$ SummaryI -> DocA
StaticDocA (SummaryI -> DocA) -> SummaryI -> DocA
forall a b. (a -> b) -> a -> b
$ Bool -> ShapeA -> TreeI -> SummaryI
SummaryI Bool
True (Bool -> Shape -> ShapeA
ShapeA Bool
False Shape
sh) (TreeI -> SummaryI) -> TreeI -> SummaryI
forall a b. (a -> b) -> a -> b
$ TreeO -> TreeI
treeIO TreeO
t
in
𝐼 Doc -> Doc
forall t. ToIter Doc t => t -> Doc
ppVertical (𝐼 Doc -> Doc) -> 𝐼 Doc -> Doc
forall a b. (a -> b) -> a -> b
$ Doc -> 𝕍S m Doc -> 𝐼 Doc
forall a t. ToIter a t => a -> t -> 𝐼 a
inbetween Doc
sep (𝕍S m Doc -> 𝐼 Doc) -> 𝕍S m Doc -> 𝐼 Doc
forall a b. (a -> b) -> a -> b
$ 𝕍S m (𝕍S n Doc) -> (𝕍S n Doc -> Doc) -> 𝕍S m Doc
forall (t :: * -> *) a b. Functor t => t a -> (a -> b) -> t b
mapOn 𝕍S m (𝕍S n Doc)
dss' ((𝕍S n Doc -> Doc) -> 𝕍S m Doc) -> (𝕍S n Doc -> Doc) -> 𝕍S m Doc
forall a b. (a -> b) -> a -> b
$ \ 𝕍S n Doc
ds →
𝐼 Doc -> Doc
forall t. ToIter Doc t => t -> Doc
ppHorizontal (𝐼 Doc -> Doc) -> 𝐼 Doc -> Doc
forall a b. (a -> b) -> a -> b
$ Doc -> 𝕍S n Doc -> 𝐼 Doc
forall a t. ToIter a t => a -> t -> 𝐼 a
inbetween (Color -> Doc -> Doc
ppFG Color
white (Doc -> Doc) -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ 𝕊 -> Doc
ppString 𝕊
"│") 𝕍S n Doc
ds
class Pretty a where
pretty ∷ a → Doc
class PrettyM m a | a → m where
mpretty ∷ a → m Doc
instance Pretty Doc where pretty :: Doc -> Doc
pretty = Doc -> Doc
forall a. a -> a
id
instance Pretty Void where pretty :: Void -> Doc
pretty = Void -> Doc
\case
instance Pretty () where pretty :: () -> Doc
pretty = 𝕊 -> Doc
ppCon (𝕊 -> Doc) -> (() -> 𝕊) -> () -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ () -> 𝕊
forall a. Show a => a -> 𝕊
show𝕊
instance Pretty 𝔹 where pretty :: Bool -> Doc
pretty = 𝕊 -> Doc
ppCon (𝕊 -> Doc) -> (Bool -> 𝕊) -> Bool -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ Bool -> 𝕊
forall a. Show a => a -> 𝕊
show𝕊
instance Pretty ℕ where pretty :: ℕ -> Doc
pretty = 𝕊 -> Doc
ppLit (𝕊 -> Doc) -> (ℕ -> 𝕊) -> ℕ -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ ℕ -> 𝕊
forall a. Show a => a -> 𝕊
show𝕊
instance Pretty ℕ64 where pretty :: ℕ64 -> Doc
pretty = 𝕊 -> Doc
ppLit (𝕊 -> Doc) -> (ℕ64 -> 𝕊) -> ℕ64 -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ ℕ64 -> 𝕊
forall a. Show a => a -> 𝕊
show𝕊
instance Pretty ℕ32 where pretty :: ℕ32 -> Doc
pretty = 𝕊 -> Doc
ppLit (𝕊 -> Doc) -> (ℕ32 -> 𝕊) -> ℕ32 -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ ℕ32 -> 𝕊
forall a. Show a => a -> 𝕊
show𝕊
instance Pretty ℕ16 where pretty :: ℕ16 -> Doc
pretty = 𝕊 -> Doc
ppLit (𝕊 -> Doc) -> (ℕ16 -> 𝕊) -> ℕ16 -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ ℕ16 -> 𝕊
forall a. Show a => a -> 𝕊
show𝕊
instance Pretty ℕ8 where pretty :: ℕ8 -> Doc
pretty = 𝕊 -> Doc
ppLit (𝕊 -> Doc) -> (ℕ8 -> 𝕊) -> ℕ8 -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ ℕ8 -> 𝕊
forall a. Show a => a -> 𝕊
show𝕊
instance Pretty ℤ where pretty :: ℤ -> Doc
pretty = 𝕊 -> Doc
ppLit (𝕊 -> Doc) -> (ℤ -> 𝕊) -> ℤ -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ ℤ -> 𝕊
forall a. Show a => a -> 𝕊
show𝕊
instance Pretty ℤ64 where pretty :: ℤ64 -> Doc
pretty = 𝕊 -> Doc
ppLit (𝕊 -> Doc) -> (ℤ64 -> 𝕊) -> ℤ64 -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ ℤ64 -> 𝕊
forall a. Show a => a -> 𝕊
show𝕊
instance Pretty ℤ32 where pretty :: ℤ32 -> Doc
pretty = 𝕊 -> Doc
ppLit (𝕊 -> Doc) -> (ℤ32 -> 𝕊) -> ℤ32 -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ ℤ32 -> 𝕊
forall a. Show a => a -> 𝕊
show𝕊
instance Pretty ℤ16 where pretty :: ℤ16 -> Doc
pretty = 𝕊 -> Doc
ppLit (𝕊 -> Doc) -> (ℤ16 -> 𝕊) -> ℤ16 -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ ℤ16 -> 𝕊
forall a. Show a => a -> 𝕊
show𝕊
instance Pretty ℤ8 where pretty :: ℤ8 -> Doc
pretty = 𝕊 -> Doc
ppLit (𝕊 -> Doc) -> (ℤ8 -> 𝕊) -> ℤ8 -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ ℤ8 -> 𝕊
forall a. Show a => a -> 𝕊
show𝕊
instance Pretty ℚ where pretty :: ℚ -> Doc
pretty = 𝕊 -> Doc
ppLit (𝕊 -> Doc) -> (ℚ -> 𝕊) -> ℚ -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ ℚ -> 𝕊
forall a. Show a => a -> 𝕊
show𝕊
instance Pretty ℚᴾ where pretty :: ℚᴾ -> Doc
pretty = 𝕊 -> Doc
ppLit (𝕊 -> Doc) -> (ℚᴾ -> 𝕊) -> ℚᴾ -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ ℚᴾ -> 𝕊
forall a. Show a => a -> 𝕊
show𝕊
instance Pretty 𝔻 where pretty :: 𝔻 -> Doc
pretty = 𝕊 -> Doc
ppLit (𝕊 -> Doc) -> (𝔻 -> 𝕊) -> 𝔻 -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ 𝔻 -> 𝕊
forall a. Show a => a -> 𝕊
show𝕊
instance Pretty 𝔻ᴾ where pretty :: 𝔻ᴾ -> Doc
pretty (𝔻ᴾ 𝔻
d) = 𝕊 -> Doc
ppLit (𝕊 -> Doc) -> 𝕊 -> Doc
forall a b. (a -> b) -> a -> b
$ 𝔻 -> 𝕊
forall a. Show a => a -> 𝕊
show𝕊 𝔻
d
instance Pretty ℝ where
pretty :: ℝ -> Doc
pretty = \case
Integer ℤ
i → ℤ -> Doc
forall a. Pretty a => a -> Doc
pretty ℤ
i
Rational ℚ
q → ℚ -> Doc
forall a. Pretty a => a -> Doc
pretty ℚ
q
Double 𝔻
d → 𝔻 -> Doc
forall a. Pretty a => a -> Doc
pretty 𝔻
d
instance Pretty ℝᴾ where
pretty :: ℝᴾ -> Doc
pretty = \case
Natural ℕ
n → ℕ -> Doc
forall a. Pretty a => a -> Doc
pretty ℕ
n
Rationalᴾ ℚᴾ
q → ℚᴾ -> Doc
forall a. Pretty a => a -> Doc
pretty ℚᴾ
q
Doubleᴾ 𝔻ᴾ
d → 𝔻ᴾ -> Doc
forall a. Pretty a => a -> Doc
pretty 𝔻ᴾ
d
instance Pretty Time where pretty :: Time -> Doc
pretty = 𝕊 -> Doc
ppLit (𝕊 -> Doc) -> (Time -> 𝕊) -> Time -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ Time -> 𝕊
forall a. Show a => a -> 𝕊
show𝕊
instance Pretty TimeD where pretty :: TimeD -> Doc
pretty = 𝕊 -> Doc
ppLit (𝕊 -> Doc) -> (TimeD -> 𝕊) -> TimeD -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ TimeD -> 𝕊
forall a. Show a => a -> 𝕊
show𝕊
escape ∷ ℂ → 𝐼 ℂ
escape :: ℂ -> 𝐼 ℂ
escape = \case
ℂ
'"' → 𝕊 -> 𝐼 ℂ
forall a t. ToIter a t => t -> 𝐼 a
iter (𝕊 -> 𝐼 ℂ) -> 𝕊 -> 𝐼 ℂ
forall a b. (a -> b) -> a -> b
$ String -> 𝕊
𝕤 String
"\\\""
ℂ
'\\' → 𝕊 -> 𝐼 ℂ
forall a t. ToIter a t => t -> 𝐼 a
iter (𝕊 -> 𝐼 ℂ) -> 𝕊 -> 𝐼 ℂ
forall a b. (a -> b) -> a -> b
$ String -> 𝕊
𝕤 String
"\\\\"
ℂ
'\n' → 𝕊 -> 𝐼 ℂ
forall a t. ToIter a t => t -> 𝐼 a
iter (𝕊 -> 𝐼 ℂ) -> 𝕊 -> 𝐼 ℂ
forall a b. (a -> b) -> a -> b
$ String -> 𝕊
𝕤 String
"\\n"
ℂ
'\t' → 𝕊 -> 𝐼 ℂ
forall a t. ToIter a t => t -> 𝐼 a
iter (𝕊 -> 𝐼 ℂ) -> 𝕊 -> 𝐼 ℂ
forall a b. (a -> b) -> a -> b
$ String -> 𝕊
𝕤 String
"\\t"
ℂ
'\r' → 𝕊 -> 𝐼 ℂ
forall a t. ToIter a t => t -> 𝐼 a
iter (𝕊 -> 𝐼 ℂ) -> 𝕊 -> 𝐼 ℂ
forall a b. (a -> b) -> a -> b
$ String -> 𝕊
𝕤 String
"\\r"
ℂ
'\b' → 𝕊 -> 𝐼 ℂ
forall a t. ToIter a t => t -> 𝐼 a
iter (𝕊 -> 𝐼 ℂ) -> 𝕊 -> 𝐼 ℂ
forall a b. (a -> b) -> a -> b
$ String -> 𝕊
𝕤 String
"\\b"
ℂ
'\f' → 𝕊 -> 𝐼 ℂ
forall a t. ToIter a t => t -> 𝐼 a
iter (𝕊 -> 𝐼 ℂ) -> 𝕊 -> 𝐼 ℂ
forall a b. (a -> b) -> a -> b
$ String -> 𝕊
𝕤 String
"\\f"
ℂ
c' → ℂ -> 𝐼 ℂ
forall a t. Single a t => a -> t
single ℂ
c'
instance Pretty ℂ where
pretty :: ℂ -> Doc
pretty ℂ
c = 𝕊 -> Doc
ppLit (𝕊 -> Doc) -> 𝕊 -> Doc
forall a b. (a -> b) -> a -> b
$ 𝐼 ℂ -> 𝕊
forall t. ToIter ℂ t => t -> 𝕊
string (𝐼 ℂ -> 𝕊) -> 𝐼 ℂ -> 𝕊
forall a b. (a -> b) -> a -> b
$ [𝐼 ℂ] -> 𝐼 ℂ
forall a t. (Monoid a, ToIter a t) => t -> a
concat
[ 𝕊 -> 𝐼 ℂ
forall a t. ToIter a t => t -> 𝐼 a
iter (𝕊 -> 𝐼 ℂ) -> 𝕊 -> 𝐼 ℂ
forall a b. (a -> b) -> a -> b
$ String -> 𝕊
𝕤 String
"'"
, ℂ -> 𝐼 ℂ
escape ℂ
c
, 𝕊 -> 𝐼 ℂ
forall a t. ToIter a t => t -> 𝐼 a
iter (𝕊 -> 𝐼 ℂ) -> 𝕊 -> 𝐼 ℂ
forall a b. (a -> b) -> a -> b
$ String -> 𝕊
𝕤 String
"'"
]
instance Pretty 𝕊 where
pretty :: 𝕊 -> Doc
pretty 𝕊
s = 𝕊 -> Doc
ppLit (𝕊 -> Doc) -> 𝕊 -> Doc
forall a b. (a -> b) -> a -> b
$ 𝐼 ℂ -> 𝕊
forall t. ToIter ℂ t => t -> 𝕊
string (𝐼 ℂ -> 𝕊) -> 𝐼 ℂ -> 𝕊
forall a b. (a -> b) -> a -> b
$ [𝐼 ℂ] -> 𝐼 ℂ
forall a t. (Monoid a, ToIter a t) => t -> a
concat
[ 𝕊 -> 𝐼 ℂ
forall a t. ToIter a t => t -> 𝐼 a
iter (𝕊 -> 𝐼 ℂ) -> 𝕊 -> 𝐼 ℂ
forall a b. (a -> b) -> a -> b
$ String -> 𝕊
𝕤 String
"\""
, ℂ -> 𝐼 ℂ
escape (ℂ -> 𝐼 ℂ) -> 𝐼 ℂ -> 𝐼 ℂ
forall (m :: * -> *) a b. Bind m => (a -> m b) -> m a -> m b
*$ 𝕊 -> 𝐼 ℂ
forall a t. ToIter a t => t -> 𝐼 a
iter 𝕊
s
, 𝕊 -> 𝐼 ℂ
forall a t. ToIter a t => t -> 𝐼 a
iter (𝕊 -> 𝐼 ℂ) -> 𝕊 -> 𝐼 ℂ
forall a b. (a -> b) -> a -> b
$ String -> 𝕊
𝕤 String
"\""
]
instance (Pretty a,Pretty b) ⇒ Pretty (a,b) where
pretty :: (a, b) -> Doc
pretty (a
a,b
b) = Doc -> Doc -> Doc -> [Doc] -> Doc
forall t. ToIter Doc t => Doc -> Doc -> Doc -> t -> Doc
ppCollection (𝕊 -> Doc
ppPun 𝕊
"(") (𝕊 -> Doc
ppPun 𝕊
")") (𝕊 -> Doc
ppPun 𝕊
",") [a -> Doc
forall a. Pretty a => a -> Doc
pretty a
a, b -> Doc
forall a. Pretty a => a -> Doc
pretty b
b]
instance (Pretty a,Pretty b) ⇒ Pretty (a ∧ b) where
pretty :: (a ∧ b) -> Doc
pretty (a
a :* b
b) = Doc -> Doc -> Doc -> [Doc] -> Doc
forall t. ToIter Doc t => Doc -> Doc -> Doc -> t -> Doc
ppCollection (𝕊 -> Doc
ppPun 𝕊
"⟨") (𝕊 -> Doc
ppPun 𝕊
"⟩") (𝕊 -> Doc
ppPun 𝕊
",") [a -> Doc
forall a. Pretty a => a -> Doc
pretty a
a, b -> Doc
forall a. Pretty a => a -> Doc
pretty b
b]
instance (Pretty a) ⇒ Pretty (() → a) where pretty :: (() -> a) -> Doc
pretty = a -> Doc
forall a. Pretty a => a -> Doc
pretty (a -> Doc) -> ((() -> a) -> a) -> (() -> a) -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ () -> (() -> a) -> a
forall a b. a -> (a -> b) -> b
appto ()
instance (Pretty a) ⇒ Pretty (𝐿 a) where
pretty :: 𝐿 a -> Doc
pretty = Doc -> Doc -> Doc -> 𝐼 Doc -> Doc
forall t. ToIter Doc t => Doc -> Doc -> Doc -> t -> Doc
ppCollection (𝕊 -> Doc
ppPun 𝕊
"[") (𝕊 -> Doc
ppPun 𝕊
"]") (𝕊 -> Doc
ppPun 𝕊
",") (𝐼 Doc -> Doc) -> (𝐼 a -> 𝐼 Doc) -> 𝐼 a -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ (a -> Doc) -> 𝐼 a -> 𝐼 Doc
forall a b. (a -> b) -> 𝐼 a -> 𝐼 b
forall (t :: * -> *) a b. Functor t => (a -> b) -> t a -> t b
map a -> Doc
forall a. Pretty a => a -> Doc
pretty (𝐼 a -> Doc) -> (𝐿 a -> 𝐼 a) -> 𝐿 a -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ 𝐿 a -> 𝐼 a
forall a t. ToIter a t => t -> 𝐼 a
iter
instance (Pretty a) ⇒ Pretty [a] where
pretty :: [a] -> Doc
pretty = Doc -> Doc -> Doc -> 𝐼 Doc -> Doc
forall t. ToIter Doc t => Doc -> Doc -> Doc -> t -> Doc
ppCollection (𝕊 -> Doc
ppPun 𝕊
"[") (𝕊 -> Doc
ppPun 𝕊
"]") (𝕊 -> Doc
ppPun 𝕊
",") (𝐼 Doc -> Doc) -> (𝐼 a -> 𝐼 Doc) -> 𝐼 a -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ (a -> Doc) -> 𝐼 a -> 𝐼 Doc
forall a b. (a -> b) -> 𝐼 a -> 𝐼 b
forall (t :: * -> *) a b. Functor t => (a -> b) -> t a -> t b
map a -> Doc
forall a. Pretty a => a -> Doc
pretty (𝐼 a -> Doc) -> ([a] -> 𝐼 a) -> [a] -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ [a] -> 𝐼 a
forall a t. ToIter a t => t -> 𝐼 a
iter
instance (Pretty a) ⇒ Pretty (𝐼 a) where
pretty :: 𝐼 a -> Doc
pretty 𝐼 a
xs = Doc -> 𝐿 Doc -> Doc
forall t. ToIter Doc t => Doc -> t -> Doc
ppApp (𝕊 -> Doc
ppString 𝕊
"𝐼") (𝐿 Doc -> Doc) -> 𝐿 Doc -> Doc
forall a b. (a -> b) -> a -> b
$ [Doc] -> 𝐿 Doc
forall a t. ToIter a t => t -> 𝐿 a
list [𝐿 a -> Doc
forall a. Pretty a => a -> Doc
pretty (𝐿 a -> Doc) -> 𝐿 a -> Doc
forall a b. (a -> b) -> a -> b
$ 𝐼 a -> 𝐿 a
forall a t. ToIter a t => t -> 𝐿 a
list 𝐼 a
xs]
instance (Pretty a) ⇒ Pretty (𝐼C a) where
pretty :: 𝐼C a -> Doc
pretty 𝐼C a
xs = Doc -> 𝐿 Doc -> Doc
forall t. ToIter Doc t => Doc -> t -> Doc
ppApp (𝕊 -> Doc
ppString 𝕊
"𝐼C") (𝐿 Doc -> Doc) -> 𝐿 Doc -> Doc
forall a b. (a -> b) -> a -> b
$ [Doc] -> 𝐿 Doc
forall a t. ToIter a t => t -> 𝐿 a
list [𝐿 a -> Doc
forall a. Pretty a => a -> Doc
pretty (𝐿 a -> Doc) -> 𝐿 a -> Doc
forall a b. (a -> b) -> a -> b
$ 𝐼C a -> 𝐿 a
forall a t. ToIter a t => t -> 𝐿 a
list 𝐼C a
xs]
instance (Pretty a) ⇒ Pretty (𝑄 a) where
pretty :: 𝑄 a -> Doc
pretty 𝑄 a
xs = Doc -> 𝐿 Doc -> Doc
forall t. ToIter Doc t => Doc -> t -> Doc
ppApp (𝕊 -> Doc
ppString 𝕊
"𝑄") (𝐿 Doc -> Doc) -> 𝐿 Doc -> Doc
forall a b. (a -> b) -> a -> b
$ [Doc] -> 𝐿 Doc
forall a t. ToIter a t => t -> 𝐿 a
list [𝐿 a -> Doc
forall a. Pretty a => a -> Doc
pretty (𝐿 a -> Doc) -> 𝐿 a -> Doc
forall a b. (a -> b) -> a -> b
$ 𝑄 a -> 𝐿 a
forall a t. ToIter a t => t -> 𝐿 a
list 𝑄 a
xs]
instance (Pretty a) ⇒ Pretty (𝑃 a) where
pretty :: 𝑃 a -> Doc
pretty = Doc -> Doc -> Doc -> 𝐼 Doc -> Doc
forall t. ToIter Doc t => Doc -> Doc -> Doc -> t -> Doc
ppCollection (𝕊 -> Doc
ppPun 𝕊
"{") (𝕊 -> Doc
ppPun 𝕊
"}") (𝕊 -> Doc
ppPun 𝕊
",") (𝐼 Doc -> Doc) -> (𝐼 a -> 𝐼 Doc) -> 𝐼 a -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ (a -> Doc) -> 𝐼 a -> 𝐼 Doc
forall a b. (a -> b) -> 𝐼 a -> 𝐼 b
forall (t :: * -> *) a b. Functor t => (a -> b) -> t a -> t b
map a -> Doc
forall a. Pretty a => a -> Doc
pretty (𝐼 a -> Doc) -> (𝑃 a -> 𝐼 a) -> 𝑃 a -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ 𝑃 a -> 𝐼 a
forall a t. ToIter a t => t -> 𝐼 a
iter
instance (Pretty k,Pretty v) ⇒ Pretty (k ⇰ v) where
pretty :: (k ⇰ v) -> Doc
pretty = Doc -> 𝐼 (Doc ∧ Doc) -> Doc
forall t. ToIter (Doc ∧ Doc) t => Doc -> t -> Doc
ppRecord (𝕊 -> Doc
ppPun 𝕊
"↦") (𝐼 (Doc ∧ Doc) -> Doc)
-> (𝐼 (k ∧ v) -> 𝐼 (Doc ∧ Doc)) -> 𝐼 (k ∧ v) -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ ((k ∧ v) -> Doc ∧ Doc) -> 𝐼 (k ∧ v) -> 𝐼 (Doc ∧ Doc)
forall a b. (a -> b) -> 𝐼 a -> 𝐼 b
forall (t :: * -> *) a b. Functor t => (a -> b) -> t a -> t b
map ((k -> Doc) -> (v -> Doc) -> (k ∧ v) -> Doc ∧ Doc
forall a₁ a₂ b₁ b₂.
(a₁ -> a₂) -> (b₁ -> b₂) -> (a₁ ∧ b₁) -> a₂ ∧ b₂
mapPair k -> Doc
forall a. Pretty a => a -> Doc
pretty v -> Doc
forall a. Pretty a => a -> Doc
pretty) (𝐼 (k ∧ v) -> Doc) -> ((k ⇰ v) -> 𝐼 (k ∧ v)) -> (k ⇰ v) -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ (k ⇰ v) -> 𝐼 (k ∧ v)
forall a t. ToIter a t => t -> 𝐼 a
iter
instance (Pretty a) ⇒ Pretty (𝕍 a) where
pretty :: 𝕍 a -> Doc
pretty 𝕍 a
xs = Doc -> 𝐿 Doc -> Doc
forall t. ToIter Doc t => Doc -> t -> Doc
ppApp (𝕊 -> Doc
ppString 𝕊
"𝕍") (𝐿 Doc -> Doc) -> 𝐿 Doc -> Doc
forall a b. (a -> b) -> a -> b
$ [Doc] -> 𝐿 Doc
forall a t. ToIter a t => t -> 𝐿 a
list [𝐿 a -> Doc
forall a. Pretty a => a -> Doc
pretty (𝐿 a -> Doc) -> 𝐿 a -> Doc
forall a b. (a -> b) -> a -> b
$ 𝕍 a -> 𝐿 a
forall a t. ToIter a t => t -> 𝐿 a
list 𝕍 a
xs]
instance (Pretty a) ⇒ Pretty (𝕍S n a) where
pretty :: 𝕍S n a -> Doc
pretty 𝕍S n a
xs = Doc -> 𝐿 Doc -> Doc
forall t. ToIter Doc t => Doc -> t -> Doc
ppApp (𝕊 -> Doc
ppString 𝕊
"𝕍S") (𝐿 Doc -> Doc) -> 𝐿 Doc -> Doc
forall a b. (a -> b) -> a -> b
$ [Doc] -> 𝐿 Doc
forall a t. ToIter a t => t -> 𝐿 a
list [𝐿 a -> Doc
forall a. Pretty a => a -> Doc
pretty (𝐿 a -> Doc) -> 𝐿 a -> Doc
forall a b. (a -> b) -> a -> b
$ 𝕍S n a -> 𝐿 a
forall a t. ToIter a t => t -> 𝐿 a
list 𝕍S n a
xs]
instance (Storable a,Pretty a) ⇒ Pretty (𝕌 a) where
pretty :: 𝕌 a -> Doc
pretty 𝕌 a
xs = Doc -> 𝐿 Doc -> Doc
forall t. ToIter Doc t => Doc -> t -> Doc
ppApp (𝕊 -> Doc
ppString 𝕊
"𝕌") (𝐿 Doc -> Doc) -> 𝐿 Doc -> Doc
forall a b. (a -> b) -> a -> b
$ [Doc] -> 𝐿 Doc
forall a t. ToIter a t => t -> 𝐿 a
list [𝐿 a -> Doc
forall a. Pretty a => a -> Doc
pretty (𝐿 a -> Doc) -> 𝐿 a -> Doc
forall a b. (a -> b) -> a -> b
$ 𝕌 a -> 𝐿 a
forall a t. ToIter a t => t -> 𝐿 a
list 𝕌 a
xs]
instance (Storable a,Pretty a) ⇒ Pretty (𝕌S n a) where
pretty :: 𝕌S n a -> Doc
pretty 𝕌S n a
xs = Doc -> 𝐿 Doc -> Doc
forall t. ToIter Doc t => Doc -> t -> Doc
ppApp (𝕊 -> Doc
ppString 𝕊
"𝕌S") (𝐿 Doc -> Doc) -> 𝐿 Doc -> Doc
forall a b. (a -> b) -> a -> b
$ [Doc] -> 𝐿 Doc
forall a t. ToIter a t => t -> 𝐿 a
list [𝐿 a -> Doc
forall a. Pretty a => a -> Doc
pretty (𝐿 a -> Doc) -> 𝐿 a -> Doc
forall a b. (a -> b) -> a -> b
$ 𝕌S n a -> 𝐿 a
forall a t. ToIter a t => t -> 𝐿 a
list 𝕌S n a
xs]
instance (Pretty a) ⇒ Pretty (AddNull a) where
pretty :: AddNull a -> Doc
pretty AddNull a
Null = 𝕊 -> Doc
ppCon 𝕊
"•"
pretty (AddNull a
x) = a -> Doc
forall a. Pretty a => a -> Doc
pretty a
x
instance (Pretty a) ⇒ Pretty (ZOM a) where
pretty :: ZOM a -> Doc
pretty ZOM a
NullZOM = 𝕊 -> Doc
ppCon 𝕊
"⊥"
pretty (OneZOM a
x) = a -> Doc
forall a. Pretty a => a -> Doc
pretty a
x
pretty ZOM a
MoreZOM = 𝕊 -> Doc
ppCon 𝕊
"⊤"
instance (Pretty a) ⇒ Pretty (AddBot a) where
pretty :: AddBot a -> Doc
pretty AddBot a
Bot = 𝕊 -> Doc
ppCon 𝕊
"⊥"
pretty (AddBot a
x) = a -> Doc
forall a. Pretty a => a -> Doc
pretty a
x
instance (Pretty a) ⇒ Pretty (AddTop a) where
pretty :: AddTop a -> Doc
pretty AddTop a
Top = 𝕊 -> Doc
ppCon 𝕊
"⊤"
pretty (AddTop a
x) = a -> Doc
forall a. Pretty a => a -> Doc
pretty a
x
instance (Pretty a) ⇒ Pretty (AddBT a) where
pretty :: AddBT a -> Doc
pretty AddBT a
BotBT = 𝕊 -> Doc
ppCon 𝕊
"⊥"
pretty AddBT a
TopBT = 𝕊 -> Doc
ppCon 𝕊
"⊤"
pretty (AddBT a
x) = a -> Doc
forall a. Pretty a => a -> Doc
pretty a
x
instance Pretty Stack.CallStack where pretty :: CallStack -> Doc
pretty = 𝕊 -> Doc
ppString (𝕊 -> Doc) -> (String -> 𝕊) -> String -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ String -> 𝕊
forall t. ToIter ℂ t => t -> 𝕊
string (String -> Doc) -> (CallStack -> String) -> CallStack -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
∘ CallStack -> String
Stack.prettyCallStack
colorsDemo ∷ Doc
colorsDemo :: Doc
colorsDemo =
𝕍 (𝕊 ∧ Color)
-> (forall {n :: ℕ}. 𝒩64 n => 𝕍S n (𝕊 ∧ Color) -> Doc) -> Doc
forall a b. 𝕍 a -> (forall (n :: ℕ). 𝒩64 n => 𝕍S n a -> b) -> b
d𝕍 (𝐼 (𝕊 ∧ Color) -> 𝕍 (𝕊 ∧ Color)
forall a t. ToIter a t => t -> 𝕍 a
vec (𝐼 (𝕊 ∧ Color) -> 𝕍 (𝕊 ∧ Color)) -> 𝐼 (𝕊 ∧ Color) -> 𝕍 (𝕊 ∧ Color)
forall a b. (a -> b) -> a -> b
$ 𝐿 (𝕊 ∧ Color) -> 𝐼 (𝕊 ∧ Color)
forall a t. ToIter a t => t -> 𝐼 a
iter 𝐿 (𝕊 ∧ Color)
allColors) ((forall {n :: ℕ}. 𝒩64 n => 𝕍S n (𝕊 ∧ Color) -> Doc) -> Doc)
-> (forall {n :: ℕ}. 𝒩64 n => 𝕍S n (𝕊 ∧ Color) -> Doc) -> Doc
forall a b. (a -> b) -> a -> b
HS.$ \ 𝕍S n (𝕊 ∧ Color)
allColorsS →
𝕍S 5 HAlign -> 𝕍S n VAlign -> 𝕍S n (𝕍S 5 Doc) -> Doc
forall (m :: ℕ) (n :: ℕ).
(𝒩 m, 𝒩 n) =>
𝕍S n HAlign -> 𝕍S m VAlign -> 𝕍S m (𝕍S n Doc) -> Doc
ppMatrix (ℕ64S 5 -> HAlign -> 𝕍S 5 HAlign
forall (n :: ℕ) a. 𝒩 n => ℕ64S n -> a -> 𝕍S n a
const𝕍S ℕ64S 5
forall (n :: ℕ). 𝒩64 n => ℕ64S n
𝕟64s HAlign
LH) (ℕ64S n -> VAlign -> 𝕍S n VAlign
forall (n :: ℕ) a. 𝒩 n => ℕ64S n -> a -> 𝕍S n a
const𝕍S ℕ64S n
forall (n :: ℕ). 𝒩64 n => ℕ64S n
𝕟64s VAlign
TV) (𝕍S n (𝕍S 5 Doc) -> Doc) -> 𝕍S n (𝕍S 5 Doc) -> Doc
forall a b. (a -> b) -> a -> b
$ 𝕍S n (𝕊 ∧ Color) -> ((𝕊 ∧ Color) -> 𝕍S 5 Doc) -> 𝕍S n (𝕍S 5 Doc)
forall (t :: * -> *) a b. Functor t => t a -> (a -> b) -> t b
mapOn 𝕍S n (𝕊 ∧ Color)
allColorsS (((𝕊 ∧ Color) -> 𝕍S 5 Doc) -> 𝕍S n (𝕍S 5 Doc))
-> ((𝕊 ∧ Color) -> 𝕍S 5 Doc) -> 𝕍S n (𝕍S 5 Doc)
forall a b. (a -> b) -> a -> b
$ \ (𝕊
n :* Color
c) →
𝐼S 5 Doc -> 𝕍S 5 Doc
forall (n :: ℕ) a. 𝒩 n => 𝐼S n a -> 𝕍S n a
svec (𝐼S 5 Doc -> 𝕍S 5 Doc) -> 𝐼S 5 Doc -> 𝕍S 5 Doc
forall a b. (a -> b) -> a -> b
$ Doc -> 𝐼S 1 Doc
forall a. a -> 𝐼S 1 a
forall (t :: ℕ -> * -> *) a. SingleS t => a -> t 1 a
𝔢 (𝕊 -> Doc
ppString 𝕊
n)
𝐼S 1 Doc -> 𝐼S 1 Doc -> 𝐼S (1 + 1) Doc
forall (n₁ :: ℕ) a (n₂ :: ℕ). 𝐼S n₁ a -> 𝐼S n₂ a -> 𝐼S (n₁ + n₂) a
forall {k} (t :: ℕ -> k -> *) (n₁ :: ℕ) (a :: k) (n₂ :: ℕ).
AppendS t =>
t n₁ a -> t n₂ a -> t (n₁ + n₂) a
⧺♮ Doc -> 𝐼S 1 Doc
forall a. a -> 𝐼S 1 a
forall (t :: ℕ -> * -> *) a. SingleS t => a -> t 1 a
𝔢 (Color -> Doc -> Doc
ppFG Color
c (Doc -> Doc) -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ 𝕊 -> Doc
ppString 𝕊
"XXXXX")
𝐼S (1 + 1) Doc -> 𝐼S 1 Doc -> 𝐼S ((1 + 1) + 1) Doc
forall (n₁ :: ℕ) a (n₂ :: ℕ). 𝐼S n₁ a -> 𝐼S n₂ a -> 𝐼S (n₁ + n₂) a
forall {k} (t :: ℕ -> k -> *) (n₁ :: ℕ) (a :: k) (n₂ :: ℕ).
AppendS t =>
t n₁ a -> t n₂ a -> t (n₁ + n₂) a
⧺♮ Doc -> 𝐼S 1 Doc
forall a. a -> 𝐼S 1 a
forall (t :: ℕ -> * -> *) a. SingleS t => a -> t 1 a
𝔢 (Color -> Doc -> Doc
ppBG Color
c (Doc -> Doc) -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ 𝕊 -> Doc
ppString 𝕊
"XXXXX")
𝐼S ((1 + 1) + 1) Doc -> 𝐼S 1 Doc -> 𝐼S (((1 + 1) + 1) + 1) Doc
forall (n₁ :: ℕ) a (n₂ :: ℕ). 𝐼S n₁ a -> 𝐼S n₂ a -> 𝐼S (n₁ + n₂) a
forall {k} (t :: ℕ -> k -> *) (n₁ :: ℕ) (a :: k) (n₂ :: ℕ).
AppendS t =>
t n₁ a -> t n₂ a -> t (n₁ + n₂) a
⧺♮ Doc -> 𝐼S 1 Doc
forall a. a -> 𝐼S 1 a
forall (t :: ℕ -> * -> *) a. SingleS t => a -> t 1 a
𝔢 (Color -> Doc -> Doc
ppBG Color
black (Doc -> Doc) -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ Color -> Doc -> Doc
ppFG Color
c (Doc -> Doc) -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ 𝕊 -> Doc
ppString 𝕊
"XXXXX")
𝐼S (((1 + 1) + 1) + 1) Doc
-> 𝐼S 1 Doc -> 𝐼S ((((1 + 1) + 1) + 1) + 1) Doc
forall (n₁ :: ℕ) a (n₂ :: ℕ). 𝐼S n₁ a -> 𝐼S n₂ a -> 𝐼S (n₁ + n₂) a
forall {k} (t :: ℕ -> k -> *) (n₁ :: ℕ) (a :: k) (n₂ :: ℕ).
AppendS t =>
t n₁ a -> t n₂ a -> t (n₁ + n₂) a
⧺♮ Doc -> 𝐼S 1 Doc
forall a. a -> 𝐼S 1 a
forall (t :: ℕ -> * -> *) a. SingleS t => a -> t 1 a
𝔢 (Color -> Doc -> Doc
ppFG Color
white (Doc -> Doc) -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ Color -> Doc -> Doc
ppBG Color
c (Doc -> Doc) -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ 𝕊 -> Doc
ppString 𝕊
"XXXXX")