I defined the tree type with record syntax way.
data Tree a = Null | Node a {lTree:: Tree a, rTree :: Tree a}
However, when I load it, it shows an error:
• Record syntax is illegal here: {lTree :: Tree a, rTree :: Tree a}
• In the type ‘{lTree :: Tree a, rTree :: Tree a}’
In the definition of data constructor ‘Node’
In the data declaration for ‘Tree’
|
2 | data Tree a = Null | Node a {lTree:: Tree a, rTree :: Tree a}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^