Port FlattenSmartConstructors functor to Rust
Summary:
In OCaml, Flatten SmartConstructors (SC) is a SC specialization with:
type r = Op.r
which is parameterized by `Op: Op_S`, where:
module type Op_S = sig
type r
val is_zero: r -> bool
val flatten: r list -> r
val zero: r
end
and provides a default implementation of `make_*` methods. In Rust,
model this as a subtrait of SC with corresponding *default* methods that flatten:
trait FlattenSmartConstructors<State>
: SmartConstructors<State>
+ FlattenOp<S=<Self as SmartConstructors<State>>::R>
Reviewed By: dabek
Differential Revision:
D14736865
fbshipit-source-id:
743d9c616aa088e1c731c98e1cf449d2728fd9b5