Question: 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
