Exercises part 2
-
Implement interfaces
Equals,Comp,Concat, andEmptyfor 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
EqualsandConcatfor this type.data Tree : Type -> Type where Leaf : a -> Tree a Node : Tree a -> Tree a -> Tree a