Define appropriate versions of the library functions
repeat : : a $->[a]$
repeat $x=x$ where $x s=x: x s$
take : : Int $\rightarrow[a] \rightarrow[a]$
take $0=[]$
take -[]$=[]$
take $n(x: x s)=x:$ take $(n-1) \mathrm{xs}$
replicate : Int $\rightarrow$ a $->$ [a]
replicate $n=$ take $n$ repeat
repeat ::a $\rightarrow[a]$
repeat $\mathrm{x}=\mathrm{xs}$ where $\mathrm{xs}=\mathrm{x}: \mathrm{xs}$
take :: Int $\rightarrow[\mathrm{a}] \rightarrow[a]$
take $0_{-}=[]$
take -[]$=[]$
take $\mathrm{n}(\mathrm{x}: \mathrm{xs})=\mathrm{x}$ : take $(\mathrm{n}-1) \mathrm{xs}$
replicate : : Int $\rightarrow$ a $\rightarrow$ [a]
replicate $n$ = take $n$. repeat
for the following type of binary trees:
data Tree a = Leaf $\mid$ Node (Tree a) a (Tree a) deriving show