2026/01/08

Newest at the top

2026-01-08 23:15:24 +0100 <TMA> tomsmeding: I have encountered ring definition containing the axiom 0!=1 as well
2026-01-08 23:15:20 +0100tomsmedingdoesn't follow; doesn't that assume a*0 = 0 from the get go?
2026-01-08 23:14:36 +0100 <monochrom> for all b, b*(a*0) = (b*a)*0 = 0. Then appeal to uniqueness of 0: "if forall b b*foo=0, then foo=0"
2026-01-08 23:14:24 +0100xff0x_(~xff0x@2405:6580:b080:900:cd9:802b:8b60:b254)
2026-01-08 23:11:33 +0100 <tomsmeding> (and 0 = a * 0 because: 0 = 1 + -1 = a * a^-1 + -1 = a * (0 + a^-1) + -1 = a * 0 + a * a^-1 + -1 = a * 0 + 1 + -1 = a * 0 + 0 = a * 0; there's probably a simpler derivation lol)
2026-01-08 23:11:19 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-01-08 23:08:10 +0100 <haskellbridge> <loonycyborg> you can even divide by zero in this ring
2026-01-08 23:07:12 +0100 <tomsmeding> if 1 = 0 then by the ring axioms, 0 = 0 * a = 1 * a = a, so all elements are zero, so it's the trivial ring, but it's allowed
2026-01-08 23:06:49 +0100danz94513(~danza@user/danza) (Ping timeout: 246 seconds)
2026-01-08 23:05:30 +0100 <EvanR> though we have good examples where they are, in crypto code
2026-01-08 23:05:21 +0100 <monochrom> I agree.
2026-01-08 23:04:37 +0100danza(~danza@user/danza) danza
2026-01-08 23:04:37 +0100 <EvanR> this whole time I was convinced that Num reflects a subcultural understanding of computer numbers and programmers are not usually thinking they're using a ring
2026-01-08 23:04:32 +0100malte(~malte@mal.tc) malte
2026-01-08 23:04:26 +0100 <geekosaur> they're allowed to be the same… if there's only one value in the set
2026-01-08 23:03:39 +0100 <EvanR> and a law saying they must be different? xD
2026-01-08 23:03:31 +0100 <EvanR> zero and one
2026-01-08 23:03:09 +0100malte(~malte@mal.tc) (Ping timeout: 250 seconds)
2026-01-08 23:00:58 +0100vanishingideal(~vanishing@user/vanishingideal) vanishingideal
2026-01-08 23:00:43 +0100Googulator82Googulator
2026-01-08 22:59:19 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds)
2026-01-08 22:50:51 +0100 <Leary> monochrom: But sometimes that's the correct implementation. :)
2026-01-08 22:50:25 +0100 <monochrom> You need a law to outlaw me trying "foldMap _ _ = mempty".
2026-01-08 22:50:18 +0100 <Leary> Re `Num`, `abs` and `signum` should be moved to another class, and arguably `fromInteger` too (necessitating new `zero` and `one` methods). The rest could do to be split up or factored over `Monoid`, but it's otherwise fine and perfectly principled as a class for rings.
2026-01-08 22:48:46 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-01-08 22:43:58 +0100 <Leary> `Foldable` just doesn't need laws, since the type of `foldMap` and parametricity say it all.
2026-01-08 22:43:18 +0100 <mauke> comfortably Num
2026-01-08 22:42:33 +0100 <EvanR> at some point you heard a lot of Foldable has no laws, Foldable is essentially a place to put your toList function
2026-01-08 22:42:02 +0100peterbecich(~Thunderbi@71.84.33.135) peterbecich
2026-01-08 22:41:43 +0100 <tomsmeding> I've ranted about Num before here
2026-01-08 22:41:23 +0100 <tomsmeding> so that's a low bar
2026-01-08 22:41:21 +0100 <EvanR> most things people try to write a Num instance for are contrived xD
2026-01-08 22:41:19 +0100 <tomsmeding> Num was never principled or based in any way
2026-01-08 22:41:08 +0100 <EvanR> (curiously) Foldable ended up being more principled and based than Num
2026-01-08 22:40:32 +0100 <tomsmeding> but contrary to Foldable, where [a] is merely a common instance, such contrived Num instances are really contrived, I'd guess
2026-01-08 22:40:09 +0100 <tomsmeding> there are probably contrived Num instances for which foldl' would be inappropriate
2026-01-08 22:40:04 +0100 <EvanR> a long time ago
2026-01-08 22:39:44 +0100 <EvanR> maybe, but there was a long thread on the mailing list defending the foldl version xD
2026-01-08 22:39:09 +0100 <tomsmeding> that one was probably just an oversight
2026-01-08 22:38:35 +0100 <jreicher> Oww. How did that happen in the first place?
2026-01-08 22:38:33 +0100 <EvanR> good
2026-01-08 22:38:25 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 264 seconds)
2026-01-08 22:38:08 +0100 <tomsmeding> it is, but that was fixed; sum is now defined using foldl'
2026-01-08 22:36:26 +0100trickard_trickard
2026-01-08 22:36:25 +0100 <EvanR> this is probably dumb
2026-01-08 22:36:08 +0100 <lambdabot> sum = foldl (+) 0
2026-01-08 22:36:08 +0100 <EvanR> @src sum
2026-01-08 22:36:03 +0100 <EvanR> however the situation with sum
2026-01-08 22:34:48 +0100spew(~spew@user/spew) (Quit: nyaa~)
2026-01-08 22:34:01 +0100Milan_Vanca(~milan@user/Milan-Vanca:32634) (Quit: WeeChat 4.7.2)