mirror of
https://github.com/CatalaLang/catala.git
synced 2024-11-08 07:51:43 +03:00
2823795f9f
As part of making tuples first-class citizens, expliciting the arity upon function application was needed (so that a function of two args can transparently -- in the surface language -- be applied to either two arguments or a pair). It was decided to actually explicit the whole type of arguments because the cost is the same, and this is consistent with lambda definitions. A related change done here is the replacement of the `EOp` node for operators by an "operator application" `EAppOp` node, enforcing a pervasive invariant that operators are always directly applied. This makes matches terser, and highlights the fact that the treatment of operator application is almost always different from function application in practice.
27 lines
981 B
OCaml
27 lines
981 B
OCaml
(* This file is part of the Catala compiler, a specification language for tax
|
|
and social benefits computation rules. Copyright (C) 2020 Inria, contributor:
|
|
Denis Merigoux <denis.merigoux@inria.fr>
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
|
use this file except in compliance with the License. You may obtain a copy of
|
|
the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
License for the specific language governing permissions and limitations under
|
|
the License. *)
|
|
|
|
open Shared_ast
|
|
|
|
(** Abstract syntax tree for the lambda calculus *)
|
|
|
|
(** {1 Abstract syntax tree} *)
|
|
|
|
type 'm naked_expr = (lcalc, 'm) naked_gexpr
|
|
and 'm expr = (lcalc, 'm) gexpr
|
|
|
|
type 'm program = 'm expr Shared_ast.program
|