2026/02/05

Newest at the top

2026-02-05 11:05:45 +0100 <haskellbridge> <Liamzee> i wonder if we'll ever split num into ring subclasses
2026-02-05 11:05:08 +0100 <tomsmeding> probie: fair point, I guess
2026-02-05 11:04:56 +0100 <tomsmeding> int-e: I don't mind having to define abs and signum for matrices, but fromInteger is a pain in the behind :)
2026-02-05 11:04:34 +0100 <int-e> (it's a heap object; GC can move it)
2026-02-05 11:04:33 +0100 <haskellbridge> <Liamzee> just out of curiosity, if Haskell had a program paying UGs to do FOSS work, would you be donating?
2026-02-05 11:04:19 +0100akegalj(~akegalj@173-245.dsl.iskon.hr) akegalj
2026-02-05 11:02:37 +0100 <merijn> Leary: The reason IORef doesn't support ordering is that it's equality is based on memory address, which you can't use for ordering, since it might change
2026-02-05 11:02:36 +0100 <probie> It's not basic programming knowledge that `product (3,4) = 4` (alright, technically that's `Foldable` not `Traversable`, but close enough
2026-02-05 11:02:33 +0100 <int-e> (I don't usually mind fromInteger)
2026-02-05 11:01:58 +0100 <int-e> tomsmeding: all my rings are unital ;)
2026-02-05 11:01:47 +0100 <probie> tomsmeding: Who needs a sane instance when you can have a useful instance. I don't really think that it's any worse than `instance Traversable ((,) a)`.
2026-02-05 11:00:08 +0100mjrosenb(~mjrosenb@pool-71-190-143-170.nycmny.fios.verizon.net) (Remote host closed the connection)
2026-02-05 10:56:06 +0100 <tomsmeding> I imagined yes
2026-02-05 10:55:58 +0100 <int-e> tomsmeding: In that context I wouldn't care about abs and signum so I'd use abs = id and signum 0 = 0, signum _ = 1
2026-02-05 10:55:43 +0100 <tomsmeding> fromInteger also
2026-02-05 10:55:22 +0100 <tomsmeding> yes, yet another reason for Num to be nonsense
2026-02-05 10:55:11 +0100 <int-e> (if anybody ever makes a new Haskell derivative, `abs` and `signum` should be in their own class)
2026-02-05 10:55:03 +0100tomsmedingwas wondering why Complex doesn't have that instance, but it's magnitude computation in abs and signum
2026-02-05 10:53:41 +0100 <tomsmeding> I think there's a good argument to be made for _not_ having that instance. I know floats are a mess anyway, but at least it's considered basic programming knowledge that ordering on floats is a mess
2026-02-05 10:53:39 +0100 <int-e> Eh half of the time I feel like using it I end up copying Complex anyway, so I can have instance Num a => Num (Complex a)
2026-02-05 10:53:11 +0100trickard_(~trickard@cpe-61-98-47-163.wireline.com.au)
2026-02-05 10:52:17 +0100 <Leary> Yes, that's what would be derived, and what we should have.
2026-02-05 10:51:36 +0100 <probie> Personally, I suggest `instance (Ord a) => Ord (Complex a) where compare (a :+ b) (c :+ d) = compare (a,b) (c,d)`
2026-02-05 10:50:16 +0100 <Leary> Yeah, `Ord` is (or has become) a class for types that support /some/ decidable total order, however arbitrary. `Complex` poses no issue whatsoever, but e.g `IORef` might---it supports equality testing but not ordering.
2026-02-05 10:47:41 +0100 <lambdabot> (fromList [(NaN,3),(NaN,4)],False)
2026-02-05 10:47:40 +0100 <probie> > let { nan = 0/(0 :: Double); m = M.fromList [(nan, 3), (nan, 4)] } in (m, nan `M.member` m)
2026-02-05 10:45:27 +0100 <probie> We're already going to hell for misusing `Ord`
2026-02-05 10:45:15 +0100tremon(~tremon@83.80.159.219) tremon
2026-02-05 10:45:06 +0100 <probie> Just pick an ordering on complex numbers and call it a day
2026-02-05 10:44:07 +0100trickard_(~trickard@cpe-61-98-47-163.wireline.com.au) (Read error: Connection reset by peer)
2026-02-05 10:43:03 +0100 <tomsmeding> gentauro: you probably already know this, but for completeness, /= is ≠
2026-02-05 10:42:50 +0100xff0x(~xff0x@fsb6a9491c.tkyc517.ap.nuro.jp)
2026-02-05 10:42:23 +0100trickard_(~trickard@cpe-61-98-47-163.wireline.com.au)
2026-02-05 10:42:10 +0100trickard(~trickard@cpe-61-98-47-163.wireline.com.au) (Read error: Connection reset by peer)
2026-02-05 10:40:32 +0100xff0x_(~xff0x@fsb6a9491c.tkyc517.ap.nuro.jp) (Quit: xff0x_)
2026-02-05 10:34:45 +0100 <gentauro> I might be wrong
2026-02-05 10:34:42 +0100 <gentauro> Googulator: I don't think we have complex numbers in SML (or derivates)
2026-02-05 10:29:32 +0100 <Googulator> Makes sense... if you're only thinking of real number and other intuitively sortable types. "Less than or greater than" is a downright lie e.g. for complex numbers.
2026-02-05 10:26:43 +0100gentaurowhich somehow makes sense. In HaskeLLM `/=` (division equals) is not that intuitive. That said, it took me like "ages" to realize `<>` xD
2026-02-05 10:25:18 +0100gentauroHmmm, I just realized that in SML (and derivates such as OCaml, …) the "not equal operator" (a <> b) states that `a > b` or `a < b`: https://smlhelp.github.io/book/docs/start/syntax/#boolean-operation
2026-02-05 10:19:49 +0100chele(~chele@user/chele) chele
2026-02-05 10:13:38 +0100trickard_trickard
2026-02-05 10:12:02 +0100sord937(~sord937@gateway/tor-sasl/sord937) sord937
2026-02-05 10:07:47 +0100merijn(~merijn@77.242.116.146) merijn
2026-02-05 10:00:18 +0100tzh(~tzh@c-76-115-131-146.hsd1.or.comcast.net) (Quit: zzz)
2026-02-05 09:43:09 +0100ouilemur(~jgmerritt@user/ouilemur) ouilemur
2026-02-05 09:42:29 +0100emmanuelux(~em@user/emmanuelux) (Quit: bye)
2026-02-05 09:41:25 +0100ouilemur(~jgmerritt@user/ouilemur) (Ping timeout: 250 seconds)
2026-02-05 09:30:19 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 264 seconds)
2026-02-05 09:27:07 +0100emmanuelux(~em@user/emmanuelux) emmanuelux