One problem is to model propositional logic (ie. True OR True, True, False AND True, etc.)
I was trying to define a type
type id = T | F;; type op = AND | OR;; type logic = id | id*op*logic;;
to accept stuff like:
Of course, OCaml doesn't like it. Is there a way to make it to accept a type similar to that?
OCaml accepts something like
type id = int;;
type id = Int of int | String of string;;
but it isn't ok with multiple types without the "of typex" part
It's not ok with
type id = int | string;;
type id = int | (int*int);;
type id = int | (int*id);;
That last one would be really nice to have, so is there a way to do it?