easy 145 tree generation in haskell and javascript