catala/compiler/dcalc
Louis Gesbert bcde10242f Specialise the Map.Not_found exception raised by Map.find
... and add a custom printer

Since this is a very common bug, this patch should gain us a lot of time when
debugging uncaught Not_found errors, because the element not found can now be
printed straight away without the need for further debugging.

The small cost is that one should remember to catch the correct specialised
`Foo.Map.Not_found _` exception rather than the standard `Not_found` (which
would type-check but not catch the exception). Using `find_opt` should be
preferred anyway.

Note that the other functions from the module `Map` that raise `Not_found` are
not affected ; these functions are `choose`, `min/max_binding`,
`find_first/last` which either take a predicate or fail on the empty map, so it
wouldn't make sense for them (and we probably don't use them much).
2023-08-31 17:55:36 +02:00
..
ast.ml Improve integration of marks into the main AST 2023-05-17 17:37:00 +02:00
ast.mli Improve integration of marks into the main AST 2023-05-17 17:37:00 +02:00
dcalc.mld Last typo 2023-06-03 15:32:38 +02:00
dune Build: remove unnecessary ppx on dcalc, lcalc 2023-05-17 14:08:32 +02:00
from_scopelang.ml Specialise the Map.Not_found exception raised by Map.find 2023-08-31 17:55:36 +02:00
from_scopelang.mli Uniform naming of conversion modules across compilation passes 2022-11-22 12:08:18 +01:00
invariants.ml Messages renamed to Message (lighter syntax) 2023-06-13 11:50:56 +02:00
invariants.mli Cleanliness and aesthetics 2023-04-18 15:45:30 +02:00