------------------------------------------------------------------------ -- The Agda standard library -- -- 1 dimensional pretty printing of binary trees ------------------------------------------------------------------------ {-# OPTIONS --cubical-compatible --sized-types #-} open import Level using (Level) open import Data.List.Base as List using (List; []; [_]; _∷_; _∷ʳ_) open import Data.String.Base using (String) import Data.Tree.Rose as Rose import Data.Tree.Rose.Show as Rose open import Data.Tree.Binary using (Tree; map) open import Function.Base using (_∘′_; id) module Data.Tree.Binary.Show where private variable a : Level N L : Set a display : Tree (List String) (List String) → List String display = Rose.display ∘′ Rose.fromBinary id id show : (N → List String) → (L → List String) → Tree N L → List String show nodeStr leafStr = display ∘′ map nodeStr leafStr showSimple : (N → String) → (L → String) → Tree N L → List String showSimple nodeStr leafStr = show ([_] ∘′ nodeStr) ([_] ∘′ leafStr)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4