code: def pretty_tree(x, kids, show):
      
      (MID, END, CONT, LAST, ROOT) = (u'|-- ', u'`-- ', u'|   ', u'    ', u'')
  
      def rec(x, indent, sym):
          line = indent + sym + show(x)
          xs = kids(x)
          if len(xs) == 0:
              return line
          else:
              if sym == MID:
                  next_indent = indent + CONT
              elif sym == ROOT:
                  next_indent = indent + ROOT
              else:
                  next_indent = indent + LAST
              syms = [MID] * (len(xs) - 1) + [END]
              lines = [rec(x, next_indent, sym) for x, sym in zip(xs, syms)]
              return u'\n'.join([line] + lines)
  
      return rec(x, u'', ROOT)
docs: (a, (a -> list(a)), (a -> str)) -> str
  
      Returns a pseudographic tree representation of x similar to the tree command
      in Unix.