Home liberachat/#haskell: Logs Calendar

Logs: liberachat/#haskell

←Prev  Next→ 1,790,777 events total
2026-03-09 09:18:48 <merijn> castan: "instance Monoid b => Monoid (a -> b) where mappend f g = \x -> mappend (f x) (g x)"
2026-03-09 09:19:36 <merijn> castan: But that instance applies recursively (i.e. since "a -> b" is a Monoid when 'b' is, then "c -> a -> b" (which is just "c -> (a -> b)" is also a monoid)
2026-03-09 09:20:06 <merijn> :t comparing fst
2026-03-09 09:20:07 <lambdabot> Ord a => (a, b) -> (a, b) -> Ordering
2026-03-09 09:20:11 <merijn> :t comparing snd
2026-03-09 09:20:12 <lambdabot> Ord a1 => (a2, a1) -> (a2, a1) -> Ordering
2026-03-09 09:21:55 <merijn> Ordering is just "data Ordering = LT | EQ | GT" with "mappend LT _ = LT; mappend GT _ = GT; mappend EQ x = x" (i.e. it gives you the left-most non-equal value)
2026-03-09 09:22:57 <merijn> So "comparing snd <> comparing fst" passes the same 2 tuples to both functions and mappend results, which simply returns the result of "comparing snd" **unless** that returns EQ, then it falls back to the result of "comparing fst"
2026-03-09 09:23:30 <castan> oh and then with <> you get a lexicographic order on the pairs
2026-03-09 09:23:56 <merijn> castan: lexicographic order on the whatever functions you pass to it
2026-03-09 09:24:04 <merijn> but yes
2026-03-09 09:24:35 <castan> this is really cool, thank you for the info
2026-03-09 09:24:53 <merijn> It's stupid powerful for trivially writing really complicated sorts
2026-03-09 09:25:56 <merijn> It also works well for stuff like aggregating data, since you just need a monoid on the final result and then you can compose any number of functions computing stuff that take the same arguments into bigger aggregations
2026-03-09 09:26:42 <merijn> castan: It's even neater since you can my personal favourite "mwhen :: Monoid b => Boolean -> b" to selectively disable parts of aggregation/sorting
2026-03-09 09:27:55 × castan quits (~castan@2a02:2f0f:8210:d800:1625:20a6:66c:b041) (Quit: castan)
2026-03-09 09:29:23 <merijn> For a non-trivial real world example of the power of just stacking a bunch of monoids, see: https://github.com/haskell/cabal/blob/master/Cabal/src/Distribution/Simple/Program/GHC.hs#L67-L144
2026-03-09 09:30:06 <merijn> Good to see that that code hasn't been maintained/updated for, like, 10 GHC releases now >.>
2026-03-09 09:34:53 × prdak quits (~Thunderbi@user/prdak) (Ping timeout: 272 seconds)
2026-03-09 09:37:49 <[exa]> is there a "strict" generic monoidal `fold` ?
2026-03-09 09:38:11 <[exa]> the docs recommend going for `foldMap' id` but that's not cute
2026-03-09 09:38:17 <[exa]> y no fold'
2026-03-09 09:38:55 <[exa]> merijn: btw the slow hackage situation has been dragging for over a week now I'd say. can we somehow throw servers at it?
2026-03-09 09:39:42 kuribas joins (~user@2a02-1810-2825-6000-46e-614f-97bf-a1c6.ip6.access.telenet.be)
2026-03-09 09:40:28 <kuribas> Is a lot of haskell code now also "vibecoded"?
2026-03-09 09:40:33 <kuribas> I noticed this PR: https://github.com/winterland1989/mysql-haskell/pull/72
2026-03-09 09:40:56 <kuribas> "Generated with Claude Code"
2026-03-09 09:42:48 prdak joins (~Thunderbi@user/prdak)
2026-03-09 09:43:12 × akegalj quits (~akegalj@246-221.dsl.iskon.hr) (Quit: leaving)
2026-03-09 09:43:39 <[exa]> kuribas: apparently even some haskell folks love to just pour code on stuff
2026-03-09 09:44:14 <kuribas> "catch (void (waitCommandReply tlsIs')) ((\ _ -> return ()) :: SomeException -> IO ())"
2026-03-09 09:45:01 <[exa]> it's for mysql so aesthetics arguments don't apply
2026-03-09 09:45:22 <kuribas> right :)
2026-03-09 09:45:38 <kuribas> Also "if isOK q then return () else decodeFromPacket q >>= throwIO . ERRException"
2026-03-09 09:45:47 <kuribas> Instead "unless (isOk q) $ ..."
2026-03-09 09:46:02 <[exa]> c'mon it's python encoded in haskell, newbie-friendly!
2026-03-09 09:46:07 <mesaoptimizer> lol
2026-03-09 09:46:34 × alinab quits (sid468903@id-468903.helmsley.irccloud.com) (Quit: Connection closed for inactivity)
2026-03-09 09:47:04 <[exa]> I found that particular issue to be an interesting thing to write into homework assignments
2026-03-09 09:48:15 <[exa]> if you explicitly say "do not use Bool", humans will switch to some correct-by-construction workflow (like having Maybe query or so); poor claude will encode booleans in strings and integers
2026-03-09 09:51:04 <mesaoptimizer> I wonder if there are languages that are extremely resistant to LLM codegen, such that any code written is very likely human-written
2026-03-09 09:51:52 <kuribas> idris?
2026-03-09 09:53:02 <mesaoptimizer> possibly, yeah. I do notice that it is incredibly difficult for LLMs to write dependent type theoretic code, but my experiments were only with Agda (when attempting to learn it)
2026-03-09 09:53:38 <mesaoptimizer> one could also make syntax-semantics combinations that are extremely alien to the LLM
2026-03-09 09:54:19 <mesaoptimizer> perhaps if you model the syntax-semantics space, you can essentially sample from regions that are adverserially optimized to be incoherent and counter-intuitive to the model
2026-03-09 09:54:59 <mesaoptimizer> (question is whether they will stay intuitive enough for programmers)
2026-03-09 10:25:45 × xff0x quits (~xff0x@fsb6a9491c.tkyc517.ap.nuro.jp) (Ping timeout: 248 seconds)
2026-03-09 10:28:49 vgtw joins (~vgtw@user/vgtw)
2026-03-09 10:29:07 <merijn> [exa]: tbh, chatgpt seems to do much better with strongly typed code than other stuff imo
2026-03-09 10:32:10 <newmind> merijn: i feel like it is quite a bit worse at generation, it one-shots less reliably, and often falls back to imperative patterns which don't quite fit wit haskell... but at least most of the time it then doesn't compile and it can fix that, rather than relying just on unit tests or the user catching it
2026-03-09 10:33:45 <merijn> newmind: I've mostly been using it with Scala, so not entirely sure how it does for HAskell
2026-03-09 10:34:03 <merijn> mesaoptimizer: I mean, that's just reinventing Epigram but unprincipled :p\
2026-03-09 10:35:18 <newmind> at least the claude models are.. usable? they still get a lot of it wrong, and often get stuck in trivial sections, and the code they produce is... quite bad... but it compiles, and once it's working, refactoring it in a strongly typed language is so much more reliable than without
2026-03-09 10:41:58 × dutchie quits (~dutchie@user/dutchie) (Remote host closed the connection)
2026-03-09 10:42:41 dutchie joins (~dutchie@user/dutchie)
2026-03-09 10:48:42 arthurvl joins (~arthurvl@2a02-a469-f5e2-1-83d2-ca43-57a2-dc81.fixed6.kpn.net)
2026-03-09 10:59:05 × j1n37 quits (~j1n37@user/j1n37) (Read error: Connection reset by peer)
2026-03-09 11:00:19 j1n37 joins (~j1n37@user/j1n37)
2026-03-09 11:18:47 <int-e> "but it compiles" -- yeah because they throw the code at the compiler until it does
2026-03-09 11:19:57 <newmind> int-e: more or less, yes :) still more successful than just inventing code that then just crashes at runtime
2026-03-09 11:20:02 <mauke> I strongly prefer code to be typed, not generated
2026-03-09 11:20:14 × dutchie quits (~dutchie@user/dutchie) (Remote host closed the connection)
2026-03-09 11:20:28 <int-e> mauke: with Haskell you can have both!
2026-03-09 11:20:30 int-e runs
2026-03-09 11:20:33 × prdak quits (~Thunderbi@user/prdak) (Ping timeout: 265 seconds)
2026-03-09 11:21:14 dutchie joins (~dutchie@user/dutchie)
2026-03-09 11:21:50 dhil joins (~dhil@5.151.29.139)
2026-03-09 11:28:07 prdak joins (~Thunderbi@user/prdak)
2026-03-09 11:29:11 danza joins (~danza@user/danza)
2026-03-09 11:37:13 × _d0t quits (~{-d0t-}@user/-d0t-/x-7915216) (Ping timeout: 276 seconds)
2026-03-09 11:42:20 _d0t joins (~{-d0t-}@user/-d0t-/x-7915216)
2026-03-09 11:45:01 × oskarw quits (~user@user/oskarw) (Ping timeout: 276 seconds)
2026-03-09 11:50:58 × danza quits (~danza@user/danza) (Read error: Connection reset by peer)
2026-03-09 11:51:12 danza joins (~danza@user/danza)
2026-03-09 11:52:02 × danza quits (~danza@user/danza) (Remote host closed the connection)
2026-03-09 11:54:20 × CiaoSen quits (~Jura@2a02:8071:64e1:da0:5a47:caff:fe78:33db) (Ping timeout: 245 seconds)
2026-03-09 11:56:18 wootehfoot joins (~wootehfoo@user/wootehfoot)
2026-03-09 11:57:17 target_i joins (~target_i@user/target-i/x-6023099)
2026-03-09 12:05:24 × czan quits (~czan@user/mange) (Ping timeout: 246 seconds)
2026-03-09 12:06:12 CiaoSen joins (~Jura@2a02:8071:64e1:da0:5a47:caff:fe78:33db)
2026-03-09 12:09:56 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Quit: = "")
2026-03-09 12:24:29 xff0x joins (~xff0x@2405:6580:b080:900:3f2f:c15f:718f:76d4)
2026-03-09 12:25:46 <ski> EvanR : yea, the point of that respone was to provide perhaps a more mathematical/logical aspect to the FD semantics. but yes, neither of the mentioned two effects have anything to do with actually selecting an instance, but rather to constrain the usage (merging used instances (demanded constraints)) and definition (disallowing instances violating the FD) of instances
2026-03-09 12:31:24 × YoungFrog quits (~youngfrog@39.129-180-91.adsl-dyn.isp.belgacom.be) (Quit: ZNC 1.7.x-git-3-96481995 - https://znc.in)
2026-03-09 12:32:41 YoungFrog joins (~youngfrog@2a02:a03f:ca07:f900:1032:66d2:1281:f541)
2026-03-09 12:46:32 Square2 joins (~Square4@user/square)
2026-03-09 12:54:06 × prdak quits (~Thunderbi@user/prdak) (Read error: Connection reset by peer)
2026-03-09 12:54:17 prdak1 joins (~Thunderbi@user/prdak)
2026-03-09 12:58:29 prdak1 is now known as prdak
2026-03-09 13:13:34 × wootehfoot quits (~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer)
2026-03-09 13:16:17 × Fischmiep quits (~Fischmiep@user/Fischmiep) (Remote host closed the connection)
2026-03-09 13:26:07 oskarw joins (~user@user/oskarw)
2026-03-09 13:35:59 × st_aldini quits (~Betterbir@136.48.46.187) (Quit: st_aldini)
2026-03-09 13:54:05 comerijn joins (~merijn@77.242.116.146)
2026-03-09 13:57:00 × merijn quits (~merijn@77.242.116.146) (Ping timeout: 268 seconds)
2026-03-09 14:01:49 ezzieyguywuf joins (~Unknown@user/ezzieyguywuf)
2026-03-09 14:09:00 × aka_dude quits (~aka_dude@2a03:f80:30:f490::1) (Quit: Gateway shutdown)
2026-03-09 14:10:10 aka_dude joins (~aka_dude@2a03:f80:30:f490::1)
2026-03-09 14:11:56 danza joins (~danza@user/danza)
2026-03-09 14:26:12 × arandombit quits (~arandombi@user/arandombit) (Ping timeout: 264 seconds)

All times are in UTC.