aboutsummaryrefslogtreecommitdiff
path: root/motus/js/reload.ml
diff options
context:
space:
mode:
Diffstat (limited to 'motus/js/reload.ml')
-rw-r--r--motus/js/reload.ml16
1 files changed, 9 insertions, 7 deletions
diff --git a/motus/js/reload.ml b/motus/js/reload.ml
index 3a461ee..cfdfa2a 100644
--- a/motus/js/reload.ml
+++ b/motus/js/reload.ml
@@ -1,3 +1,5 @@
+(** Reload the list without the current proposition *)
+
open StdLabels
type t = unit
@@ -15,15 +17,15 @@ let process : t -> State.state -> State.state =
|> String.of_seq
in
- let element =
- List.filter
- ~f:(fun w -> not (String.equal w word))
- state.State.analysis.element
+ let new_state =
+ { state with
+ analysis = Motus_lib.Persistence.remove_word state.analysis word
+ }
in
- let analysis = { state.analysis with element } in
- let new_state = { state with analysis } in
(* Get the new proposition if any *)
- let current_prop = Initialize.get_proposition analysis state.rules in
+ let current_prop =
+ Initialize.get_proposition new_state.analysis state.rules
+ in
match current_prop with
| None -> new_state
| Some prop ->