Newest at the top
2025-09-11 10:12:14 +0200 | <[exa]> | interestingly all Only definitions in the packages are newtypes but Solo from base is `data` |
2025-09-11 10:10:47 +0200 | <tomsmeding> | :D |
2025-09-11 10:10:29 +0200 | <[exa]> | ^ lexical form of wtfface very relevant in this situation |
2025-09-11 10:10:09 +0200 | <[exa]> | O_o |
2025-09-11 10:09:41 +0200 | <lambdabot> | https://hackage.haskell.org/package/Only |
2025-09-11 10:09:41 +0200 | <tomsmeding> | @hackage Only |
2025-09-11 10:09:39 +0200 | <tomsmeding> | bastards |
2025-09-11 10:09:29 +0200 | <tomsmeding> | oh |
2025-09-11 10:09:25 +0200 | <lambdabot> | https://hackage.haskell.org/package/only |
2025-09-11 10:09:25 +0200 | <tomsmeding> | @hackage only |
2025-09-11 10:09:23 +0200 | <tomsmeding> | [exa]: Only was a library |
2025-09-11 10:09:17 +0200 | lbseale | (~quassel@user/ep1ctetus) (Ping timeout: 260 seconds) |
2025-09-11 10:09:17 +0200 | tremon | (~tremon@83.80.159.219) tremon |
2025-09-11 10:09:16 +0200 | <yahb2> | MkSolo 42 |
2025-09-11 10:09:16 +0200 | <tomsmeding> | % $(pure $ TH.TupE [Just (TH.LitE (TH.IntegerL 42))]) |
2025-09-11 10:09:05 +0200 | <[exa]> | also I recall it was called Only instd of Solo, kinda wondering what's the difference there |
2025-09-11 10:09:04 +0200 | <yahb2> | <no output> |
2025-09-11 10:09:04 +0200 | <tomsmeding> | % :seti -XTemplateHaskell |
2025-09-11 10:08:59 +0200 | <yahb2> | <no output> |
2025-09-11 10:08:59 +0200 | <tomsmeding> | % import qualified Language.Haskell.TH as TH |
2025-09-11 10:08:46 +0200 | <tomsmeding> | right |
2025-09-11 10:08:24 +0200 | <[exa]> | *1-tuples |
2025-09-11 10:08:17 +0200 | <[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 10:07:55 +0200 | merijn | (~merijn@77.242.116.146) merijn |
2025-09-11 10:07:19 +0200 | <[exa]> | tuplic consistency!!1 |
2025-09-11 10:07:04 +0200 | <tomsmeding> | also, what do you use 1-tuples for? |
2025-09-11 10:06:29 +0200 | <tomsmeding> | the resulting bugs were interesting |
2025-09-11 10:06:14 +0200 | <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 10:02:36 +0200 | <probie> | doesn't `Solo` exist? |
2025-09-11 10:01:11 +0200 | <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 10:00:47 +0200 | <dminuoso> | Very happy about it, too. |
2025-09-11 10:00:29 +0200 | <dminuoso> | Oh my. I found something that Python genuinely got right compared to Haskell: They have 1-tuples. |
2025-09-11 09:59:10 +0200 | CiaoSen | (~Jura@2a02:8071:64e1:da0:5a47:caff:fe78:33db) CiaoSen |
2025-09-11 09:56:32 +0200 | lortabac | (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4) |
2025-09-11 09:56:11 +0200 | <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 09:55:52 +0200 | merijn | (~merijn@77.242.116.146) (Ping timeout: 260 seconds) |
2025-09-11 09:55:46 +0200 | <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 09:55:11 +0200 | peterbecich | (~Thunderbi@syn-172-222-149-049.res.spectrum.com) (Ping timeout: 250 seconds) |
2025-09-11 09:53:49 +0200 | <tomsmeding> | (be sure to use ShortByteString, not ByteString, because the latter is pinned and that is complete overkill in this situation) |
2025-09-11 09:53:41 +0200 | <kqr> | I agree |
2025-09-11 09:53:22 +0200 | <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 09:52:35 +0200 | segfaultfizzbuzz | (~segfaultf@23-93-74-222.fiber.dynamic.sonic.net) (Ping timeout: 250 seconds) |
2025-09-11 09:51:16 +0200 | <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 09:49:52 +0200 | tzh | (~tzh@c-76-115-131-146.hsd1.or.comcast.net) (Quit: zzz) |
2025-09-11 09:48:49 +0200 | m1dnight_ | (~m1dnight@109.236.62.134) (Ping timeout: 255 seconds) |
2025-09-11 09:47:09 +0200 | <probie> | So unique cards held in hand is storable in a Word64. |
2025-09-11 09:45:14 +0200 | m1dnight | (~m1dnight@d8D861A17.access.telenet.be) m1dnight |
2025-09-11 09:44:06 +0200 | emmanuelux | (~emmanuelu@user/emmanuelux) (Read error: Connection reset by peer) |
2025-09-11 09:43:11 +0200 | chele | (~chele@user/chele) chele |
2025-09-11 09:42:48 +0200 | <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. |