Change set patch to use left fold

This commit is contained in:
John David Pressman 2019-10-12 12:38:05 -07:00
parent c2a3fd473c
commit b304772928

View File

@ -808,9 +808,9 @@ and simpl_single_instruction : Raw.single_instr -> (_ -> expression result) resu
match inj with
| [] -> e_skip ~loc ()
| _ :: _ ->
let assigns = List.fold_right
(fun hd s -> e_constant "SET_ADD" [hd ; s])
inj (e_accessor ~loc (e_variable name) access_path) in
let assigns = List.fold_left
(fun s hd -> e_constant "SET_ADD" [hd ; s])
(e_accessor ~loc (e_variable name) access_path) inj in
e_assign ~loc name access_path assigns in
return_statement @@ expr
)