refactor(melange): move stanza definition#6775
Conversation
It should exist in [Melange_stanzas] Signed-off-by: Rudi Grinberg <me@rgrinberg.com> ps-id: bee92f9b-6ded-4f47-b13a-25052ac6ff48
jchavarri
left a comment
There was a problem hiding this comment.
I am not sure I understand the benefits of this new approach. Also, Dune_project.Melange_syntax can prob be removed.
But otherwise looks good.
| @@ -345,12 +345,6 @@ end | |||
|
|
|||
| module Melange_syntax = struct | |||
| let name = "melange" | |||
There was a problem hiding this comment.
Does it make sense to leave just name here? The only consumer is Melange_stanzas.syntax, so maybe it could be moved to that module. Or even inlined in syntax definition.
There was a problem hiding this comment.
I wish I could remove it but it has to stay because it's used to define the dialect for rescript.
| | Cram of Cram_stanza.t | ||
| | Generate_sites_module of Generate_sites_module.t | ||
| | Plugin of Plugin.t | ||
| | Melange_emit of Melange_stanzas.Emit.t |
There was a problem hiding this comment.
Wasn't this approach more exhaustive from a type checking perspective? What are the advantages of the new approach?
There was a problem hiding this comment.
Wasn't this approach more exhaustive from a type checking perspective
I think it's equivalent. There's no exhaustiveness checking on open types no matter how you define their constructors.
What are the advantages of the new approach?
That we isolate the melange rules from the rest as much as possible. This should make it easy for us to change things without impacting the rest of the code base.
* main: (148 commits) refactor(rpc): remove mutable callback (ocaml#6786) refactor(stdune): make [Id.t] immediate (ocaml#6795) refactor(melange): share mode handling (ocaml#6799) refactor(scheduler): remove duplicate types (ocaml#6785) refactor: move cram stanza definition (ocaml#6800) fix: correctly validate argument to top-module (ocaml#6796) refactor: move generate_sites_module to own module (ocaml#6798) fix(melange): check rules (ocaml#6789) refactor(rpc): make [Call.to_dyn] public (ocaml#6797) refactor(rpc): invalid session errors (ocaml#6787) refactor(melange): remove js globs (ocaml#6782) doc: fix version indication for "dune ocaml top-module" (ocaml#6792) refactor: print shutdown exception (ocaml#6784) refactor(rpc): add [Call.to_dyn] (ocaml#6790) fix: do not impose no_sandboxing on ocamldep (ocaml#6749) refactor(melange): move stanza definition (ocaml#6775) fix: handle missing CLICOLOR_FORCE correctly (ocaml#6781) Revert --display tui (ocaml#6780) fix: render pending messages refactor(coq): inline coqc_rule ...
It should exist in [Melange_stanzas]
Signed-off-by: Rudi Grinberg me@rgrinberg.com
ps-id: bee92f9b-6ded-4f47-b13a-25052ac6ff48