pub fn sep_nonrec_rec_cnstr_args(
        &self, 
        ind_t : ExprPtr<'l>,
        ind_c : ExprPtr<'l>,
        cnstr_type_cursor : ExprPtr<'l>,
        rem_params : ExprsPtr<'l>,
        live : &mut Live<'l, 'e>
    ) -> (ExprPtr<'l>, ExprsPtr<'l>, ExprsPtr<'l>) {
        match (cnstr_type_cursor.read(live), rem_params.read(live)) {
            (Pi { body, .. }, Cons(hd, tl)) => {
                let body = body.inst1(hd, live);
                let (inner, all_args, rec_args) = self.sep_nonrec_rec_cnstr_args(
                    ind_t, 
                    ind_c, 
                    body, 
                    tl, 
                    live
                );
                (inner, all_args, rec_args)
            },
            (Pi { b_name, b_type, b_style, body, .. }, Nil) => {
                let local = <ExprPtr>::new_local(b_name, b_type, b_style, live);
                let body = body.inst1(local, live);

                let (stripped, all_args, rec_args) = self.sep_nonrec_rec_cnstr_args(
                    ind_t, 
                    ind_c, 
                    body, 
                    rem_params, 
                    live
                );

                let all_args = Cons(local, all_args).alloc(live);
                let rec_args = if self.is_rec_argument(ind_t, ind_c, b_type, live) {
                    Cons(local, rec_args).alloc(live)
                } else {
                    rec_args
                };

                (stripped, all_args, rec_args)
            },
            _ => (cnstr_type_cursor, Nil::<Expr>.alloc(live), Nil::<Expr>.alloc(live))
        }
    }
// The main thing this does is make two lists, the one on the left is all of the 
// constructor's arguments, and the one on the right is only the constructors arguments
// that are recursive.
The main thing this does is make two lists, the one on the left is all of the
constructor's arguments, and the one on the right is only the constructors arguments
that are recursive.
The main thing this does is make two lists the one on the left is all of the constructor ' s arguments and the one on the right is only the constructors arguments that are recursive .
pub fn sep_nonrec_rec_cnstr_args(
        &self, 
        ind_t : ExprPtr<'l>,
        ind_c : ExprPtr<'l>,
        cnstr_type_cursor : ExprPtr<'l>,
        rem_params : ExprsPtr<'l>,
        live : &mut Live<'l, 'e>
    ) -> (ExprPtr<'l>, ExprsPtr<'l>, ExprsPtr<'l>) {
        match (cnstr_type_cursor.read(live), rem_params.read(live)) {
            (Pi { body, .. }, Cons(hd, tl)) => {
                let body = body.inst1(hd, live);
                let (inner, all_args, rec_args) = self.sep_nonrec_rec_cnstr_args(
                    ind_t, 
                    ind_c, 
                    body, 
                    tl, 
                    live
                );
                (inner, all_args, rec_args)
            },
            (Pi { b_name, b_type, b_style, body, .. }, Nil) => {
                let local = <ExprPtr>::new_local(b_name, b_type, b_style, live);
                let body = body.inst1(local, live);
                let (stripped, all_args, rec_args) = self.sep_nonrec_rec_cnstr_args(
                    ind_t, 
                    ind_c, 
                    body, 
                    rem_params, 
                    live
                );
                let all_args = Cons(local, all_args).alloc(live);
                let rec_args = if self.is_rec_argument(ind_t, ind_c, b_type, live) {
                    Cons(local, rec_args).alloc(live)
                } else {
                    rec_args
                };
                (stripped, all_args, rec_args)
            },
            _ => (cnstr_type_cursor, Nil::<Expr>.alloc(live), Nil::<Expr>.alloc(live))
        }
    }
pub fn sep_nonrec_rec_cnstr_args ( & self , ind_t : ExprPtr < ' l > , ind_c : ExprPtr < ' l > , cnstr_type_cursor : ExprPtr < ' l > , rem_params : ExprsPtr < ' l > , live : & mut Live < ' l , ' e > ) -> ( ExprPtr < ' l > , ExprsPtr < ' l > , ExprsPtr < ' l > ) { match ( cnstr_type_cursor . read ( live ) , rem_params . read ( live ) ) { ( Pi { body , .. } , Cons ( hd , tl ) ) => { let body = body . inst1 ( hd , live ) ; let ( inner , all_args , rec_args ) = self . sep_nonrec_rec_cnstr_args ( ind_t , ind_c , body , tl , live ) ; ( inner , all_args , rec_args ) } , ( Pi { b_name , b_type , b_style , body , .. } , Nil ) => { let local = < ExprPtr > :: new_local ( b_name , b_type , b_style , live ) ; let body = body . inst1 ( local , live ) ; let ( stripped , all_args , rec_args ) = self . sep_nonrec_rec_cnstr_args ( ind_t , ind_c , body , rem_params , live ) ; let all_args = Cons ( local , all_args ) . alloc ( live ) ; let rec_args = if self . is_rec_argument ( ind_t , ind_c , b_type , live ) { Cons ( local , rec_args ) . alloc ( live ) } else { rec_args } ; ( stripped , all_args , rec_args ) } , _ => ( cnstr_type_cursor , Nil :: < Expr > . alloc ( live ) , Nil :: < Expr > . alloc ( live ) ) } }
The main thing this does is make two lists, the one on the left is all of the
constructor's arguments, and the one on the right is only the constructors arguments
that are recursive.
The main thing this does is make two lists the one on the left is all of the constructor ' s arguments and the one on the right is only the constructors arguments that are recursive .
&self
ind_t
ExprPtr<'l>
ind_c
ExprPtr<'l>
cnstr_type_cursor
ExprPtr<'l>
rem_params
ExprsPtr<'l>
live
&mut Live<'l, 'e>
&self
ind_t
ExprPtr<'l>
ind_c
ExprPtr<'l>
cnstr_type_cursor
ExprPtr<'l>
rem_params
ExprsPtr<'l>
live
&mut Live<'l, 'e>