Home liberachat/#haskell: Logs Calendar

Logs: liberachat/#haskell

←Prev  Next→ 1,804,071 events total
2025-09-11 06:45:30 chromoblob joins (~chromoblo@user/chromob1ot1c)
2025-09-11 06:45:41 hiredman joins (~hiredman@frontier1.downey.family)
2025-09-11 06:45:52 × chromoblob quits (~chromoblo@user/chromob1ot1c) (Read error: Connection reset by peer)
2025-09-11 06:46:15 chromoblob joins (~chromoblo@user/chromob1ot1c)
2025-09-11 06:49:45 jcarpenter2 joins (~lol@2603:3016:1e01:b980:50d7:d756:5d4d:269d)
2025-09-11 06:50:53 segfaultfizzbuzz joins (~segfaultf@23-93-74-222.fiber.dynamic.sonic.net)
2025-09-11 06:51:13 × Guest59 quits (~Guest59@205.254.174.179) (Quit: Client closed)
2025-09-11 06:51:39 <kqr> tomsmeding, you know, I might be able to un-duplicate a few of the duplicate cards by adding spurious information that doesn't affect the game. however, it's still going to be over 100 cards, so 64 bits are not enough.
2025-09-11 06:53:00 × chromoblob quits (~chromoblo@user/chromob1ot1c) (Ping timeout: 256 seconds)
2025-09-11 06:53:42 × ft quits (~ft@p4fc2a25a.dip0.t-ipconnect.de) (Quit: leaving)
2025-09-11 06:54:03 <kqr> tomsmeding, I'm thinking of two possible avenues forward, both representing a card with a Word8. either keeping the possibility of duplicates and storing hands as short bytestrings... or setting some extra bits, making the conditionals more complicated, and trying to store them in an intset
2025-09-11 06:54:31 peterbecich joins (~Thunderbi@syn-172-222-149-049.res.spectrum.com)
2025-09-11 06:58:45 tromp joins (~textual@2001:1c00:3487:1b00:4ca2:8197:56e4:708)
2025-09-11 06:59:57 × karenw_ quits (~karenw@user/karenw) (Quit: Deep into that darkness peering...)
2025-09-11 07:00:03 × caconym747 quits (~caconym@user/caconym) (Quit: bye)
2025-09-11 07:00:44 caconym747 joins (~caconym@user/caconym)
2025-09-11 07:02:24 sord937 joins (~sord937@gateway/tor-sasl/sord937)
2025-09-11 07:03:24 merijn joins (~merijn@77.242.116.146)
2025-09-11 07:07:55 <probie> kqr: What is the maximum number of cards in a hand, the maximum number of distinct cards and that maximum number of duplicates?
2025-09-11 07:08:05 <probie> s/that maximum/the maximum/
2025-09-11 07:27:22 ubert joins (~Thunderbi@178.165.191.145.wireless.dyn.drei.com)
2025-09-11 07:28:56 acidjnk joins (~acidjnk@p200300d6e7171926a81168b3bd2506b7.dip0.t-ipconnect.de)
2025-09-11 07:32:53 × robobub quits (uid248673@id-248673.uxbridge.irccloud.com) (Quit: Connection closed for inactivity)
2025-09-11 07:33:15 mari-estel joins (~mari-este@user/mari-estel)
2025-09-11 07:38:34 gmg joins (~user@user/gehmehgeh)
2025-09-11 07:42:48 <kqr> probie, maximum number of cards in a hand is theoretically just over 50, but that rarely happens in practice. just over half of them can be duplicates (almost all cards exist in pairs, some in quadruples). but all 50 in a hand could also be distinct.
2025-09-11 07:43:11 chele joins (~chele@user/chele)
2025-09-11 07:44:06 × emmanuelux quits (~emmanuelu@user/emmanuelux) (Read error: Connection reset by peer)
2025-09-11 07:45:14 m1dnight joins (~m1dnight@d8D861A17.access.telenet.be)
2025-09-11 07:47:09 <probie> So unique cards held in hand is storable in a Word64.
2025-09-11 07:48:49 × m1dnight_ quits (~m1dnight@109.236.62.134) (Ping timeout: 255 seconds)
2025-09-11 07:49:52 × tzh quits (~tzh@c-76-115-131-146.hsd1.or.comcast.net) (Quit: zzz)
2025-09-11 07:51:16 <probie> If we assume 52 distinct cards with maximally 4 copies of each, there is a pretty naive representation that fits into 4 `Word64`s
2025-09-11 07:52:35 × segfaultfizzbuzz quits (~segfaultf@23-93-74-222.fiber.dynamic.sonic.net) (Ping timeout: 250 seconds)
2025-09-11 07:53:22 <tomsmeding> at that point you're 4*8 = 32 bytes in though, and it's not fully clear whether that's better than a ShortByteString of length ~15 (one byte per card in hand)
2025-09-11 07:53:41 <kqr> I agree
2025-09-11 07:53:49 <tomsmeding> (be sure to use ShortByteString, not ByteString, because the latter is pinned and that is complete overkill in this situation)
2025-09-11 07:55:11 × peterbecich quits (~Thunderbi@syn-172-222-149-049.res.spectrum.com) (Ping timeout: 250 seconds)
2025-09-11 07:55:46 <tomsmeding> also the 4-Word64 representation is not naturally canonical; if you remove a card from the hand, either you now have to deal with duplicates living in unpredictable Word64s, or you have to explicitly normalise the bits to the left-most Word64s or something
2025-09-11 07:55:52 × merijn quits (~merijn@77.242.116.146) (Ping timeout: 260 seconds)
2025-09-11 07:56:11 <tomsmeding> the solution is clearly to just model a different game where duplicates are not a thing and use a single Word64
2025-09-11 07:56:32 lortabac joins (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4)
2025-09-11 07:59:10 CiaoSen joins (~Jura@2a02:8071:64e1:da0:5a47:caff:fe78:33db)
2025-09-11 08:00:29 <dminuoso> Oh my. I found something that Python genuinely got right compared to Haskell: They have 1-tuples.
2025-09-11 08:00:47 <dminuoso> Very happy about it, too.
2025-09-11 08:01:11 <dminuoso> (Except the moments you accidentally create them, they they are annoying due to lack of a functional type system, but hey you cant have everything)
2025-09-11 08:02:36 <probie> doesn't `Solo` exist?
2025-09-11 08:06:14 <tomsmeding> dminuoso: a friend of mine has somehow accidentally ended up with a comma at the end of a line multiple times
2025-09-11 08:06:29 <tomsmeding> the resulting bugs were interesting
2025-09-11 08:07:04 <tomsmeding> also, what do you use 1-tuples for?
2025-09-11 08:07:19 <[exa]> tuplic consistency!!1
2025-09-11 08:07:55 merijn joins (~merijn@77.242.116.146)
2025-09-11 08:08:17 <[exa]> the only good use I found for tuples was with DB-ish and CSV-ish frontends, there it nicely says that the thing is a row not just a piece of data
2025-09-11 08:08:24 <[exa]> *1-tuples
2025-09-11 08:08:46 <tomsmeding> right
2025-09-11 08:08:59 <tomsmeding> % import qualified Language.Haskell.TH as TH
2025-09-11 08:08:59 <yahb2> <no output>
2025-09-11 08:09:04 <tomsmeding> % :seti -XTemplateHaskell
2025-09-11 08:09:04 <yahb2> <no output>
2025-09-11 08:09:05 <[exa]> also I recall it was called Only instd of Solo, kinda wondering what's the difference there
2025-09-11 08:09:16 <tomsmeding> % $(pure $ TH.TupE [Just (TH.LitE (TH.IntegerL 42))])
2025-09-11 08:09:16 <yahb2> MkSolo 42
2025-09-11 08:09:17 tremon joins (~tremon@83.80.159.219)
2025-09-11 08:09:17 × lbseale quits (~quassel@user/ep1ctetus) (Ping timeout: 260 seconds)
2025-09-11 08:09:23 <tomsmeding> [exa]: Only was a library
2025-09-11 08:09:25 <tomsmeding> @hackage only
2025-09-11 08:09:25 <lambdabot> https://hackage.haskell.org/package/only
2025-09-11 08:09:29 <tomsmeding> oh
2025-09-11 08:09:39 <tomsmeding> bastards
2025-09-11 08:09:41 <tomsmeding> @hackage Only
2025-09-11 08:09:41 <lambdabot> https://hackage.haskell.org/package/Only
2025-09-11 08:10:09 <[exa]> O_o
2025-09-11 08:10:29 <[exa]> ^ lexical form of wtfface very relevant in this situation
2025-09-11 08:10:47 <tomsmeding> :D
2025-09-11 08:12:14 <[exa]> interestingly all Only definitions in the packages are newtypes but Solo from base is `data`
2025-09-11 08:13:41 <[exa]> which kinda makes sense for more consistency with tuples I guess, the actual workalike of the newtypish Only in base would rather be `Identity` then
2025-09-11 08:13:46 × merijn quits (~merijn@77.242.116.146) (Ping timeout: 256 seconds)
2025-09-11 08:13:52 <tomsmeding> [exa]: this one isn't https://hackage.haskell.org/package/OneTuple-0.4.1.1/docs/Data-Tuple-Solo.html
2025-09-11 08:14:03 <tomsmeding> I had this one in mind actually but forgot that it wasn't called Only
2025-09-11 08:15:17 merijn joins (~merijn@77.242.116.146)
2025-09-11 08:15:22 <[exa]> that looks kinda isomorphic to the one from base actually
2025-09-11 08:16:27 <tomsmeding> it's meant to, it's a compatibility package
2025-09-11 08:17:23 Square3 joins (~Square4@user/square)
2025-09-11 08:17:37 segfaultfizzbuzz joins (~segfaultf@23-93-74-222.fiber.dynamic.sonic.net)
2025-09-11 08:17:41 <[exa]> ok tuplic consistency has been reached
2025-09-11 08:21:50 × segfaultfizzbuzz quits (~segfaultf@23-93-74-222.fiber.dynamic.sonic.net) (Ping timeout: 258 seconds)
2025-09-11 08:34:08 × Sgeo_ quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer)
2025-09-11 08:35:10 × img quits (~img@user/img) (Quit: ZNC 1.8.2 - https://znc.in)
2025-09-11 08:36:26 img joins (~img@user/img)
2025-09-11 08:39:05 × merijn quits (~merijn@77.242.116.146) (Ping timeout: 258 seconds)
2025-09-11 08:45:35 merijn joins (~merijn@77.242.116.146)
2025-09-11 08:51:20 segfaultfizzbuzz joins (~segfaultf@23-93-74-222.fiber.dynamic.sonic.net)
2025-09-11 08:55:45 × segfaultfizzbuzz quits (~segfaultf@23-93-74-222.fiber.dynamic.sonic.net) (Ping timeout: 248 seconds)
2025-09-11 09:05:03 haritz joins (~hrtz@2a01:4b00:bc2e:7000:d5af:a266:ca31:5ef8)
2025-09-11 09:05:03 × haritz quits (~hrtz@2a01:4b00:bc2e:7000:d5af:a266:ca31:5ef8) (Changing host)
2025-09-11 09:05:03 haritz joins (~hrtz@user/haritz)
2025-09-11 09:07:36 <Square3> I'm thinking I could generate .proto files from a big domain model using template haskell. But I wonder 1) is this a sane usecase for TH 2) Are there some best practice / support for generating things other than haskell code with TH?
2025-09-11 09:18:11 <dminuoso> tomsmeding: Well what do people use 1-element lists for?
2025-09-11 09:18:48 <dminuoso> probie: Sure I mean there is things isomorphic to it, but thats not quite the same.
2025-09-11 09:18:58 <dminuoso> Say you have some typeclass machinery that works over n-tuples.

All times are in UTC.