pdonadeo / ocaml-lens

Private extraction of astrada's lens library
56 stars 9 forks source link

Small issue on subtraction #11

Closed takanuva closed 5 years ago

takanuva commented 5 years ago

The operator -= isn't working properly (should be easy to reproduce). On lens.ml, line 173:

let (-=) l v = _modify ((-) v) l

(This probably affects line 183 as well.)

The value being subtracted (v) is being used on the left position on the subtraction, giving an incorrect result. Could be changed to, e.g., ((+) (-v)) or (fun x -> x - v).

pdonadeo commented 5 years ago

Sorry for the delay, I missed the notification.

I'll fix and release ASAP.

pdonadeo commented 5 years ago

@takanuva 1.2.2 just released and I sent the pull request to the OPAM repository.