Reorganized public libraries

This commit is contained in:
Denis Merigoux 2021-04-22 11:57:50 +02:00
parent 2cad9823f7
commit 7446b1fe57
No known key found for this signature in database
GPG Key ID: EE99DCFA365C3EE3
22 changed files with 2085 additions and 1956 deletions

View File

@ -1,17 +1,19 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
version: "0.3.0"
synopsis: "Literate programming language for tax code specification"
version: "0.4.0"
synopsis:
"Compiler and library for the literate programming language for tax code specification"
description: """
Catala is a domain-specific language for deriving faithful-by-construction
algorithms from legislative texts. See https://catala-lang.org for more information
"""
maintainer: ["contact@catala-lang.org"]
authors: ["Denis Merigoux"]
authors: ["Denis Merigoux, Nicolas Chataing"]
license: "Apache-2.0"
homepage: "https://github.com/CatalaLang/catala"
bug-reports: "https://github.com/CatalaLang/catala/issues"
depends: [
"dune" {>= "2.8"}
"ocaml" {>= "4.08.0"}
"ANSITerminal" {>= "0.8.2"}
"sedlex" {>= "2.1"}
@ -23,16 +25,16 @@ depends: [
"re" {>= "1.9.0"}
"zarith" {= "1.11"}
"zarith_stubs_js" {= "v0.14.0"}
"dune" {>= "2.2"}
"ocamlgraph" {>= "1.8.8"}
"calendar" {>= "2.04"}
"visitors" {>= "20200210"}
"benchmark" {>= "1.6"}
"js_of_ocaml-ppx" {>= "3.8.0"}
"camomile" {>= "1.0.2"}
"odoc" {with-doc}
]
build: [
["dune" "subst"] {pinned}
["dune" "subst"] {dev}
[
"dune"
"build"

View File

@ -1,45 +1,78 @@
(lang dune 2.2)
(lang dune 2.8)
(name catala)
(version 0.3.0)
(version 0.4.0)
(generate_opam_files true)
(formatting)
(source (uri git+https://github.com/CatalaLang/catala.git))
(homepage https://github.com/CatalaLang/catala)
(bug_reports https://github.com/CatalaLang/catala/issues)
(authors "Denis Merigoux")
(maintainers "contact@catala-lang.org")
(license Apache-2.0)
(source
(uri git+https://github.com/CatalaLang/catala.git))
(homepage https://github.com/CatalaLang/catala)
(bug_reports https://github.com/CatalaLang/catala/issues)
(authors "Denis Merigoux, Nicolas Chataing")
(maintainers "contact@catala-lang.org")
(license Apache-2.0)
(package
(name catala)
(synopsis "Literate programming language for tax code specification")
(description "\| Catala is a domain-specific language for deriving faithful-by-construction
"\| algorithms from legislative texts. See https://catala-lang.org for more information
)
(synopsis
"Compiler and library for the literate programming language for tax code specification")
(description
"Catala is a domain-specific language for deriving faithful-by-construction\nalgorithms from legislative texts. See https://catala-lang.org for more information\n")
(depends
(ocaml (>= 4.08.0))
(ANSITerminal (>= 0.8.2))
(sedlex (>= 2.1))
(menhir (>= 20200211))
(menhirLib (>= 20200211))
(unionFind (>= 20200320))
(bindlib (>= 5.0.1))
(cmdliner (>= 1.0.4))
(re (>= 1.9.0))
(zarith (= 1.11))
(zarith_stubs_js (= v0.14.0))
(dune (>= 2.2))
(ocamlgraph (>= 1.8.8))
(calendar (>= 2.04))
(visitors (>= 20200210))
(benchmark (>= 1.6))
(js_of_ocaml-ppx (>= 3.8.0))
(camomile (>= 1.0.2))
)
)
(ocaml
(>= 4.08.0))
(ANSITerminal
(>= 0.8.2))
(sedlex
(>= 2.1))
(menhir
(>= 20200211))
(menhirLib
(>= 20200211))
(unionFind
(>= 20200320))
(bindlib
(>= 5.0.1))
(cmdliner
(>= 1.0.4))
(re
(>= 1.9.0))
(zarith
(= 1.11))
(zarith_stubs_js
(= v0.14.0))
(ocamlgraph
(>= 1.8.8))
(calendar
(>= 2.04))
(visitors
(>= 20200210))
(benchmark
(>= 1.6))
(js_of_ocaml-ppx
(>= 3.8.0))
(camomile
(>= 1.0.2))))
(package
(name french_law)
(synopsis
"A collection of algorithms and computations defined by French law")
(description
"This library contains the implementations of algorithmic portions of French law. The library source code was generated from Catala annotations of the relevant portions of the French law, see https://catala-lang.org")
(depends
(ocaml
(>= 4.08.0))
(catala
(>= 0.4.0))))
(using menhir 2.1)
(allow_approximate_merlin)

32
french_law.opam Normal file
View File

@ -0,0 +1,32 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
version: "0.4.0"
synopsis: "A collection of algorithms and computations defined by French law"
description:
"This library contains the implementations of algorithmic portions of French law. The library source code was generated from Catala annotations of the relevant portions of the French law, see https://catala-lang.org"
maintainer: ["contact@catala-lang.org"]
authors: ["Denis Merigoux, Nicolas Chataing"]
license: "Apache-2.0"
homepage: "https://github.com/CatalaLang/catala"
bug-reports: "https://github.com/CatalaLang/catala/issues"
depends: [
"dune" {>= "2.8"}
"ocaml" {>= "4.08.0"}
"catala" {>= "0.4.0"}
"odoc" {with-doc}
]
build: [
["dune" "subst"] {dev}
[
"dune"
"build"
"-p"
name
"-j"
jobs
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
]
dev-repo: "git+https://github.com/CatalaLang/catala.git"

File diff suppressed because one or more lines are too long

View File

@ -12,4 +12,4 @@
or implied. See the License for the specific language governing permissions and limitations under
the License. *)
let _ = Catala.Driver.main ()
let _ = Catala_lib.Driver.main ()

View File

@ -12,7 +12,7 @@
or implied. See the License for the specific language governing permissions and limitations under
the License. *)
module Driver = Catala.Driver
module Driver = Driver
module Utils = Utils
module Literate = Literate
module Surface = Surface

View File

@ -1,4 +1,4 @@
open Catala.Driver
open Catala_lib.Driver
open Js_of_ocaml
let _ =

View File

@ -1,9 +1,10 @@
(library
(name dcalc)
(public_name catala.dcalc)
(libraries bindlib unionFind utils re camomile catala.runtime)
(libraries bindlib unionFind utils re camomile runtime)
(package catala)
(preprocess
(pps visitors.ppx)))
(documentation
(package catala))
(package catala)
(mld_files dcalc))

View File

@ -1,6 +1,6 @@
(library
(name desugared)
(public_name catala.desugared)
(package catala)
(libraries utils dcalc scopelang ocamlgraph))
(documentation

View File

@ -16,7 +16,8 @@ module Cli = Utils.Cli
module Errors = Utils.Errors
module Pos = Utils.Pos
(** Entry function for the executable. Returns a negative number in case of error. *)
(** Entry function for the executable. Returns a negative number in case of error. Usage:
[driver source_file debug dcalc unstyled wrap_weaved_output backend language max_prec_digits trace optimize scope_to_execute output_file]*)
let driver (source_file : Pos.input_file) (debug : bool) (dcalc : bool) (unstyled : bool)
(wrap_weaved_output : bool) (backend : string) (language : string option)
(max_prec_digits : int option) (trace : bool) (optimize : bool) (ex_scope : string option)

View File

@ -1,18 +1,18 @@
(library
(public_name catala)
(libraries catala.utils catala.surface catala.desugared catala.literate
catala.dcalc catala.lcalc catala.runtime)
(name driver)
(package catala)
(libraries utils surface desugared literate dcalc lcalc runtime)
(modules driver))
(library
(name catala_lib)
(public_name catala.catalaLib)
(libraries catala)
(public_name catala.catala_lib)
(libraries driver)
(modules catala_lib))
(library
(name runtime)
(public_name catala.runtime)
(package catala)
(libraries calendar zarith zarith_stubs_js)
(modules runtime))
@ -24,7 +24,7 @@
(modules catala_web)
(preprocess
(pps js_of_ocaml-ppx))
(libraries catala js_of_ocaml))
(libraries catala_lib js_of_ocaml))
(executable
(name catala)
@ -32,7 +32,8 @@
(package catala)
(modules catala)
(public_name catala)
(libraries catala))
(libraries catala_lib))
(documentation
(package catala))
(package catala)
(mld_files index))

View File

@ -79,11 +79,11 @@ More documentation can be found on each intermediate representations here.
The main compilation chain is defined in:
{!modules: Catala.Driver}
{!modules: Driver}
Last, two more modules contain additional features for the compiler:
{ul
{li {{: literate.html} Literate programming}}
{li {{: utils.html} Compiler utilities}}
}
}

View File

@ -1,7 +1,8 @@
(library
(name lcalc)
(public_name catala.lcalc)
(package catala)
(libraries bindlib dcalc scopelang runtime))
(documentation
(package catala))
(package catala)
(mld_files lcalc))

View File

@ -455,7 +455,7 @@ let format_program (fmt : Format.formatter) (p : Ast.program)
@\n\
open Runtime@\n\
@\n\
[@@@@@@ocaml.warning \"-26-27\"]@\n\
[@@@@@@ocaml.warning \"-26-27-32\"]@\n\
@\n\
%a@\n\
@\n\

View File

@ -1,6 +1,6 @@
(library
(name literate)
(public_name catala.literate)
(package catala)
(libraries re utils surface))
(documentation

View File

@ -1,6 +1,6 @@
(library
(name scopelang)
(public_name catala.scopelang)
(package catala)
(libraries utils dcalc ocamlgraph))
(documentation

View File

@ -1,8 +1,16 @@
(library
(name surface)
(libraries utils menhirLib sedlex re desugared scopelang zarith
zarith_stubs_js calendar)
(public_name catala.surface)
(libraries
utils
menhirLib
sedlex
re
desugared
scopelang
zarith
zarith_stubs_js
calendar)
(package catala)
(preprocess
(pps sedlex.ppx visitors.ppx)))

View File

@ -104,7 +104,7 @@ let catala_t f =
const f $ file $ debug $ debug_dcalc $ unstyled $ wrap_weaved_output $ backend $ language
$ max_prec_digits_opt $ trace_opt $ optimize $ ex_scope $ output)
let version = "0.2.0"
let version = "0.4.0"
let info =
let doc =

View File

@ -1,6 +1,6 @@
(library
(name utils)
(public_name catala.utils)
(package catala)
(libraries cmdliner ANSITerminal re))
(documentation

View File

@ -2,7 +2,7 @@
(name bench)
(modes native)
(modules bench)
(libraries catala french_law benchmark))
(libraries catala_lib french_law benchmark))
(executable
(name api_web)
@ -10,11 +10,12 @@
(modules api_web)
(preprocess
(pps js_of_ocaml-ppx))
(libraries catala law_source js_of_ocaml))
(libraries catala_lib law_source js_of_ocaml))
(library
(name french_law)
(name api)
(public_name french_law)
(synopsis
"A collection of functions for computing French taxes and benefits derived from Catala programs")
(libraries catala law_source)
"A collection of functions for computing French taxes and benefits derived from Catala programs")
(libraries catala_lib law_source)
(modules api))

View File

@ -2,7 +2,7 @@
open Runtime
[@@@ocaml.warning "-26-27"]
[@@@ocaml.warning "-26-27-32"]
type prise_en_charge =
| GardeAlterneePartageAllocations of unit
@ -2648,7 +2648,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i
then
if
array_length enfants_a_charge_droit_ouvert_prestation_familiale_
>=! integer_of_string "3"
>! integer_of_string "2"
then
prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.1025"
*$ decimal_of_integer
@ -2679,7 +2679,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i
then
if
array_length enfants_a_charge_droit_ouvert_prestation_familiale_
>=! integer_of_string "3"
>! integer_of_string "2"
then
prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.205"
*$ decimal_of_integer
@ -2763,7 +2763,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i
then
if
array_length enfants_a_charge_droit_ouvert_prestation_familiale_
>=! integer_of_string "2"
>! integer_of_string "1"
then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.08"
else money_of_cents_string "0"
else raise EmptyError);
@ -2790,7 +2790,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i
then
if
array_length enfants_a_charge_droit_ouvert_prestation_familiale_
>=! integer_of_string "2"
>! integer_of_string "1"
then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.16"
else money_of_cents_string "0"
else raise EmptyError);

View File

@ -1,4 +1,4 @@
(library
(name law_source)
(public_name catala.law_source)
(public_name french_law.law_source)
(libraries runtime))