我正在编写一个函数来获取二叉树并以正确的顺序打印出它的值(按顺序颠倒).我遇到的问题是,当我调用函数时,我一直得到一个非详尽的模式错误
--k is the key and d is the value
-- l is left tree and r is right tree
treeprint (Node l k d r) = treeprint l ++ show k ++ show d ++ treeprint r
treeprint Nil=""
Run Code Online (Sandbox Code Playgroud) haskell ×1