Initial release
This is a fork and polish of code @johnynek originally developed in https://github.com/twitter/summingbird for graph optimization there. See the original code here:
and the rules we have to optimize summingbird graphs here:
https://github.com/twitter/summingbird/blob/develop/summingbird-core/src/main/scala/com/twitter/summingbird/planner/DagOptimizer.scala#L226
Users can use this to apply custom optimizations to any AST they have before passing it to other libraries. In our use case at Stripe, we wanted some custom optimization of summingbird and scalding graphs, as well as other internal ASTs.