ocaml-doc / doc-ock

(DEPRECATED) Documentation generation for OCaml
ISC License
15 stars 4 forks source link

TypeDecl.t and TypeDecl.Equation.t relation #8

Closed dsheets closed 10 years ago

dsheets commented 10 years ago

Should TypeDecl.t refer to TypeDecl.Equation.t?

I seem to be able to write:

module type N = module type of M with type t = [> `A ] as 'a constraint 'a = [ `A | `B ];;

which, I think, is currently unrepresentable.

lpw25 commented 10 years ago

I seem to be able to write:

module type N = module type of M with type t = [> A ] as 'a constraint 'a = [A | `B ];;

which, I think, is currently unrepresentable.

Yes, I forgot to include constraints in TypeDecl.Equation.t.

Should TypeDecl.t refer to TypeDecl.Equation.t?

I hadn't thought of that. It makes sense and would avoid errors like the one above where they get out of sync. I'll make that change later today (I'll probably also put TypeDecl.kind into its own TypeDecl.Kind module for consistency).

lpw25 commented 10 years ago

I've made the change. It's not a perfect fit because now equations on with constraints can have empty manifests, but I think it is still an improvement overall.