If we do not change `prettyTree` implementation we still need `children.map((Tree t) => t.pretty)`. `Pretty` is not a sub-type of `Document` and current `prettyTree` signature accepts only `Iterable<Document>` as argument, instead of `Iterable<Pretty>`.

Either doing the `children.map(...)` thing in the `prettyTree` implementation, we can never guarantee that client does not call `prettyTree` with any list of documents, not just those that are his children.

The best solution I could think to make clients calling `prettyTree` on lists that are the same type is making a new `PrettyTree<T extends PrettyTree<T>>` mixin and port prettyTree implementation to it, like this one:

```dart
abstract class PrettyTree<T extends PrettyTree<T>> {
  Document get pretty;

  // prettyTree is part of the mixin and modified 
  // to accept only lists of the same type
  Document prettyTree(String name, Iterable<T> children,
                    {int indentation: _DEFAULT_INDENTATION}) =>
    text(name) + _enclose(children.map((T t) => t.pretty),
        (space + openingBrace), closingBrace, empty, indentation);
}
```

and the client:
```dart
class Tree extends Object with PrettyTree<Tree> {
  final String name;
  final List<Tree> children;

  Tree(this.name, this.children);

  Document get pretty =>  prettyTree(name, children);
}
```

Dart analyzer didn't complain, but Dart still lacks support of types in mixins, so when I ran the example I've got **type parameter 'T': type bounds not yet implemented for mixins**