tries to make more meaningful names for the general types#882
tries to make more meaningful names for the general types#882SteveBronder wants to merge 2 commits intostan-dev:masterfrom
Conversation
|
Oof the vs code thing, lemme look at it. It seems like sometimes it would work for me. Maybe something goofy is going on. Agree with the rest tho'! |
|
So I'm pretty sure it's that we are on an old version of ocaml so there's not much we can do about it. The newer extensions might fix this, but those require the lsp server which requires dune 2.5 which requires ocaml > 4.07 :-( I tried getting a branch up and running that used ocaml 4.11.1 (which rok said is the latest we can use because of windows things) but I'm getting too many goofs and I'm not sure how to resolve them |
|
Ugh so yeah it has to do with the ocaml compiler version, lsp-server, and the vscode ocaml extension. I hacked at #885 to get it to work for 4.12.0 (which we can't use yet because the windows cross compiler only supports 4.11.1). I still can't get the nice names to show up for |
|
@SteveBronder do you want to take another crack at this sometime? |

Summary
When I'm working over the ocaml it's pretty often I'll run into some type like
('a, 'b) Stmt.Fixed...and I always found it kind of harder to parse out what 'a or 'b is. This PR tries to give "nicer" names for those general types.I get that yes
'ais just a general type, but in the types they are used, for example inStmt.Fixed.Patternthe general types ('a ,'b)on the patterntis not going to be like a string, websocket, or a random number generator. The general type there is going to be some type that is derived or has inside of it expressions. So why don't we just use a nicer name likeWhat I'd like is for the names of the types to be the least upper bound of the types that we expect to go into the type. Here I just looked around and sorted out that the
'ais going to be a thing that holds an expression, where'bis generally a thing that holds a list of statements. imo I think this is a lot easier to read when I'm looking at types elsewhere in the program.Though I think there is some places I have bad names rn. Like in
expr_withidt'fun_kindis the right name for the least upper bound of types that can go in there since anuntyped_expressionis anexpr_withthat takes in aunit.Maybe just
'anyis more appropriate when the type can be a unit?Expressive names that are wrong are certainly worse than meaningless names, but I think if someone can look over the names I have here and help me sort out the weird ones then this should be a bit nicer to work over
Release notes
Cleanup names of generic types inside of type declarations
Copyright and Licensing
By submitting this pull request, the copyright holder is agreeing to
license the submitted work under the BSD 3-clause license (https://opensource.org/licenses/BSD-3-Clause)