2026/02/05

Newest at the top

2026-02-05 11:42:29 +0100 <dutchie> I guess NonEmpty might be better at the very least
2026-02-05 11:42:28 +0100trickard_(~trickard@cpe-61-98-47-163.wireline.com.au)
2026-02-05 11:42:26 +0100 <tomsmeding> if you want the edge-case restrictions, impose them from outside
2026-02-05 11:42:19 +0100 <tomsmeding> data structures typically work better if they represent a "neat" space of the possibilities without edge-case restrictions
2026-02-05 11:42:16 +0100trickard_(~trickard@cpe-61-98-47-163.wireline.com.au) (Read error: Connection reset by peer)
2026-02-05 11:41:56 +0100 <tomsmeding> and no Left the same
2026-02-05 11:41:49 +0100 <tomsmeding> no Right just sounds like a stupid cloze to me, not an invalid one
2026-02-05 11:41:46 +0100 <dutchie> morally yes, probably practically no
2026-02-05 11:41:33 +0100 <tomsmeding> dutchie: do you really need the restrictoin that there's at least one Right and at least one Left?
2026-02-05 11:36:58 +0100__monty__(~toonn@user/toonn) (Quit: Lost terminal)
2026-02-05 11:32:27 +0100 <dutchie> so my example would be [Right "A", Left "ring", Right "is a structure with", Left "compatible addition and multiplication"]
2026-02-05 11:31:28 +0100 <dutchie> hmm, how could I encode a cloze deletion thing (i.e. fill-in-the-blanks "a [ring] is structure with [compatible addition and multiplication]") as a Haskell data type. first thought would be [Either String String] where Left is deleted text and Right is plain but that doesn't encode "at least one left and one right in some order"
2026-02-05 11:27:44 +0100trickard_(~trickard@cpe-61-98-47-163.wireline.com.au)
2026-02-05 11:27:38 +0100bggd_(~bgg@2a01:e0a:fd5:f510:45eb:593:20bc:aaf7)
2026-02-05 11:27:31 +0100trickard_(~trickard@cpe-61-98-47-163.wireline.com.au) (Read error: Connection reset by peer)
2026-02-05 11:19:08 +0100acidjnk(~acidjnk@p200300d6e700e57835d41376842fa308.dip0.t-ipconnect.de) acidjnk
2026-02-05 11:17:01 +0100xff0x(~xff0x@fsb6a9491c.tkyc517.ap.nuro.jp) (Ping timeout: 246 seconds)
2026-02-05 11:17:01 +0100haritz(~hrtz@user/haritz) haritz
2026-02-05 11:17:01 +0100haritz(~hrtz@140.228.70.141) (Changing host)
2026-02-05 11:17:01 +0100haritz(~hrtz@140.228.70.141)
2026-02-05 11:15:05 +0100 <tomsmeding> fair. :P
2026-02-05 11:14:12 +0100 <int-e> tomsmeding: Sorry but I don't mind telling you things that you already know. :-P
2026-02-05 11:09:51 +0100 <tomsmeding> if you want a num instance for arrays, you can have the matlab experience
2026-02-05 11:09:33 +0100 <tomsmeding> I do not care one whit
2026-02-05 11:09:30 +0100 <tomsmeding> oh you mean for (+)
2026-02-05 11:09:08 +0100 <tomsmeding> int-e: you shouldn't tag me there, you should tag probie, I've thought about this plenty :p
2026-02-05 11:08:56 +0100 <int-e> (Smiley because I'm not sure that I'd heed that advice myself. Convenience is worth a lot of compromises...)
2026-02-05 11:07:59 +0100 <haskellbridge> <Liamzee> merijin: I don't mean replace num, I mean, turn num into a superclass a la the FAM change
2026-02-05 11:07:02 +0100 <int-e> tomsmeding: well you should only have square matrices of fixed size if you want a Num instance ;-)
2026-02-05 11:06:33 +0100 <merijn> Most proposed abstractions that are "more mathematically correct" tend to have really shit ergonomics for actual programming
2026-02-05 11:06:08 +0100 <probie> tomsmeding: Just only allow square matrices, and then have `fromInteger` set the diagonal
2026-02-05 11:06:03 +0100 <merijn> It's not happening
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