2025/10/27

Newest at the top

2025-10-27 05:23:03 +0100 <hololeap> between that and `= Hashable a => NEHashSet (Hashed a) (HashSet a)`
2025-10-27 05:22:30 +0100 <hololeap> monochrom: what is the difference?
2025-10-27 05:20:15 +0100 <hololeap> that's actually a reason not to use GHC2021
2025-10-27 05:20:13 +0100 <monochrom> RankNTypes would be like "data N = N (forall a. Hashable a => ...)"
2025-10-27 05:20:05 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn
2025-10-27 05:19:34 +0100 <hololeap> I didn't think of GADTs
2025-10-27 05:19:13 +0100 <hololeap> I thought it was using RankNTypes and I wanted to make it explicit
2025-10-27 05:18:47 +0100 <monochrom> FWIW, it also means you don't need explicit RankNTypes :)
2025-10-27 05:18:29 +0100 <monochrom> :)
2025-10-27 05:18:22 +0100 <hololeap> oh... I have GHC2021 turned on
2025-10-27 05:17:51 +0100 <monochrom> Oh! It's equivalent to "data N a where N :: Hashable a => N (Hashed a) (HashSet a)". You're using GADTs.
2025-10-27 05:17:21 +0100 <hololeap> glguy: what is the difference between on the outside vs the inside?
2025-10-27 05:15:47 +0100 <hololeap> so the ordering doesn't really matter. I could do what jackdk says and then remove the inner Foldable constraint on the data type
2025-10-27 05:15:08 +0100 <hololeap> it's mostly to be able to use `all` and `any`
2025-10-27 05:14:49 +0100 <hololeap> Foldable doesn't make sense?
2025-10-27 05:13:03 +0100 <Leary> Yes, that's equivalent to `deriving Foldable`. Not that it really makes sense for unordered containers in the first place.
2025-10-27 05:12:23 +0100 <jackdk> Ah, you're correct. Nevertheless, you can define `toList` without constraints (`toList ha hsa = unhash ha : toList hsa`) and then `foldMap f = foldMap f . toList`
2025-10-27 05:09:22 +0100 <Leary> Uhh. I don't think that constraint is satisfiable without `instance Hashable a`.
2025-10-27 05:09:07 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 246 seconds)
2025-10-27 05:09:04 +0100 <hololeap> is that QuantifiedConstraints?
2025-10-27 05:08:51 +0100 <jackdk> the necessary extensions
2025-10-27 05:08:46 +0100 <jackdk> You can write the instance a `instance (forall a. Hashable a) => Foldable NonEmptyHashSet` if you turn on
2025-10-27 05:08:33 +0100 <hololeap> it carries two types that both assume Hashable: Hashed and HashSet
2025-10-27 05:08:13 +0100 <monochrom> Hrm, you need it.
2025-10-27 05:07:58 +0100 <jackdk> You're also asking for the caller to provide the `Hashable a` constraint while also carrying the same dictionary in the ctor
2025-10-27 05:07:44 +0100 <monochrom> I wonder if you actually need it.
2025-10-27 05:07:25 +0100 <hololeap> *every
2025-10-27 05:07:20 +0100 <hololeap> everything function in the module had a Hashable constraint before I added the constraint inside the data type
2025-10-27 05:06:07 +0100 <Leary> Since it means carrying the dictionary everywhere.
2025-10-27 05:05:51 +0100 <Leary> It's not inherently bad to put a constraint on a *constructor*, but it's something you ought to have a good reason for.
2025-10-27 05:05:36 +0100 <hololeap> Leary: my implentation of toList turns it into a HashSet first, but I could have turned it into a list a different way
2025-10-27 05:04:42 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn
2025-10-27 05:04:21 +0100 <Leary> hololeap: Couldn't it be `Foldable` regardless? In fact, you should be able to derive it.
2025-10-27 05:04:08 +0100 <glguy> the main one you were supposed to avoid was on the outside: data Ord a => T a = D
2025-10-27 05:01:27 +0100 <hololeap> foldable instance
2025-10-27 05:00:49 +0100 <hololeap> it let me make a Foldable type for NonEmptyHashSet
2025-10-27 05:00:32 +0100 <hololeap> I remember learning at one point that I should be discouraged from putting a constraint inside a data type, but it seems to be working really well here
2025-10-27 04:59:19 +0100 <hololeap> hi. I have a question about this code: https://bpa.st/3JY2S
2025-10-27 04:54:42 +0100synchromesh(~john@2406:5a00:2412:2c00:80f9:f3a2:4980:7e12) synchromesh
2025-10-27 04:54:14 +0100synchromesh(~john@2406:5a00:2412:2c00:5ca1:546e:8b5a:71bf) (Read error: Connection reset by peer)
2025-10-27 04:54:14 +0100dtman34(~dtman34@2601:447:d182:6512:c2f9:c3a:b83d:6490) dtman34
2025-10-27 04:53:19 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds)
2025-10-27 04:46:42 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn
2025-10-27 04:46:03 +0100td_(~td@i5387093E.versanet.de) td_
2025-10-27 04:44:08 +0100td_(~td@i53870936.versanet.de) (Ping timeout: 240 seconds)
2025-10-27 04:39:58 +0100chromoblob(~chromoblo@user/chromob1ot1c) chromoblob\0
2025-10-27 04:39:43 +0100chromoblob(~chromoblo@user/chromob1ot1c) (Ping timeout: 246 seconds)
2025-10-27 04:35:44 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 256 seconds)
2025-10-27 04:34:03 +0100dtman34(~dtman34@2601:447:d182:6512:c2f9:c3a:b83d:6490) (Ping timeout: 252 seconds)
2025-10-27 04:30:52 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn