Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Here is a mysterious data declaration: data Song = Harmony Song Song | Atom String deriving ( Show , Eq ) Hint ( ? )
Here is a mysterious data declaration:
data Song Harmony Song Song
Atom String
deriving Show Eq
Hint : You can think of a Song as a tree having branches named Harmony, and leaves named
Atom, where the leaves contain strings.
By being sung, a Song changes according to the following rules:
If the song is a Harmony whose left child is a Harmony whose left child is Atom x where the
first character of x is K the song becomes the right child of the left child of the root.
Viewed as trees
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started