Given array and fun, returns an array of rose trees where each tree's root is the element and its children are fun(element). [a] -> (a -> [a]) -> RoseTree a
function arrayToRoseTrees(array, fun) {
  return array.map(function(element) {
    return new RoseTree(element, function() { return fun(element); });
  });
}