I'm currently learning Haskell and I have a hard time grasping how Non-Binary Trees work (I'm not that familiar with Binary Trees either but I've managed to get a rudimentary understanding for it).
so I have defined the following datatype:
data Tree = Node a [Tree]
I'm struggling with understanding how the datatype "Tree" is set up in the memory, how you call it and how I should reference a list of [Tree] in my first Node a.
The following example does not work and it illustrates where I have issues with grasping tree structures in Haskell:
t1 = Node 10
t2 = Node 20
t3 = Node 30 [t1, t2]
I'm a lot more comfortable with how object oriented languages handles trees and I would be really grateful if someone could explain and make comparisons to an object oriented language.