catala/compiler
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
..
catala_utils Specialise the Map.Not_found exception raised by Map.find 2023-08-31 17:55:36 +02:00
dcalc Specialise the Map.Not_found exception raised by Map.find 2023-08-31 17:55:36 +02:00
desugared Specialise the Map.Not_found exception raised by Map.find 2023-08-31 17:55:36 +02:00
lcalc Implement module lookups for scopes, structs, and enums 2023-08-31 17:54:39 +02:00
literate Formatting 2023-06-15 10:51:31 +02:00
plugins Specialise the Map.Not_found exception raised by Map.find 2023-08-31 17:55:36 +02:00
scalc Specialise the Map.Not_found exception raised by Map.find 2023-08-31 17:55:36 +02:00
scopelang Specialise the Map.Not_found exception raised by Map.find 2023-08-31 17:55:36 +02:00
shared_ast Specialise the Map.Not_found exception raised by Map.find 2023-08-31 17:55:36 +02:00
surface Implement module lookups for scopes, structs, and enums 2023-08-31 17:54:39 +02:00
verification Implement module lookups for scopes, structs, and enums 2023-08-31 17:54:39 +02:00
catala_web_interpreter.ml Refacter the main Driver module 2023-07-03 16:42:54 +02:00
catala.ml reformat (sync with master) 2022-03-09 10:43:17 +01:00
driver.ml Implement module lookups for scopes, structs, and enums 2023-08-31 17:54:39 +02:00
driver.mli Implement module lookups for scopes, structs, and enums 2023-08-31 17:54:39 +02:00
dune Add an explain plugin 2023-07-11 17:33:56 +02:00
index.mld More doc 2023-06-18 16:08:16 +02:00
plugin.ml Silence warning on duplicate plugin load 2023-07-11 18:57:05 +02:00
plugin.mli Refacter the main Driver module 2023-07-03 16:42:54 +02:00
tests.ml Fusion of all optimizations done correctly 2023-04-21 12:32:09 +02:00