2026/03/09

2026-03-09 00:00:44 +0100 <davean> They just add a constrait to solve for to the type checker
2026-03-09 00:03:55 +0100picnoir(~picnoir@about/aquilenet/vodoo/NinjaTrappeur) (Ping timeout: 245 seconds)
2026-03-09 00:06:18 +0100Square(~Square@user/square) (Ping timeout: 244 seconds)
2026-03-09 00:06:23 +0100Square2(~Square4@user/square) Square
2026-03-09 00:17:20 +0100picnoir(~picnoir@about/aquilenet/vodoo/NinjaTrappeur) NinjaTrappeur
2026-03-09 00:36:51 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-03-09 00:41:42 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 256 seconds)
2026-03-09 00:52:17 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-03-09 00:56:42 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 246 seconds)
2026-03-09 00:57:06 +0100stackdroid18(~stackdroi@user/stackdroid) ()
2026-03-09 01:01:25 +0100arandombit(~arandombi@user/arandombit) (Ping timeout: 268 seconds)
2026-03-09 01:07:58 +0100arandombit(~arandombi@user/arandombit) arandombit
2026-03-09 01:08:03 +0100merijn(~merijn@62.45.136.136) merijn
2026-03-09 01:10:37 +0100tremon(~tremon@83.80.159.219) (Quit: getting boxed in)
2026-03-09 01:12:26 +0100merijn(~merijn@62.45.136.136) (Ping timeout: 244 seconds)
2026-03-09 01:14:12 +0100tzh(~tzh@c-76-115-131-146.hsd1.or.comcast.net)
2026-03-09 01:14:30 +0100arandombit(~arandombi@user/arandombit) (Ping timeout: 244 seconds)
2026-03-09 01:23:29 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-03-09 01:28:02 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds)
2026-03-09 01:29:33 +0100Tuplanolla(~Tuplanoll@88.114.89.88) (Quit: Leaving.)
2026-03-09 01:30:16 +0100arandombit(~arandombi@2a02:2455:8656:7100:49f2:4a42:13a7:5052)
2026-03-09 01:30:16 +0100arandombit(~arandombi@2a02:2455:8656:7100:49f2:4a42:13a7:5052) (Changing host)
2026-03-09 01:30:16 +0100arandombit(~arandombi@user/arandombit) arandombit
2026-03-09 01:39:07 +0100merijn(~merijn@62.45.136.136) merijn
2026-03-09 01:40:27 +0100arandombit(~arandombi@user/arandombit) (Remote host closed the connection)
2026-03-09 01:42:33 +0100arandombit(~arandombi@2a02:2455:8656:7100:49f2:4a42:13a7:5052)
2026-03-09 01:42:33 +0100arandombit(~arandombi@2a02:2455:8656:7100:49f2:4a42:13a7:5052) (Changing host)
2026-03-09 01:42:33 +0100arandombit(~arandombi@user/arandombit) arandombit
2026-03-09 01:43:39 +0100czan(~czan@user/mange) czan
2026-03-09 01:43:58 +0100xff0x(~xff0x@2405:6580:b080:900:3d38:9b05:9987:e9b1) (Ping timeout: 268 seconds)
2026-03-09 01:45:54 +0100merijn(~merijn@62.45.136.136) (Ping timeout: 255 seconds)
2026-03-09 01:47:27 +0100arandombit(~arandombi@user/arandombit) (Ping timeout: 246 seconds)
2026-03-09 01:50:49 +0100arandombit(~arandombi@2a02:2455:8656:7100:49f2:4a42:13a7:5052)
2026-03-09 01:50:49 +0100arandombit(~arandombi@2a02:2455:8656:7100:49f2:4a42:13a7:5052) (Changing host)
2026-03-09 01:50:49 +0100arandombit(~arandombi@user/arandombit) arandombit
2026-03-09 01:57:04 +0100merijn(~merijn@62.45.136.136) merijn
2026-03-09 02:02:12 +0100merijn(~merijn@62.45.136.136) (Ping timeout: 264 seconds)
2026-03-09 02:12:22 +0100arandombit(~arandombi@user/arandombit) (Ping timeout: 244 seconds)
2026-03-09 02:12:50 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-03-09 02:12:50 +0100karenw_(~karenw@user/karenw) (Ping timeout: 248 seconds)
2026-03-09 02:17:49 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 245 seconds)
2026-03-09 02:20:26 +0100travgm(~travgm@fsf/member/travgm) (Quit: Leaving)
2026-03-09 02:20:44 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-03-09 02:25:34 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 265 seconds)
2026-03-09 02:26:29 +0100j1n37(~j1n37@user/j1n37) j1n37
2026-03-09 02:36:38 +0100merijn(~merijn@62.45.136.136) merijn
2026-03-09 02:39:06 +0100xff0x(~xff0x@fsb6a9491c.tkyc517.ap.nuro.jp)
2026-03-09 02:40:47 +0100merijn(~merijn@62.45.136.136) (Ping timeout: 244 seconds)
2026-03-09 02:52:00 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-03-09 02:57:19 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 264 seconds)
2026-03-09 03:07:47 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-03-09 03:13:00 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 256 seconds)
2026-03-09 03:23:43 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-03-09 03:30:10 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 245 seconds)
2026-03-09 03:36:10 +0100bggd_(~bgg@2a01:e0a:fd5:f510:d84e:bd19:3fca:eb64)
2026-03-09 03:43:56 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-03-09 03:48:46 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 276 seconds)
2026-03-09 03:51:39 +0100khumba(~khumba@user/khumba) khumba
2026-03-09 03:56:08 +0100 <ski> EvanR : for `class C a b c | a -> b', this expresses `forall a. unique b. exists c. C a b c', which is equivalent to `forall a b0 b1 c0 c1. (C a b0 c0,C a b1 c1) => b0 = b1'. this means that if you infer constraints `C a b0 c0' and `C a b1 c1' then you can add the constraint `b0 = b1'. it also means that if you find two instances where the `a' part is the same (upto renaming of tyvars) but the `b' part
2026-03-09 03:56:14 +0100 <ski> differs, then you have a violation of the FD
2026-03-09 03:57:38 +0100 <ski> "either this or associated types are needed to make multiparameter type classes typecheck without explicit annotations" -- for many, but not for all, usages. if you only invoke a single `C a b c' constraint (or there's only a single instance), then the presence or absence of the FD makes no difference
2026-03-09 03:59:03 +0100 <ski> (by `unique a. ..a..' i here mean "exists at most one", so equivalent to `forall a0 a1. (..a0..,..a1..) => a0 = a1')
2026-03-09 03:59:17 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-03-09 04:03:26 +0100arandombit(~arandombi@user/arandombit) arandombit
2026-03-09 04:04:03 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 255 seconds)
2026-03-09 04:08:06 +0100arandombit(~arandombi@user/arandombit) (Ping timeout: 244 seconds)
2026-03-09 04:09:23 +0100arandombit(~arandombi@2a02:2455:8656:7100:49f2:4a42:13a7:5052)
2026-03-09 04:09:23 +0100arandombit(~arandombi@2a02:2455:8656:7100:49f2:4a42:13a7:5052) (Changing host)
2026-03-09 04:09:23 +0100arandombit(~arandombi@user/arandombit) arandombit
2026-03-09 04:14:26 +0100arandombit(~arandombi@user/arandombit) (Ping timeout: 268 seconds)
2026-03-09 04:14:42 +0100myxos(~myxos@174-18-44-59.tcso.qwest.net) (Remote host closed the connection)
2026-03-09 04:15:02 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-03-09 04:17:38 +0100attlin(~user@user/attlin) (Ping timeout: 248 seconds)
2026-03-09 04:19:45 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 245 seconds)
2026-03-09 04:24:46 +0100poscat(~poscat@user/poscat) (Remote host closed the connection)
2026-03-09 04:26:08 +0100myxos(~myxos@174-18-44-59.tcso.qwest.net) myxokephale
2026-03-09 04:27:40 +0100poscat(~poscat@user/poscat) poscat
2026-03-09 04:37:14 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-03-09 04:38:47 +0100 <EvanR> that seems to all add up to the same thing as what i said. None of which to me connects with the "point" which is to select an instance
2026-03-09 04:39:55 +0100 <EvanR> the instances form a relation among types, restricted further by the functional dependency noted = all these constraints exist
2026-03-09 04:42:18 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 255 seconds)
2026-03-09 04:47:25 +0100attlin(~user@user/attlin) attlin
2026-03-09 04:50:24 +0100peterbecich(~Thunderbi@71.84.33.135) peterbecich
2026-03-09 04:52:04 +0100attlin(~user@user/attlin) (Quit: Leaving)
2026-03-09 04:53:02 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-03-09 04:56:07 +0100attlin(~user@user/attlin) attlin
2026-03-09 04:57:22 +0100rembo10(~rembo10@main.remulis.com) (Quit: ZNC 1.10.1 - https://znc.in)
2026-03-09 04:57:55 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 264 seconds)
2026-03-09 04:58:11 +0100rembo10(~rembo10@main.remulis.com) rembo10
2026-03-09 04:59:46 +0100Square2(~Square4@user/square) (Ping timeout: 244 seconds)
2026-03-09 05:14:42 +0100khumba(~khumba@user/khumba) (Ping timeout: 255 seconds)
2026-03-09 05:16:04 +0100khumba(~khumba@24.70.121.49)
2026-03-09 05:16:11 +0100khumba(~khumba@24.70.121.49) (Changing host)
2026-03-09 05:16:11 +0100khumba(~khumba@user/khumba) khumba
2026-03-09 05:18:21 +0100tessier(~tessier@ip68-8-117-219.sd.sd.cox.net) tessier
2026-03-09 05:18:55 +0100machinedgod(~machinedg@d172-219-48-230.abhsia.telus.net) (Ping timeout: 264 seconds)
2026-03-09 05:22:44 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-03-09 05:26:26 +0100arandombit(~arandombi@2a02:2455:8656:7100:49f2:4a42:13a7:5052)
2026-03-09 05:26:26 +0100arandombit(~arandombi@2a02:2455:8656:7100:49f2:4a42:13a7:5052) (Changing host)
2026-03-09 05:26:26 +0100arandombit(~arandombi@user/arandombit) arandombit
2026-03-09 05:29:13 +0100khumba(~khumba@user/khumba) (Ping timeout: 244 seconds)
2026-03-09 05:30:24 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 246 seconds)
2026-03-09 05:31:31 +0100arandombit(~arandombi@user/arandombit) (Ping timeout: 272 seconds)
2026-03-09 05:42:02 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-03-09 05:47:12 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 264 seconds)
2026-03-09 05:57:50 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-03-09 06:00:36 +0100arandombit(~arandombi@user/arandombit) arandombit
2026-03-09 06:02:51 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 255 seconds)
2026-03-09 06:06:03 +0100arandombit(~arandombi@user/arandombit) (Ping timeout: 268 seconds)
2026-03-09 06:12:05 +0100arandombit(~arandombi@user/arandombit) arandombit
2026-03-09 06:13:59 +0100merijn(~merijn@62.45.136.136) merijn
2026-03-09 06:18:18 +0100merijn(~merijn@62.45.136.136) (Ping timeout: 244 seconds)
2026-03-09 06:23:45 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-03-09 06:28:30 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 246 seconds)
2026-03-09 06:32:12 +0100jzargo2(~jzargo@user/jzargo) (Read error: Connection reset by peer)
2026-03-09 06:32:37 +0100jzargo2(~jzargo@user/jzargo) jzargo
2026-03-09 06:39:32 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-03-09 06:42:13 +0100divlamir(~divlamir@user/divlamir) (Read error: Connection reset by peer)
2026-03-09 06:42:23 +0100divlamir(~divlamir@user/divlamir) divlamir
2026-03-09 06:44:20 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 245 seconds)
2026-03-09 07:03:55 +0100peterbecich(~Thunderbi@71.84.33.135) (Ping timeout: 264 seconds)
2026-03-09 07:13:25 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-03-09 07:15:39 +0100arandombit(~arandombi@user/arandombit) (Ping timeout: 244 seconds)
2026-03-09 07:18:33 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 272 seconds)
2026-03-09 07:19:27 +0100takuan(~takuan@d8D86B9E9.access.telenet.be)
2026-03-09 07:20:48 +0100terrorjack(~terrorjac@2a01:4f8:271:2d98::2) terrorjack
2026-03-09 07:22:48 +0100tzh_(~tzh@c-76-115-131-146.hsd1.or.comcast.net)
2026-03-09 07:24:44 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-03-09 07:25:00 +0100tzh(~tzh@c-76-115-131-146.hsd1.or.comcast.net) (Ping timeout: 264 seconds)
2026-03-09 07:29:18 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 268 seconds)
2026-03-09 07:40:07 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-03-09 07:45:20 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 268 seconds)
2026-03-09 07:49:12 +0100michalz(~michalz@185.246.207.200)
2026-03-09 07:49:16 +0100oskarw(~user@user/oskarw) oskarw
2026-03-09 07:50:29 +0100sord937(~sord937@gateway/tor-sasl/sord937) sord937
2026-03-09 07:55:54 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-03-09 07:56:35 +0100califax_(~califax@user/califx) califx
2026-03-09 07:57:41 +0100califax(~califax@user/califx) (Ping timeout: 258 seconds)
2026-03-09 07:57:54 +0100califax_califax
2026-03-09 08:01:00 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 264 seconds)
2026-03-09 08:10:11 +0100Sgeo(~Sgeo@user/sgeo) (Read error: Connection reset by peer)
2026-03-09 08:11:45 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-03-09 08:12:44 +0100arandombit(~arandombi@user/arandombit) arandombit
2026-03-09 08:12:53 +0100czan(~czan@user/mange) (Quit: Dinner time!)
2026-03-09 08:16:34 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 245 seconds)
2026-03-09 08:17:00 +0100arandombit(~arandombi@user/arandombit) (Ping timeout: 246 seconds)
2026-03-09 08:25:44 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-03-09 08:29:51 +0100arandombit(~arandombi@2a02:2455:8656:7100:49f2:4a42:13a7:5052)
2026-03-09 08:29:51 +0100arandombit(~arandombi@2a02:2455:8656:7100:49f2:4a42:13a7:5052) (Changing host)
2026-03-09 08:29:51 +0100arandombit(~arandombi@user/arandombit) arandombit
2026-03-09 08:30:19 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 245 seconds)
2026-03-09 08:41:08 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-03-09 08:42:52 +0100humasect(~humasect@dyn-192-249-132-90.nexicom.net) (Remote host closed the connection)
2026-03-09 08:47:40 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 245 seconds)
2026-03-09 08:53:33 +0100CiaoSen(~Jura@2a02:8071:64e1:da0:5a47:caff:fe78:33db) CiaoSen
2026-03-09 09:00:56 +0100jmcantrell_(~weechat@user/jmcantrell) (Ping timeout: 256 seconds)
2026-03-09 09:02:00 +0100tzh_(~tzh@c-76-115-131-146.hsd1.or.comcast.net) (Quit: zzz)
2026-03-09 09:18:44 +0100ft(~ft@p4fc2a98c.dip0.t-ipconnect.de) (Quit: leaving)
2026-03-09 09:20:18 +0100CiaoSen(~Jura@2a02:8071:64e1:da0:5a47:caff:fe78:33db) (Ping timeout: 268 seconds)
2026-03-09 09:22:31 +0100prdak(~Thunderbi@user/prdak) prdak
2026-03-09 09:25:08 +0100prdak(~Thunderbi@user/prdak) (Remote host closed the connection)
2026-03-09 09:25:38 +0100prdak(~Thunderbi@user/prdak) prdak
2026-03-09 09:29:53 +0100merijn(~merijn@77.242.116.146) merijn
2026-03-09 09:31:59 +0100arthurvl(~arthurvl@2a02-a469-f5e2-1-83d2-ca43-57a2-dc81.fixed6.kpn.net) (Ping timeout: 245 seconds)
2026-03-09 09:37:15 +0100arandombit(~arandombi@user/arandombit) (Ping timeout: 272 seconds)
2026-03-09 09:38:09 +0100Lord_of_Life(~Lord@user/lord-of-life/x-2819915) (Quit: Laa shay'a waqi'un moutlaq bale kouloun moumkine)
2026-03-09 09:38:26 +0100vgtw(~vgtw@user/vgtw) (Ping timeout: 252 seconds)
2026-03-09 09:41:49 +0100Lord_of_Life(~Lord@user/lord-of-life/x-2819915) Lord_of_Life
2026-03-09 09:42:00 +0100CiaoSen(~Jura@2a02:8071:64e1:da0:5a47:caff:fe78:33db) CiaoSen
2026-03-09 09:45:45 +0100akegalj(~akegalj@246-221.dsl.iskon.hr) akegalj
2026-03-09 09:46:23 +0100emmanuelux(~em@user/emmanuelux) (Quit: bye)
2026-03-09 09:49:48 +0100chele(~chele@user/chele) chele
2026-03-09 09:52:18 +0100chexum(~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection)
2026-03-09 09:52:21 +0100arandombit(~arandombi@2a02:2455:8656:7100:49f2:4a42:13a7:5052)
2026-03-09 09:52:21 +0100arandombit(~arandombi@2a02:2455:8656:7100:49f2:4a42:13a7:5052) (Changing host)
2026-03-09 09:52:21 +0100arandombit(~arandombi@user/arandombit) arandombit
2026-03-09 09:52:40 +0100chexum(~quassel@gateway/tor-sasl/chexum) chexum
2026-03-09 09:55:40 +0100castan(~castan@2a02:2f0f:8210:d800:1625:20a6:66c:b041)
2026-03-09 09:57:31 +0100__monty__(~toonn@user/toonn) toonn
2026-03-09 10:01:50 +0100 <castan> Hi. Can someone help me understand what sorcery makes `mappend mempty Sum 3` get parsed as `mappend mempty (Sum 3)`
2026-03-09 10:02:24 +0100czan(~czan@user/mange) czan
2026-03-09 10:03:08 +0100loungerry_(~loungerry@150.241.86.78) (Remote host closed the connection)
2026-03-09 10:04:35 +0100 <probie> None
2026-03-09 10:04:42 +0100 <Leary> castan: It doesn't get /parsed/ as that; that's what it equals. `mappend mempty x = x` ==> `mappend mempty Sum = Sum` ==> `mappend mempty Sum 3 = Sum 3`.
2026-03-09 10:05:04 +0100 <Leary> One key detail here being `Monoid b => Monoid (a -> b)`.
2026-03-09 10:05:21 +0100 <probie> :t mappend mempty Sum
2026-03-09 10:05:22 +0100 <lambdabot> Num a => a -> Sum a
2026-03-09 10:05:38 +0100 <probie> :t (mappend mempty)
2026-03-09 10:05:39 +0100 <lambdabot> Monoid a => a -> a
2026-03-09 10:05:42 +0100 <castan> Oh hahahha
2026-03-09 10:06:35 +0100 <castan> I see now, thank you
2026-03-09 10:07:58 +0100 <mesaoptimizer> :t mappend
2026-03-09 10:07:59 +0100 <lambdabot> Monoid a => a -> a -> a
2026-03-09 10:08:06 +0100 <mesaoptimizer> :t mappend mempty
2026-03-09 10:08:07 +0100 <lambdabot> Monoid a => a -> a
2026-03-09 10:08:14 +0100 <mesaoptimizer> :t mappend mempty Sum
2026-03-09 10:08:15 +0100 <lambdabot> Num a => a -> Sum a
2026-03-09 10:08:21 +0100 <mesaoptimizer> :t mappend mempty Sum 3
2026-03-09 10:08:22 +0100 <lambdabot> Num t => Sum t
2026-03-09 10:10:19 +0100 <__monty__> Were you expecting a different result? Because `mappend mempty (Sum 3) = Sum 3` too.
2026-03-09 10:10:20 +0100 <merijn> best monoit instance ever
2026-03-09 10:10:40 +0100 <merijn> __monty__: No, his question is why is it correct at all :p
2026-03-09 10:10:58 +0100 <merijn> __monty__: Which, if you don't realise the monoid on functions is confusing
2026-03-09 10:12:02 +0100 <merijn> castan: And absolutely brilliant use for this monoid is the fact that Ordering is a monoid, so you can use it to combine comparison functions to do multi way ordering
2026-03-09 10:13:07 +0100 <merijn> :t comparing
2026-03-09 10:13:08 +0100 <lambdabot> Ord a => (b -> a) -> b -> b -> Ordering
2026-03-09 10:13:13 +0100 <merijn> :t sortBy
2026-03-09 10:13:14 +0100 <lambdabot> (a -> a -> Ordering) -> [a] -> [a]
2026-03-09 10:14:00 +0100 <merijn> > sortBy (comparing snd <> comparing fst) [(3,9), (2,9), (1, 9), (3, 1), (2, 1), (1,1)]
2026-03-09 10:14:02 +0100 <lambdabot> [(1,1),(2,1),(3,1),(1,9),(2,9),(3,9)]
2026-03-09 10:14:12 +0100 <merijn> Magic
2026-03-09 10:15:17 +0100 <probie> > sortBy (comparing snd <> comparing (flip mod 2 . fst) <> comparing fst) [(3,9), (2,9), (1, 9), (3, 1), (2, 1), (1,1)]
2026-03-09 10:15:18 +0100 <lambdabot> [(2,1),(1,1),(3,1),(2,9),(1,9),(3,9)]
2026-03-09 10:15:55 +0100 <castan> that's wild, I need to play with it for a bit to understand how
2026-03-09 10:16:46 +0100 <merijn> Holy moly is Hackage being DOSed or something?
2026-03-09 10:16:49 +0100 <merijn> It's slow as sin
2026-03-09 10:17:17 +0100 <merijn> > sortBy (comparing snd <> comparing (Down . fst)) [(3,9), (2,9), (1, 9), (3, 1), (2, 1), (1,1)]
2026-03-09 10:17:19 +0100 <lambdabot> [(3,1),(2,1),(1,1),(3,9),(2,9),(1,9)]
2026-03-09 10:17:24 +0100 <merijn> Even funkier with newtypes like Down :p
2026-03-09 10:17:37 +0100fp(~Thunderbi@staff235.kora-dyn.aalto.fi) fp
2026-03-09 10:18:04 +0100fp(~Thunderbi@staff235.kora-dyn.aalto.fi) (Client Quit)
2026-03-09 10:18:08 +0100 <merijn> castan: Basically the monoid on functions is "if the final result is a monoid, then simply pass each argument to both functions and mappend the result"
2026-03-09 10:18:25 +0100fp(~Thunderbi@2001:708:20:1406::1370) fp
2026-03-09 10:18:48 +0100 <merijn> castan: "instance Monoid b => Monoid (a -> b) where mappend f g = \x -> mappend (f x) (g x)"
2026-03-09 10:19:36 +0100 <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 10:20:06 +0100 <merijn> :t comparing fst
2026-03-09 10:20:07 +0100 <lambdabot> Ord a => (a, b) -> (a, b) -> Ordering
2026-03-09 10:20:11 +0100 <merijn> :t comparing snd
2026-03-09 10:20:12 +0100 <lambdabot> Ord a1 => (a2, a1) -> (a2, a1) -> Ordering
2026-03-09 10:21:55 +0100 <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 10:22:57 +0100 <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 10:23:30 +0100 <castan> oh and then with <> you get a lexicographic order on the pairs
2026-03-09 10:23:56 +0100 <merijn> castan: lexicographic order on the whatever functions you pass to it
2026-03-09 10:24:04 +0100 <merijn> but yes
2026-03-09 10:24:35 +0100 <castan> this is really cool, thank you for the info
2026-03-09 10:24:53 +0100 <merijn> It's stupid powerful for trivially writing really complicated sorts
2026-03-09 10:25:56 +0100 <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 10:26:42 +0100 <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 10:27:55 +0100castan(~castan@2a02:2f0f:8210:d800:1625:20a6:66c:b041) (Quit: castan)
2026-03-09 10:29:23 +0100 <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 10:30:06 +0100 <merijn> Good to see that that code hasn't been maintained/updated for, like, 10 GHC releases now >.>
2026-03-09 10:34:53 +0100prdak(~Thunderbi@user/prdak) (Ping timeout: 272 seconds)
2026-03-09 10:37:49 +0100 <[exa]> is there a "strict" generic monoidal `fold` ?
2026-03-09 10:38:11 +0100 <[exa]> the docs recommend going for `foldMap' id` but that's not cute
2026-03-09 10:38:17 +0100 <[exa]> y no fold'
2026-03-09 10:38:55 +0100 <[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 10:39:42 +0100kuribas(~user@2a02-1810-2825-6000-46e-614f-97bf-a1c6.ip6.access.telenet.be) kuribas
2026-03-09 10:40:28 +0100 <kuribas> Is a lot of haskell code now also "vibecoded"?
2026-03-09 10:40:33 +0100 <kuribas> I noticed this PR: https://github.com/winterland1989/mysql-haskell/pull/72
2026-03-09 10:40:56 +0100 <kuribas> "Generated with Claude Code"
2026-03-09 10:42:48 +0100prdak(~Thunderbi@user/prdak) prdak
2026-03-09 10:43:12 +0100akegalj(~akegalj@246-221.dsl.iskon.hr) (Quit: leaving)
2026-03-09 10:43:39 +0100 <[exa]> kuribas: apparently even some haskell folks love to just pour code on stuff
2026-03-09 10:44:14 +0100 <kuribas> "catch (void (waitCommandReply tlsIs')) ((\ _ -> return ()) :: SomeException -> IO ())"
2026-03-09 10:45:01 +0100 <[exa]> it's for mysql so aesthetics arguments don't apply
2026-03-09 10:45:22 +0100 <kuribas> right :)
2026-03-09 10:45:38 +0100 <kuribas> Also "if isOK q then return () else decodeFromPacket q >>= throwIO . ERRException"
2026-03-09 10:45:47 +0100 <kuribas> Instead "unless (isOk q) $ ..."
2026-03-09 10:46:02 +0100 <[exa]> c'mon it's python encoded in haskell, newbie-friendly!
2026-03-09 10:46:07 +0100 <mesaoptimizer> lol
2026-03-09 10:46:34 +0100alinab(sid468903@id-468903.helmsley.irccloud.com) (Quit: Connection closed for inactivity)
2026-03-09 10:47:04 +0100 <[exa]> I found that particular issue to be an interesting thing to write into homework assignments
2026-03-09 10:48:15 +0100 <[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 10:51:04 +0100 <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 10:51:52 +0100 <kuribas> idris?
2026-03-09 10:53:02 +0100 <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 10:53:38 +0100 <mesaoptimizer> one could also make syntax-semantics combinations that are extremely alien to the LLM
2026-03-09 10:54:19 +0100 <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 10:54:59 +0100 <mesaoptimizer> (question is whether they will stay intuitive enough for programmers)
2026-03-09 11:25:45 +0100xff0x(~xff0x@fsb6a9491c.tkyc517.ap.nuro.jp) (Ping timeout: 248 seconds)
2026-03-09 11:28:49 +0100vgtw(~vgtw@user/vgtw) vgtw
2026-03-09 11:29:07 +0100 <merijn> [exa]: tbh, chatgpt seems to do much better with strongly typed code than other stuff imo
2026-03-09 11:32:10 +0100 <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 11:33:45 +0100 <merijn> newmind: I've mostly been using it with Scala, so not entirely sure how it does for HAskell
2026-03-09 11:34:03 +0100 <merijn> mesaoptimizer: I mean, that's just reinventing Epigram but unprincipled :p\
2026-03-09 11:35:18 +0100 <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 11:41:58 +0100dutchie(~dutchie@user/dutchie) (Remote host closed the connection)