defaultLineWidth : Nat Approximate line-width budget for printed cubical tensors. When a row of
fixed-width cells does not fit on a single line, the renderer breaks it
onto continuation lines so output stays within roughly this many columns.
Matches NumPy's default `linewidth = 75`.
Visibility: public exportGrid : Type -> Type A `Grid a` is a rectangular 2D matrix. Unlike `List >@ List`, which
produces ragged arrays, this produces rectangular ones
Visibility: public exportgridHeight : Grid a -> Nat- Visibility: public export
gridWidth : Grid a -> Nat- Visibility: public export
gridIndex : (g : Grid a) -> Fin (gridHeight g) -> Fin (gridWidth g) -> a Look up a cell. Cost depends on how `g` was built; for grids made from
chained combinators the cost is proportional to the composition depth.
Visibility: public exportmkGrid : (h : Nat) -> (w : Nat) -> (Fin h -> Fin w -> a) -> Grid a Build a grid from a height, width, and 2D index function. O(1).
Visibility: public exportgridRows : Grid a -> List (List a) Convert a `Grid` into a list-of-rows view. Walks the grid once, so this
is the natural one-shot materialisation point for delayed grids.
Visibility: public exportshowGrid : Grid Char -> String Format a `Grid Char` as a multi-line string. Trailing pad characters on
each line are stripped, matching NumPy's printing conventions.
Visibility: public exportemptyGrid : Grid a- Visibility: public export
singleValue : a -> Grid a- Visibility: public export
uniformCol : a -> Nat -> Grid a- Visibility: public export
blankCol : Nat -> Grid Char- Visibility: public export
rowGrid : List a -> Grid a One-row grid built from a list of cells.
Visibility: public exporttopMarkerCol : Char -> Nat -> Grid Char 1-wide column carrying `marker` on its top row and `padCharacter` elsewhere.
`emptyGrid` if the height is zero.
Visibility: public exportbottomMarkerCol : Char -> Nat -> Grid Char 1-wide column carrying `marker` on its bottom row and `padCharacter`
elsewhere. `emptyGrid` if the height is zero.
Visibility: public exportbesideAllGap : a -> Nat -> List (Grid a) -> Grid a Place grids side-by-side with `gap` blank columns between each pair. The
row dimension is the max of the children's heights; shorter children are
padded on the missing rows.
Visibility: public exportbesideAll : a -> List (Grid a) -> Grid a Place grids side-by-side with no gap.
Visibility: public exportaboveAllSep : a -> Nat -> List (Grid a) -> Grid a Stack grids vertically, inserting `sep` blank rows between successive items.
The column dimension is the max of the children's widths; narrower children
are padded on the missing columns.
Visibility: public exportaboveAll : a -> List (Grid a) -> Grid a Stack grids vertically with no separator.
Visibility: public exportpadGridLeft : Nat -> Grid Char -> Grid Char Left-pad a grid with `padCharacter` columns to reach total width `w`.
No-op if `gridWidth g >= w`.
Visibility: public exportaddBorderToGrid : Box => Grid Char -> Grid Char Wrap a grid in a 1-character border specified by `box`.
Visibility: public exportwrapNonEmpty : Box => Grid Char -> Grid Char Wrap a grid in a border if it has more than one row
Visibility: public exportwrapAllIfAnyNonEmpty : Box => List (Grid Char) -> Grid Char -> Grid Char Given a list of grids, make a function that wraps a grid in a border if
any of the grids in the list has more than one row
Visibility: public exporthorizontalListJoin : ListSyntax => List (Grid Char) -> Grid Char Join a list of grids horizontally with a separator between them
Visibility: public exportwrapListBrackets : ListSyntax => Nat -> List (Grid Char) -> Grid Char Wrap a list of grids vertically in `[` ... `]` brackets with `,` markers in
front of subsequent items, as follows:
[item1
,item2
,item3]
`nSep` is the number of blank rows between items:
Visibility: public exportwrappedInnerRow : ListSyntax => Nat -> Nat -> List (Grid Char) -> Grid Char Render a list of equal-width cells as `[ c0 c1 ... cN ]`, breaking the
output onto continuation lines when the single-line layout would exceed
`lineBudget` columns. Continuation lines are indented by one space so
wrapped cells align under `c0`; the closing `]` sits next to the last cell
of the final chunk, so a shorter final chunk leaves trailing whitespace on
its line (NumPy-style).
The single-line layout falls out automatically when `cellsPerLine >= length
children`, so no separate "flat" code path is needed.
Visibility: public exportinterface Display2D : Type -> Type Display a type as a 2D grid of characters.
For `a` being an extension of a container, this can be expresse in terms of
a container morphism... if we use `Maybe <!>`
Parameters: a
Constructor: MkDisplay2D
Methods:
display2D : a -> Grid Char
Implementations:
Display2D (Grid Char) Display2D Int Display2D Integer Display2D Double Display2D Nat Display2D Bool Display2D () Display2D Char Display2D String Display2D a => Display2D (Scalar' a) Display2D a => Display2D (Pair' a) Display2D a => Display2D (List' a) Display2D a => Display2D (BinTree' a) Display2D a => Display2D (Ext BinTreeLeaf a) Display2D a => Display2D (Ext BinTreeNode a) Display2D a => Display2D (Ext (Vect n) a)
display2D : Display2D a => a -> Grid Char- Visibility: public export
display2DFromShow : Show a => a -> Grid Char One-row grid from a `Show` instance.
Visibility: public exportdisplay2DFromSci : ScientificDisplay a => a -> Grid Char One-row grid from a `ScientificDisplay` instance.
Visibility: public exportshowViaDisplay2D : Display2D a => a -> String- Visibility: public export