Is there a way to do a C-style forward declaration in OCaml?
My problem is that I have two variants which mutually refer to each other:
type path_formula =
[ `Next of state_formula
| `Until of (state_formula * state_formula)
| `UntilB of (state_formula * int * state_formula)
]
type state_formula =
[ `True | `False
| `Not of state_formula
| `And of (state_formula * state_formula)
| `Or of (state_formula * state_formula)
| `Imply of (state_formula * state_formula)
| `Label of string
| `Prob` of (boundf * path_formula)
| `Expc` of (boundi * formula)
]
So both type must know the other one.. I searched for it on Google but unfortunately OCaml is not a so wide-use programming language..
Use
type T1 = ...
and T2 = ...
to have recursive types.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With