[Haskell-beginners] tree structure for resolving nested references