| 1 |
------------------------------------------------------------------------ |
| 2 |
-- The Agda standard library |
| 3 |
-- |
| 4 |
-- Fancy display functions for Vec-based tables |
| 5 |
------------------------------------------------------------------------ |
| 6 |
|
| 7 |
{-# OPTIONS --safe --cubical-compatible #-} |
| 8 |
|
| 9 |
module Text.Tabular.Vec where |
| 10 |
|
| 11 |
open import Data.List.Base using (List) |
| 12 |
open import Data.Product.Base as Prod using (uncurry) |
| 13 |
open import Data.String using (String; rectangle; fromAlignment) |
| 14 |
open import Data.Vec.Base |
| 15 |
open import Function.Base |
| 16 |
|
| 17 |
open import Text.Tabular.Base |
| 18 |
|
| 19 |
display : ∀ {m n} → TabularConfig → Vec Alignment n → Vec (Vec String n) m → |
| 20 |
List String |
| 21 |
display c a = unsafeDisplay c |
| 22 |
∘ toList |
| 23 |
∘ map toList |
| 24 |
∘ transpose |
| 25 |
∘ map (uncurry rectangle ∘ unzip) |
| 26 |
∘ transpose |
| 27 |
∘ map (zip (map fromAlignment a)) |