Haskell-Things / HSlice

HSlice - A Haskell based slicer for 3D printing.
https://implicitcad.org/
GNU Affero General Public License v3.0
76 stars 5 forks source link

stan warning removals. #38

Closed julialongtin closed 3 years ago

fisx commented 3 years ago

I hope my comments are useful, but I think it's safe to ignore them all. Can we add stan to the ci now? :-)

julialongtin commented 3 years ago

we still have 300+ stan warnings. it'll be weeks for me to chase these all out. :)

julialongtin commented 3 years ago

also, this is my weekend. i have time to respond, am not nearly as on fire as during the week. :)

julialongtin commented 3 years ago

nope, it doesn't like that.

┃~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ┃
 ┃  ✦ ID:            OBS-STAN-0213-RzskQu-148:77
 ┃  ✦ Severity:      Warning
 ┃  ✦ Inspection ID: STAN-0213
 ┃  ✦ Name:          Anti-pattern: Pattern matching on '_'
 ┃  ✦ Description:   Pattern matching on '_' for sum types can create maintainability issues
 ┃  ✦ Category:      #AntiPattern
 ┃  ✦ File:          ./Graphics/Slicer/Math/Skeleton/Motorcycles.hs
 ┃
 ┃   147 ┃
 ┃   148 ┃                                                                             [(_,_)] -> error "not enough intersections?"
 ┃   149 ┃                                                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 ┃
 ┃  💡 Possible solution:
 ┃      ⍟ Pattern match on each constructor explicitly
 ┃      ⍟ Add meaningful names to holes, e.g. '_anyOtherFailure'
julialongtin commented 3 years ago

merging. you can show me the one example later. :)

fisx commented 3 years ago

┃ ✦ Description: Pattern matching on '_' for sum types can create maintainability issues

hehe, my point exactly! funny that i removed it here, but i checked and thought "it only has this one constructor, so whatever". but stan's right, it's more robust to match against Node _ _ _ _ _ _.

But why did you decide against tidying up the last case?