Вроде бы простой код
data Tree a = EmptyTree | Node a (Tree a) (Tree a) deriving (Show)
treeToList :: Tree a -> [a]
treeToList EmptyTree = []
treeToList (Node a left right) = a : (treeToList left) : (treeToList right)
Couldn't match expected type `a' with actual type `[a]'
`a' is a rigid type variable bound by
the type signature for treeToList :: Tree a -> [a]
at Trees.hs:20:15
In the return type of a call of `treeToList'
In the first argument of `(:)', namely `(treeToList left)'
In the second argument of `(:)', namely
`(treeToList left) : (treeToList right)'