The problem is that EmptyTree is of type Tree a for any type of a . Although this will not affect the final output, the compiler wants to know what a means.
The simplest solution is to select a specific type, for example. with show (EmptyTree :: Tree ()) . This uses the device type () , which in a sense is the simplest type, but you can also use any other type with an instance of Show , such as Int , String , etc.
Ganesh sittampalam
source share