package catala

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Classification of operators on how they should be typed

type monomorphic =
  1. | Monomorphic
    (*

    Operands and return types of the operator are fixed

    *)
type polymorphic =
  1. | Polymorphic
    (*

    The operator is truly polymorphic: it's the same runtime function that may work on multiple types. We require that resolving the argument types from right to left trivially resolves all type variables declared in the operator type.

    *)
type overloaded =
  1. | Overloaded
    (*

    The operator is ambiguous and requires the types of its arguments to be known before it can be typed, using a pre-defined table

    *)
type resolved =
  1. | Resolved
    (*

    Explicit monomorphic versions of the overloaded operators

    *)
type (_, _) kind =
  1. | Monomorphic : ('a Shared_ast__.Definitions.any, monomorphic) kind
  2. | Polymorphic : ('a Shared_ast__.Definitions.any, polymorphic) kind
  3. | Overloaded : ([< Shared_ast__.Definitions.desugared ], overloaded) kind
  4. | Resolved : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) kind

Classification of operators. This could be inlined in the definition of t but is more concise this way

type (_, _) t =
  1. | Not : ('a Shared_ast__.Definitions.any, monomorphic) t
  2. | GetDay : ('a Shared_ast__.Definitions.any, monomorphic) t
  3. | GetMonth : ('a Shared_ast__.Definitions.any, monomorphic) t
  4. | GetYear : ('a Shared_ast__.Definitions.any, monomorphic) t
  5. | FirstDayOfMonth : ('a Shared_ast__.Definitions.any, monomorphic) t
  6. | LastDayOfMonth : ('a Shared_ast__.Definitions.any, monomorphic) t
  7. | Length : ('a Shared_ast__.Definitions.any, polymorphic) t
  8. | Minus : ([ `Desugared ], overloaded) t
  9. | Minus_int : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  10. | Minus_rat : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  11. | Minus_mon : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  12. | Minus_dur : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  13. | ToRat : ([ `Desugared ], overloaded) t
  14. | ToRat_int : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  15. | ToRat_mon : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  16. | ToMoney : ([ `Desugared ], overloaded) t
  17. | ToMoney_rat : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  18. | Round : ([ `Desugared ], overloaded) t
  19. | Round_rat : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  20. | Round_mon : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  21. | And : ('a Shared_ast__.Definitions.any, monomorphic) t
  22. | Or : ('a Shared_ast__.Definitions.any, monomorphic) t
  23. | Xor : ('a Shared_ast__.Definitions.any, monomorphic) t
  24. | Eq : ('a Shared_ast__.Definitions.any, polymorphic) t
  25. | Map : ('a Shared_ast__.Definitions.any, polymorphic) t
  26. | Concat : ('a Shared_ast__.Definitions.any, polymorphic) t
  27. | Filter : ('a Shared_ast__.Definitions.any, polymorphic) t
  28. | Reduce : ('a Shared_ast__.Definitions.any, polymorphic) t
  29. | Add : ([ `Desugared ], overloaded) t
  30. | Add_int_int : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  31. | Add_rat_rat : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  32. | Add_mon_mon : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  33. | Add_dat_dur : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  34. | Add_dur_dur : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  35. | Sub : ([ `Desugared ], overloaded) t
  36. | Sub_int_int : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  37. | Sub_rat_rat : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  38. | Sub_mon_mon : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  39. | Sub_dat_dat : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  40. | Sub_dat_dur : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  41. | Sub_dur_dur : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  42. | Mult : ([ `Desugared ], overloaded) t
  43. | Mult_int_int : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  44. | Mult_rat_rat : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  45. | Mult_mon_rat : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  46. | Mult_dur_int : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  47. | Div : ([ `Desugared ], overloaded) t
  48. | Div_int_int : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  49. | Div_rat_rat : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  50. | Div_mon_rat : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  51. | Div_mon_mon : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  52. | Div_dur_dur : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  53. | Lt : ([ `Desugared ], overloaded) t
  54. | Lt_int_int : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  55. | Lt_rat_rat : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  56. | Lt_mon_mon : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  57. | Lt_dat_dat : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  58. | Lt_dur_dur : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  59. | Lte : ([ `Desugared ], overloaded) t
  60. | Lte_int_int : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  61. | Lte_rat_rat : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  62. | Lte_mon_mon : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  63. | Lte_dat_dat : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  64. | Lte_dur_dur : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  65. | Gt : ([ `Desugared ], overloaded) t
  66. | Gt_int_int : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  67. | Gt_rat_rat : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  68. | Gt_mon_mon : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  69. | Gt_dat_dat : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  70. | Gt_dur_dur : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  71. | Gte : ([ `Desugared ], overloaded) t
  72. | Gte_int_int : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  73. | Gte_rat_rat : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  74. | Gte_mon_mon : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  75. | Gte_dat_dat : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  76. | Gte_dur_dur : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  77. | Eq_int_int : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  78. | Eq_rat_rat : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  79. | Eq_mon_mon : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  80. | Eq_dur_dur : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  81. | Eq_dat_dat : ([< Shared_ast__.Definitions.scopelang | Shared_ast__.Definitions.dcalc | Shared_ast__.Definitions.lcalc ], resolved) t
  82. | Fold : ('a Shared_ast__.Definitions.any, polymorphic) t
OCaml

Innovation. Community. Security.