Home liberachat/#haskell: Logs Calendar

Logs: liberachat/#haskell

←Prev  Next→ 1,799,469 events total
2026-02-05 09:55:03 tomsmeding was wondering why Complex doesn't have that instance, but it's magnitude computation in abs and signum
2026-02-05 09:55:11 <int-e> (if anybody ever makes a new Haskell derivative, `abs` and `signum` should be in their own class)
2026-02-05 09:55:22 <tomsmeding> yes, yet another reason for Num to be nonsense
2026-02-05 09:55:43 <tomsmeding> fromInteger also
2026-02-05 09:55:58 <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 09:56:06 <tomsmeding> I imagined yes
2026-02-05 10:00:08 × mjrosenb quits (~mjrosenb@pool-71-190-143-170.nycmny.fios.verizon.net) (Remote host closed the connection)
2026-02-05 10:01:47 <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 10:01:58 <int-e> tomsmeding: all my rings are unital ;)
2026-02-05 10:02:33 <int-e> (I don't usually mind fromInteger)
2026-02-05 10:02:36 <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 10:02:37 <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 10:04:19 akegalj joins (~akegalj@173-245.dsl.iskon.hr)
2026-02-05 10:04:33 <haskellbridge> <Liamzee> just out of curiosity, if Haskell had a program paying UGs to do FOSS work, would you be donating?
2026-02-05 10:04:34 <int-e> (it's a heap object; GC can move it)
2026-02-05 10:04:56 <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 10:05:08 <tomsmeding> probie: fair point, I guess
2026-02-05 10:05:45 <haskellbridge> <Liamzee> i wonder if we'll ever split num into ring subclasses
2026-02-05 10:06:03 <merijn> It's not happening
2026-02-05 10:06:08 <probie> tomsmeding: Just only allow square matrices, and then have `fromInteger` set the diagonal
2026-02-05 10:06:33 <merijn> Most proposed abstractions that are "more mathematically correct" tend to have really shit ergonomics for actual programming
2026-02-05 10:07:02 <int-e> tomsmeding: well you should only have square matrices of fixed size if you want a Num instance ;-)
2026-02-05 10:07:59 <haskellbridge> <Liamzee> merijin: I don't mean replace num, I mean, turn num into a superclass a la the FAM change
2026-02-05 10:08:56 <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 10:09:08 <tomsmeding> int-e: you shouldn't tag me there, you should tag probie, I've thought about this plenty :p
2026-02-05 10:09:30 <tomsmeding> oh you mean for (+)
2026-02-05 10:09:33 <tomsmeding> I do not care one whit
2026-02-05 10:09:51 <tomsmeding> if you want a num instance for arrays, you can have the matlab experience
2026-02-05 10:14:12 <int-e> tomsmeding: Sorry but I don't mind telling you things that you already know. :-P
2026-02-05 10:15:05 <tomsmeding> fair. :P
2026-02-05 10:17:01 haritz joins (~hrtz@140.228.70.141)
2026-02-05 10:17:01 × haritz quits (~hrtz@140.228.70.141) (Changing host)
2026-02-05 10:17:01 haritz joins (~hrtz@user/haritz)
2026-02-05 10:17:01 × xff0x quits (~xff0x@fsb6a9491c.tkyc517.ap.nuro.jp) (Ping timeout: 246 seconds)
2026-02-05 10:19:08 acidjnk joins (~acidjnk@p200300d6e700e57835d41376842fa308.dip0.t-ipconnect.de)
2026-02-05 10:27:31 × trickard_ quits (~trickard@cpe-61-98-47-163.wireline.com.au) (Read error: Connection reset by peer)
2026-02-05 10:27:38 bggd_ joins (~bgg@2a01:e0a:fd5:f510:45eb:593:20bc:aaf7)
2026-02-05 10:27:44 trickard_ joins (~trickard@cpe-61-98-47-163.wireline.com.au)
2026-02-05 10:31:28 <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 10:32:27 <dutchie> so my example would be [Right "A", Left "ring", Right "is a structure with", Left "compatible addition and multiplication"]
2026-02-05 10:36:58 × __monty__ quits (~toonn@user/toonn) (Quit: Lost terminal)
2026-02-05 10:41:33 <tomsmeding> dutchie: do you really need the restrictoin that there's at least one Right and at least one Left?
2026-02-05 10:41:46 <dutchie> morally yes, probably practically no
2026-02-05 10:41:49 <tomsmeding> no Right just sounds like a stupid cloze to me, not an invalid one
2026-02-05 10:41:56 <tomsmeding> and no Left the same
2026-02-05 10:42:16 × trickard_ quits (~trickard@cpe-61-98-47-163.wireline.com.au) (Read error: Connection reset by peer)
2026-02-05 10:42:19 <tomsmeding> data structures typically work better if they represent a "neat" space of the possibilities without edge-case restrictions
2026-02-05 10:42:26 <tomsmeding> if you want the edge-case restrictions, impose them from outside
2026-02-05 10:42:28 trickard_ joins (~trickard@cpe-61-98-47-163.wireline.com.au)
2026-02-05 10:42:29 <dutchie> I guess NonEmpty might be better at the very least
2026-02-05 10:42:39 <tomsmeding> possibly
2026-02-05 10:43:24 <tomsmeding> you can also consider a custom data type instead of Either, just to give the constructors more sensible names
2026-02-05 10:43:43 <dutchie> yeah I was definitely going to use something custom instead of Either
2026-02-05 10:44:16 <dutchie> I think I am mostly asking out of interest about how you'd do type construction to enforce something like that
2026-02-05 10:44:40 <dutchie> (especially since Strings can be empty anyway, which immediately works around the whole point)
2026-02-05 10:46:22 tomsmeding . o O ( NonEmpty Char )
2026-02-05 10:46:32 <tomsmeding> which is unergonomic as f*
2026-02-05 10:46:39 <dutchie> well I'm really using Text anyway
2026-02-05 10:46:44 <dutchie> and that
2026-02-05 10:47:05 <tomsmeding> really, having two Rights in a row is useless too, is it?
2026-02-05 10:47:58 <dutchie> true
2026-02-05 10:48:45 <tomsmeding> if you could require the whole thing to start and end with a Right, you could do an alternation thing
2026-02-05 10:48:48 <dutchie> I started trying to define some recursive list-like type
2026-02-05 10:48:56 <dutchie> yeah with alternation like that
2026-02-05 10:49:06 <tomsmeding> but if you want to allow '[gap] text [gap]' then it becomes really awkward
2026-02-05 10:51:53 × wootehfoot quits (~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer)
2026-02-05 10:52:48 <gentauro> tomsmeding: «completeness, /= is ≠» my bad. Yeah, I knew this -> `\neq in LaTeX` :(
2026-02-05 10:53:32 oskarw joins (~oskarw@user/oskarw)
2026-02-05 10:54:27 × trickard_ quits (~trickard@cpe-61-98-47-163.wireline.com.au) (Read error: Connection reset by peer)
2026-02-05 10:54:41 trickard_ joins (~trickard@cpe-61-98-47-163.wireline.com.au)
2026-02-05 10:54:58 <tomsmeding> or /not=
2026-02-05 10:55:02 <tomsmeding> \not=
2026-02-05 11:03:29 Enrico63 joins (~Enrico63@host-79-27-153-69.retail.telecomitalia.it)
2026-02-05 11:13:46 <haskellbridge> <loonycyborg> I'm honestly more used to != than to /=
2026-02-05 11:14:21 __monty__ joins (~toonn@user/toonn)
2026-02-05 11:15:44 <mesaoptimizer> MSR dropped support for GHC? Lol
2026-02-05 11:16:56 xff0x joins (~xff0x@2405:6580:b080:900:e31d:86a4:6d4e:db85)
2026-02-05 11:17:24 <mesaoptimizer> edwardk: why is ARIA doing category theory work in rust? I was under the impression that rust has too much friction to be anywhere useful for anything related to applied category theory
2026-02-05 11:18:45 <mesaoptimizer> jreicher: thanks, I'm already using haskell-mode and eglot, but haskell-mode seems finicky. I'll try haskell-ts-mode too I guess
2026-02-05 11:19:45 × wickedjargon quits (~user@2605:8d80:5431:3c2c:999d:e956:3913:d370) (Remote host closed the connection)
2026-02-05 11:30:08 × oskarw quits (~oskarw@user/oskarw) (Ping timeout: 256 seconds)
2026-02-05 11:30:19 × Enrico63 quits (~Enrico63@host-79-27-153-69.retail.telecomitalia.it) (Quit: Client closed)
2026-02-05 11:39:28 fp joins (~Thunderbi@89-27-10-140.bb.dnainternet.fi)
2026-02-05 11:41:35 × hellwolf quits (~user@eddf-7eb4-816a-bf6b-0f00-4d40-07d0-2001.sta.estpak.ee) (Remote host closed the connection)
2026-02-05 11:55:17 trickard_ is now known as trickard
2026-02-05 12:19:46 comerijn joins (~merijn@77.242.116.146)
2026-02-05 12:21:53 oskarw joins (~user@user/oskarw)
2026-02-05 12:22:14 Square3 joins (~Square4@user/square)
2026-02-05 12:22:49 × merijn quits (~merijn@77.242.116.146) (Ping timeout: 264 seconds)
2026-02-05 12:25:07 × Square2 quits (~Square@user/square) (Ping timeout: 246 seconds)
2026-02-05 12:26:33 × bggd_ quits (~bgg@2a01:e0a:fd5:f510:45eb:593:20bc:aaf7) (Quit: std::move)
2026-02-05 12:30:14 machinedgod joins (~machinedg@d75-159-126-101.abhsia.telus.net)
2026-02-05 12:31:06 × xff0x quits (~xff0x@2405:6580:b080:900:e31d:86a4:6d4e:db85) (Quit: xff0x)
2026-02-05 12:33:37 × chromoblob quits (~chromoblo@user/chromob1ot1c) (Ping timeout: 264 seconds)
2026-02-05 12:34:03 chromoblob joins (~chromoblo@user/chromob1ot1c)
2026-02-05 12:35:11 <oskarw> mesaoptimizer: I have some problems with using haskell-ts-mode inside cabal project, do you have additional commands inside haskell-ts-mode? [13:32]
2026-02-05 12:37:43 xff0x joins (~xff0x@2405:6580:b080:900:24e9:bd9c:7b25:9d4f)
2026-02-05 12:48:13 × oskarw quits (~user@user/oskarw) (Remote host closed the connection)
2026-02-05 12:49:26 oskarw joins (~user@user/oskarw)
2026-02-05 13:01:56 karenw joins (~karenw@user/karenw)

All times are in UTC.