It looks like you're new here. If you want to get involved, click one of these buttons!
Recall that a binary tree with leaves valued in A is an element of the initial F-algebra where F is the functor:
\( FA : Set \rightarrow Set; \)
\( X \rightarrow A + X \times X; \)
\( (f : X \rightarrow Y ) \mapsto (idA + f \times f): A + X \times X \rightarrow A + Y \times Y \)
(a) Define a monad T : Set → Set that maps a set A to the set of trees with leaves valued in A.
(b) Implement this monad in Haskell