これが私のコードです:
data Binary_Tree a = Null
|Node {element :: a, left_tree, right_tree :: Binary_Tree a}
deriving (Show, Eq)
--depth_of_tree
dot :: Integral b => Binary_Tree a -> b
dot Null = 0
dot Node (a left right) = 1 + (dot Node (a left right)) + (dot Node (a left right))
ただし、ghciにロードして入力すると
dot Node (2 (Node 3 Null Null) Null)
エラーが出ます:
<interactive>:13:1:
Not in scope: `dot'
Perhaps you meant `not' (imported from Prelude)
私のコードの何が問題なのか誰か教えてください。
アドバイスをくれた人に感謝 XD