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

Solutions.P67

Description

Some solutions to Problems.P67 of Ninety-Nine Haskell Problems.

Synopsis

Documentation

treeToString :: Tree Char -> String Source #

Somebody represents binary trees as strings of the following form:

a(b(d,e),c(,f(g,)))

Write a function to generate this string representation from a binary tree.

stringToTree :: String -> Maybe (Tree Char) Source #

Write a function to construct a tree from the string representation.