expln / metamath-lamp

Metamath-lamp (Lite Assistant for Metamath Proofs) is a GUI-based proof assistant for creating formal mathematical proofs in Metamath that does not require installation (just run it directly using your web browser).
https://expln.github.io/lamp/latest/index.html
MIT License
12 stars 5 forks source link

Question on suppressed warning 23 #142

Closed billh0420 closed 1 year ago

billh0420 commented 1 year ago

The warning 23 is being suppressed. Warning 23 is: Useless record "with" clause.

I am looking into not suppressing the warning 23 and fixing the code so that the warning doesn't occur.

Are you interested in me pursuing this and submitting such changes?

The following are the three cases that arise.

A) file MM_cmp_root_stmts.res (This seems straightforward)

 type state = {
     flags: array<bool>,
 }

Change from:

 let updateFlags = (st:state, update:array<bool>=>array<bool>):state => { ...st, flags: update(st.flags)}

to:

 let updateFlags = (st:state, update:array<bool>=>array<bool>):state => { flags: update(st.flags)}

B) file MM_cmp_multiline_text.res

 type state = {
     newText: string,
 }

Change from:

 let setNewText = (st,text):state => {
     {
         ...st,
         newText:text
     }
 }

to:

 let setNewText = (_, text):state => {
     {
         newText:text
     }
 }

C) file MM_cmp_pe_stmt.res

Change from:

     let actUpdateStmt = (newCont:stmtCont):unit => {
         setState(st => {...st, cont:newCont})
     }

to:

     let actUpdateStmt = (newCont:stmtCont):unit => {
         setState(_ => {cont:newCont})
     }
expln commented 1 year ago

Yes, you may do this change. I intentionally left ...st in those places to make adding new attributes easier, but looks like new attributes will not be added (or this will happen not very soon).