Logs: liberachat/#haskell
| 2026-04-03 20:33:26 | <tomsmeding> | but yeah, here I'm really at a loss why there isn't `aeson` and then `aeson-quickcheck` which gives the Arbitrary instances, apart from blowing up the number of tiny packages on Hackage |
| 2026-04-03 20:33:36 | <dolio> | It seems like it should be okay for aeson to separate a canonical package out with orphan quick check instances. |
| 2026-04-03 20:33:52 | <dolio> | And the rule should mean that random other idiots shouldn't be writing orphan instances for aeson. |
| 2026-04-03 20:33:59 | <tomsmeding> | agreed |
| 2026-04-03 20:34:14 | <tomsmeding> | good, question resolved, it's aeson's problem :p |
| 2026-04-03 20:35:16 | <dolio> | Part of the problem is people unthinkinly obeying stuff in -Wall. |
| 2026-04-03 20:35:28 | <dolio> | Just in general. |
| 2026-04-03 20:36:36 | × | takuan quits (~takuan@d8D86B9E9.access.telenet.be) (Ping timeout: 255 seconds) |
| 2026-04-03 20:38:24 | <geekosaur> | part of the problem there is people being trained by gcc/g++ where it's usually a good idea |
| 2026-04-03 20:38:47 | <geekosaur> | and I have in fact heard people respond to your complaint with "so why is it in `-Wall`?" |
| 2026-04-03 20:42:56 | <dolio> | It seems odd to not want all the warnings in -Wall, even though it still doesn't have all the warnings. |
| 2026-04-03 20:43:45 | <tomsmeding> | -Wall not having all warnings, just the generally important ones, is a historical naming error that we're unlikely to be correcting now |
| 2026-04-03 20:44:06 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 2026-04-03 20:44:52 | <dolio> | I'm not sure any -Wall would be something that I'd endorse, because there are just too many people eager to follow arbitrary coding conventions that trade one error for another, at least in Haskell. |
| 2026-04-03 20:46:47 | <dolio> | It'd have to be trimmed way back, at least. |
| 2026-04-03 20:47:06 | <tomsmeding> | dolio: you mean GHC's -Wall, or also gcc's -Wall? |
| 2026-04-03 20:47:16 | <dolio> | GHC. |
| 2026-04-03 20:47:33 | <dolio> | I don't do much C, so I don't know about gcc's choices. |
| 2026-04-03 20:48:32 | <Leary> | Global coherence and modularity are at odds; responsibility for their coexistence should fall to the language or packaging system. I can't blame 'aeson' for not wanting to write a bunch of orphans---they really shouldn't have to. Hell, they shouldn't even be /allowed/ to. |
| 2026-04-03 20:49:04 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 265 seconds) |
| 2026-04-03 20:51:15 | <tomsmeding> | dolio: would -Wdefault do? Or is perhaps -Winaccessible-code too much? |
| 2026-04-03 20:51:19 | <tomsmeding> | ( https://downloads.haskell.org/ghc/latest/docs/users_guide/using-warnings.html#ghc-flag-Wdefault ) |
| 2026-04-03 20:52:21 | <geekosaur> | In the case of gcc a lot of it is older sources and the rest is things known to trip unsuspecting programmers |
| 2026-04-03 20:53:55 | <geekosaur> | Point being, C is a very different ecosystem |
| 2026-04-03 20:53:58 | <dolio> | -Wdefault looks okay. But that's what's actually on by default, right? |
| 2026-04-03 20:54:06 | <tomsmeding> | yes |
| 2026-04-03 20:54:56 | <monochrom> | My tangential sideways peeve is that people blindly believe in hlint just because C's lint (totally unrelated) is a really good idea. |
| 2026-04-03 20:55:01 | <tomsmeding> | then there is -Wextra, which is in between -Wdefault and -Wall |
| 2026-04-03 20:55:04 | <dolio> | I think some beyond that are probably worth enabling, but even -W has some stuff I'm not a huge fan of. |
| 2026-04-03 20:55:10 | <tomsmeding> | not to be confused with gcc's -Wextra, which is even more than its -Wall |
| 2026-04-03 20:55:52 | <monochrom> | Forgetting that the whole reason C's lint exists is because, for example, of the stupid C syntax design such that you intend "if (x == y)" but you mistype it as "if (x = y)". |
| 2026-04-03 20:56:03 | <geekosaur> | `-Wdefault` can be annoying when there are cases where it's hard to avoid defaulting |
| 2026-04-03 20:56:40 | <tomsmeding> | geekosaur: I think you mean -Wtype-defaults there, which is in -Wall |
| 2026-04-03 20:56:50 | <geekosaur> | lint is long gone, that's why it's compiler warnings now |
| 2026-04-03 20:57:01 | <geekosaur> | Oh |
| 2026-04-03 20:57:26 | <geekosaur> | It was an AT&T UNIXism |
| 2026-04-03 20:57:37 | → | raelie joins (~raelie@2a06:5904:11c4:b000:148b:d28e:318a:8d84) |
| 2026-04-03 20:57:37 | × | raelie quits (~raelie@2a06:5904:11c4:b000:148b:d28e:318a:8d84) (Changing host) |
| 2026-04-03 20:57:37 | → | raelie joins (~raelie@user/raelie) |
| 2026-04-03 20:58:14 | × | jmcantrell_ quits (~weechat@user/jmcantrell) (Ping timeout: 245 seconds) |
| 2026-04-03 20:58:48 | <geekosaur> | And was never updated for ANSI C |
| 2026-04-03 20:58:49 | <dolio> | Actually -W is probably okay as a pass before something public. |
| 2026-04-03 20:59:17 | <dolio> | The annoying stuff is when you're working. |
| 2026-04-03 20:59:53 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 2026-04-03 21:01:18 | <absurdvoid> | I find it helpful to have a "dev" mode where a lot of warnings/errors are disabled for quicker iteration. Can be toggled with a flag. |
| 2026-04-03 21:01:23 | <tomsmeding> | I agree that -Wunused-bindings and -Wunused-imports are nothing but in the way while you're working |
| 2026-04-03 21:02:17 | <tomsmeding> | but I use -Wunused-matches _all the time_ while coding |
| 2026-04-03 21:02:28 | <tomsmeding> | it's my signal that I still need to do something |
| 2026-04-03 21:04:54 | <monochrom> | I refuse -Wunused-do-bind under all circumstances. |
| 2026-04-03 21:05:01 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 265 seconds) |
| 2026-04-03 21:05:20 | <tomsmeding> | refuse to enable it? |
| 2026-04-03 21:05:26 | <monochrom> | Yeah. |
| 2026-04-03 21:06:07 | <tomsmeding> | oh, that one. Yeah, I find myself following it but it's questionable, true |
| 2026-04-03 21:07:07 | <dolio> | I'm not sure I've ever found a genuine problem with that one. |
| 2026-04-03 21:08:16 | <dolio> | I'm pretty down on -Wname-shadowing these days, too. |
| 2026-04-03 21:08:22 | <monochrom> | Is the purpose of -Wall assistance or is it policing? If I write "do foo; quux; bar x" as a mistake and it should be "do x <- foo; quux; bar x", I will know soon enough, either because "x not in scope" or I spot the absence of x myself when I write "bar x". |
| 2026-04-03 21:08:42 | → | pavonia joins (~user@user/siracusa) |
| 2026-04-03 21:08:49 | <monochrom> | Only policing can explain why I need one more warning. |
| 2026-04-03 21:09:28 | <tomsmeding> | C actually has a more selective version of -Wunused-do-bind: -Wunused-result, which only triggers for functions that are declared with a particular attribute warn-unused-result |
| 2026-04-03 21:09:37 | → | arandombit joins (~arandombi@user/arandombit) |
| 2026-04-03 21:09:39 | <tomsmeding> | which is important in C because of return values you should not forget to check |
| 2026-04-03 21:09:52 | <monochrom> | Yeah that one I appreciate. |
| 2026-04-03 21:10:16 | <dolio> | The purpose of unused-do-bind is supposedly to catch when you use traverse instead of traverse_ or similar. |
| 2026-04-03 21:10:58 | <dolio> | But the number of efficiency errors like that is much lower than results you just don't care about. |
| 2026-04-03 21:11:07 | <monochrom> | That belongs to hlint. |
| 2026-04-03 21:11:20 | <monochrom> | Or at least, IMO it should belong to hlint. |
| 2026-04-03 21:11:34 | <monochrom> | What's next, -Wall warn you about foldl vs foldl' too? |
| 2026-04-03 21:11:38 | <geekosaur> | hlint would need to know about types instead of code heuristics to do that, though |
| 2026-04-03 21:11:55 | <tomsmeding> | honestly one of the reasons -Wunused-do-bind is annoying is because parsec and friends for some inscrutable reason made `char` return a Char |
| 2026-04-03 21:12:11 | → | finsternis joins (~X@23.226.237.192) |
| 2026-04-03 21:12:18 | <tomsmeding> | I'm already passing you the character, why return it? |
| 2026-04-03 21:12:28 | <monochrom> | No, hlint just needs to hardcode the syntax pattern of "do ... ; traverse/forM xs; ..." |
| 2026-04-03 21:13:21 | <monochrom> | Oh I can justify the char parser. I may have `char 'a' <|> char 'b'` now I want to know which one I got. :) |
| 2026-04-03 21:13:58 | <tomsmeding> | I guess. Now I wonder which came first: -Wall having -Wunused-do-binds, or parsec having char returning a Char |
| 2026-04-03 21:14:21 | × | raelie quits (~raelie@user/raelie) (Remote host closed the connection) |
| 2026-04-03 21:14:41 | <tomsmeding> | because in my (mostly pointless) following of -Wunused-do-bind in my code, 90% of the annoying cases where I add a pointless `_ <-` are for `char` |
| 2026-04-03 21:14:44 | <geekosaur> | parsec by a decade, I think |
| 2026-04-03 21:15:03 | <tomsmeding> | adding a _ to a mapM is really not the problem |
| 2026-04-03 21:15:35 | <geekosaur> | along with a lot of example code which assumed `-Wunused-do-bind` didn't exist |
| 2026-04-03 21:15:39 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 2026-04-03 21:15:43 | <tomsmeding> | nice |
| 2026-04-03 21:15:50 | <tomsmeding> | well that explains :p |
| 2026-04-03 21:16:13 | <monochrom> | `char` returning the character you already know is a nicety that you have the full right to use or ignore. SImilarly to in the OOP world most methods return this so you can chain o.m1().m2().m3(). (Especially popular among the JS people.) |
| 2026-04-03 21:16:28 | <tomsmeding> | ah, and 8% of the remaining cases are forkIO |
| 2026-04-03 21:16:55 | <monochrom> | But most importantly, the OOP world did not freak out and added -Wunused-return-value to their -Wall. |
| 2026-04-03 21:16:56 | <tomsmeding> | (I just wrote one) |
| 2026-04-03 21:19:55 | × | absurdvoid quits (~absurdvoi@user/absurdvoid) (Ping timeout: 268 seconds) |
| 2026-04-03 21:20:23 | → | Guest20 joins (~Guest20@149.3.7.235) |
| 2026-04-03 21:20:42 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 255 seconds) |
| 2026-04-03 21:21:43 | → | absurdvoid joins (~absurdvoi@user/absurdvoid) |
| 2026-04-03 21:24:00 | → | Square3 joins (~Square@user/square) |
| 2026-04-03 21:25:03 | <monochrom> | OK I like -W now. Didn't know that it exists. |
| 2026-04-03 21:28:44 | <monochrom> | gcc -O2 turns on more warnings than -O0. Anyone want to bring that ideology to GHC? Maybe next April 1? >:) |
| 2026-04-03 21:29:07 | <tomsmeding> | isn't that to make ghc -O0 faster? |
| 2026-04-03 21:29:21 | <monochrom> | I don't know. Is that it? |
| 2026-04-03 21:29:44 | <tomsmeding> | IIRC some of the analyses needed to produce the warnings are only computed for the benefit of particular optimisations |
| 2026-04-03 21:29:57 | <monochrom> | I was guessing that it was because -O2 breaks more code under beginner mistakes. |
| 2026-04-03 21:30:04 | <tomsmeding> | or, reformulated, they think it's not worth generating the warnings if that's the only reason for running the analysis |
| 2026-04-03 21:30:20 | <tomsmeding> | but this is from memory -- not 100% sure |
| 2026-04-03 21:30:27 | <monochrom> | Ah OK. I think the two are logically equivalent. :) |
All times are in UTC.