a415355a39
The phantom polymorphic variant qualifying AST nodes is reversed: - previously, we were explicitely restricting each AST node to the passes where it belonged using a closed type (e.g. `[< dcalc | lcalc]`) - now, each node instead declares the "feature" it provides using an open type (e.g. `[> 'Exceptions ]`) - then the AST for a specific pass limits the features it allows with a closed type The result is that you can mix and match all features if you wish, even if the result is not a valid AST for any given pass. More interestingly, it's now easier to write a function that works on different ASTs at once (it's the inferred default if you don't write a type restriction). The opportunity was also taken to simplify the encoding of the operators, which don't need a second type parameter anymore. |
||
---|---|---|
.. | ||
catala_legifrance | ||
js | ||
ocaml | ||
python | ||
README.md |
French Law Libraries
This folder presents a working example of how Catala could be distributed and deployed inside existing applications. Each sub-folder is specialized for a particular programming language, and features a ready-to-use library of all the French public algorithms coded up using Catala so far.
General principles
Let us say you want to deploy a Catala program inside an application written
in programming language X. The Catala compiler will translate the source
Catala program into X, yielding a new .x
source code file. This .x
file
will export functions corresponding to the scopes of the original Catala
program. You can then reuse those exported functions in your application written
in X.
OCaml
To see how to deploy Catala programs as an OCaml library, see the dedicated readme.
JS
To see how to deploy Catala programs as a JS library, see the dedicated readme.
Python
To see how to deploy Catala programs as a Python library, see the dedicated readme.