janestreet / base

Standard library for OCaml
MIT License
860 stars 125 forks source link

improves error messages for arrays of unequal length #91

Closed ytrellu closed 4 years ago

ytrellu commented 4 years ago

closes #90

ytrellu commented 4 years ago

I also considered the following:

Defining check_eq2_for_exn ~f name t1 t2 such that check_length2_exn = check_eq2_for_exn ~f:length to have less duplication between the Array and List module. However this would have modified the module signature of either Array0 or List, which is a bigger change.

Running tests against array.ml and the modifs; but I could not get them to work :/. I did find the readthedocs for dune, and the ppx_inline_test package advertised on the contribute page, but it did not help me here unfortunately.

bcc32 commented 4 years ago

Thanks for the contribution! I've imported the patch into our internal repo for review.

ytrellu commented 4 years ago

Thanks! I noticed a small error in the commit, now amended.