This is not good. Dart should be able to infer that `typedef int intFactory();` and `typedef string stringFactory();` are different things. So I will remove that `if(value is ToDocumentFunction) {...}` statement.