Idris2Doc : Data.Container.Base.Display2D.Display2D

Data.Container.Base.Display2D.Display2D

(source)

Reexports

importpublic Data.Container.Base.Display2D.CharacterMap

Definitions

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 export
Grid : Type->Type
  A `Grid a` is a rectangular 2D matrix. Unlike `List >@ List`, which 
produces ragged arrays, this produces rectangular ones

Visibility: public export
gridHeight : Grida->Nat
Visibility: public export
gridWidth : Grida->Nat
Visibility: public export
gridIndex : (g : Grida) ->Fin (gridHeightg) ->Fin (gridWidthg) ->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 export
mkGrid : (h : Nat) -> (w : Nat) -> (Finh->Finw->a) ->Grida
  Build a grid from a height, width, and 2D index function.  O(1).

Visibility: public export
gridRows : Grida->List (Lista)
  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 export
showGrid : GridChar->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 export
emptyGrid : Grida
Visibility: public export
singleValue : a->Grida
Visibility: public export
uniformCol : a->Nat->Grida
Visibility: public export
blankCol : Nat->GridChar
Visibility: public export
rowGrid : Lista->Grida
  One-row grid built from a list of cells.

Visibility: public export
topMarkerCol : Char->Nat->GridChar
  1-wide column carrying `marker` on its top row and `padCharacter` elsewhere.
`emptyGrid` if the height is zero.

Visibility: public export
bottomMarkerCol : Char->Nat->GridChar
  1-wide column carrying `marker` on its bottom row and `padCharacter`
elsewhere. `emptyGrid` if the height is zero.

Visibility: public export
besideAllGap : a->Nat->List (Grida) ->Grida
  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 export
besideAll : a->List (Grida) ->Grida
  Place grids side-by-side with no gap.

Visibility: public export
aboveAllSep : a->Nat->List (Grida) ->Grida
  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 export
aboveAll : a->List (Grida) ->Grida
  Stack grids vertically with no separator.

Visibility: public export
padGridLeft : Nat->GridChar->GridChar
  Left-pad a grid with `padCharacter` columns to reach total width `w`.
No-op if `gridWidth g >= w`.

Visibility: public export
addBorderToGrid : Box=>GridChar->GridChar
  Wrap a grid in a 1-character border specified by `box`.

Visibility: public export
wrapNonEmpty : Box=>GridChar->GridChar
  Wrap a grid in a border if it has more than one row

Visibility: public export
wrapAllIfAnyNonEmpty : Box=>List (GridChar) ->GridChar->GridChar
  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 export
horizontalListJoin : ListSyntax=>List (GridChar) ->GridChar
  Join a list of grids horizontally with a separator between them

Visibility: public export
wrapListBrackets : ListSyntax=>Nat->List (GridChar) ->GridChar
  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 export
wrappedInnerRow : ListSyntax=>Nat->Nat->List (GridChar) ->GridChar
  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 export
interfaceDisplay2D : 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->GridChar

Implementations:
Display2D (GridChar)
Display2DInt
Display2DInteger
Display2DDouble
Display2DNat
Display2DBool
Display2D ()
Display2DChar
Display2DString
Display2Da=>Display2D (Scalar'a)
Display2Da=>Display2D (Pair'a)
Display2Da=>Display2D (List'a)
Display2Da=>Display2D (BinTree'a)
Display2Da=>Display2D (ExtBinTreeLeafa)
Display2Da=>Display2D (ExtBinTreeNodea)
Display2Da=>Display2D (Ext (Vectn) a)
display2D : Display2Da=>a->GridChar
Visibility: public export
display2DFromShow : Showa=>a->GridChar
  One-row grid from a `Show` instance.

Visibility: public export
display2DFromSci : ScientificDisplaya=>a->GridChar
  One-row grid from a `ScientificDisplay` instance.

Visibility: public export
showViaDisplay2D : Display2Da=>a->String
Visibility: public export