ninetynine-1.3.0: Ninety-Nine Haskell Problems
CopyrightCopyright (C) 2021 Yoo Chung
LicenseGPL-3.0-or-later
Maintainerdev@chungyc.org
Safe HaskellSafe-Inferred
LanguageGHC2021

Problems.P65

Description

Part of Ninety-Nine Haskell Problems. Some solutions are in Solutions.P65.

Synopsis

Documentation

layoutLevelConstant :: Tree a -> Tree (a, (Int, Int)) Source #

An alternative layout method is depicted in the illustration below:

Find out the rules and write the corresponding function. Use the same conventions as in Problems.P64.

Examples

>>> layoutLevelConstant tree65
Branch ('n',(15,1)) (Branch ('k',(7,2)) (Branch ('c',(3,3)) ...

Hint

Expand

On a given level, the horizontal distance between neighboring nodes is constant.

tree65 :: Tree Char Source #

Tree used as the example for Problems.P65.