-
-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How am I supposed to fix STAN-0103 diagnostic? #550
Comments
As far as I can tell the intention of this diagnostic is to encourage users never to use
(N.B. I'm a maintainer of the Kowainik ecosystem in the sense that I volunteer to keep it building as newer GHCs are released. I didn't author any of the ecosystem and I don't have much spare bandwidth to make any changes beyond keeping it building. I'm not sure if I have moral authority to change the defaults of |
IMO the entire STAN-010X range, prohibiting It's probably fine for applications to use foo :: FilePath -> IO ()
foo fn = if length fn > 255 then do_this else do_that I cannot reasonably change the type of The thing is that HLS 2.5.0.0 enabled If |
Your overall preference regarding STAN-010X is a reasonable one, but if this issue is motivated by |
You can make it lazier like this: foo :: FilePath -> IO ()
foo fn = if null (drop 255 fn) then do_that else do_this |
That's a good point and it would be a much better suggestion, thanks. I wonder if a lazy |
I have a call of
length xs
in the middle of a function, which Stan is unhappy with because of STAN-0103: "Usage of thelength
function that hangs on infinite lists".How am I supposed to act on this? Stan offers two suggestions:
length
if you expect your function to work with infinite lists" - nope, I bloody well need the length of the list.slist
library for fast and safe functions on infinite lists" - but it does not seem thatSlist.size (Slist.slist xs)
is any safer thanlength xs
in case ifxs
happens to be infinite! Am I supposed to make a non-local refactoring, probably migrate the entire module toSlist
? This is likely to be unfeasible or prohibitively expensive in the majority of real-world cases.I personally do not think that STAN-0103 is worth to complain about, but that's fine, we can agree to disagree. I don't mind opinionated diagnostics, I do mind unactionable ones: if a policy mandates to maintain a clean Stan report, it's virtually impossible to do so.
The text was updated successfully, but these errors were encountered: