fn extract(expr: &'a Expr) -> Option<UnrollPattern<'_>> {
        if let Res { ref builder } = expr.kind {
            if let Some(loopsize) = builder.loopsize() {
                if loopsize <= UNROLL_LIMIT {
                    if let For {
                        ref iters,
                        ref builder,
                        ref func,
                    } = builder.kind
                    {
                        if let Builder(ref bk, _) = builder.ty {
                            if let Lambda {
                                ref params,
                                ref body,
                            } = func.kind
                            {
                                if let Merge {
                                    builder: ref builder2,
                                    ref value,
                                } = body.kind
                                {
                                    match builder2.kind {
                                        Ident(ref name) if *name == params[0].name => {
                                            return Some(UnrollPattern {
                                                loop_size: loopsize,
                                                iters,
                                                builder_kind: bk,
                                                merge_params: params,
                                                merge_value: value,
                                            });
                                        }
                                        _ => {
                                            return None;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        None
    }
Extracts a `UnrollPattern` from the expression, or returns `None`.
weld/src/optimizer/transforms/unroller.rs