Exercises part 2
-
Implement interfaces
Equals
,Comp
,Concat
, andEmpty
for pairs, constraining your implementations as necessary. (Note, that multiple constraints can be given sequentially like other function arguments:Comp a => Comp b => Comp (a,b)
.) -
Below is an implementation of a binary tree. Implement interfaces
Equals
andConcat
for this type.data Tree : Type -> Type where Leaf : a -> Tree a Node : Tree a -> Tree a -> Tree a