Question: Consider the following binary tree data type. > data Tree a Nil | Node a (Tree a) (Tree a) > deriving (Eq. Read,Show) (a)

Consider the following binary tree data type. > data Tree a Nil 

Consider the following binary tree data type. > data Tree a Nil | Node a (Tree a) (Tree a) > deriving (Eq. Read,Show) (a) Give the Haskell polymorphic type for mapT, the map function over the binary tree data type above. > mapT:: (b) Give a Haskell code definition for the mapT function. (c) Give the Haskell polymorphic type for foldrT, a foldr function over the binary tree data type above. Note that it doesn't have to conform to Foldable, BUT your type must be consistent with your definition ion part (d). > foldrT :: (d) Give a Haskell code definition for the foldrT function.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!