com.twitter.summingbird.planner.DagOptimizer
If the given Id can be replaced with a simpler expression, return Some(expr) else None.
If the given Id can be replaced with a simpler expression, return Some(expr) else None.
If it is convenient, you might write a partial function and then call .lift to get the correct Function type
(a ++ b).flatMap(fn) == (a.flatMap(fn) ++ b.flatMap(fn)) (a ++ b).optionMap(fn) == (a.optionMap(fn) ++ b.optionMap(fn)) and since Merge is usually a no-op when combined with a grouping operation, it often pays to get merges as high the graph as possible.