flattenForks function
Implementation
List<List> flattenForks(List t) {
switch (t[0]) {
case NodeId.Empty:
return [];
case NodeId.Fork:
var res = flattenForks(t[1] as List);
res.addAll(flattenForks(t[2] as List));
return res;
default:
return [t];
}
}