Home liberachat/#haskell: Logs Calendar

Logs: liberachat/#haskell

←Prev  Next→ 1,804,210 events total
2025-08-28 14:13:01 arandombit joins (~arandombi@user/arandombit)
2025-08-28 14:15:48 Sgeo joins (~Sgeo@user/sgeo)
2025-08-28 14:15:59 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 260 seconds)
2025-08-28 14:20:05 × jocke-l quits (jocke-l@a.x0.is) (Server closed connection)
2025-08-28 14:20:30 jocke-l joins (jocke-l@a.x0.is)
2025-08-28 14:20:48 <absence> I'm playing with the singletons library, and trying to reify a Bool by pattern matching on "toSing boolValue". To my understanding, it returns "SomeSing (s :: Sing (b :: Bool))", but when I try to use pass @b to a function, I get "Could not deduce SomeConstraint b", even though both SomeConstraint 'True and SomeConstraint 'False are in scope. Clearly I'm missing a step, could someone point me in the
2025-08-28 14:20:54 <absence> right direction?
2025-08-28 14:26:35 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
2025-08-28 14:30:40 × Frostillicus quits (~Frostilli@pool-71-174-119-69.bstnma.fios.verizon.net) (Remote host closed the connection)
2025-08-28 14:31:02 Frostillicus joins (~Frostilli@pool-71-174-119-69.bstnma.fios.verizon.net)
2025-08-28 14:31:25 <Leary> absence: I don't know the details of the singletons library (since I tend to roll my own), but I imagine you want to case on `s`, refining `b` to `False` when `s` is `SFalse`, etc.
2025-08-28 14:31:44 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 260 seconds)
2025-08-28 14:34:07 davidlbowman joins (~dlb@user/davidlbowman)
2025-08-28 14:36:41 Unicorn_Princess joins (~Unicorn_P@user/Unicorn-Princess/x-3540542)
2025-08-28 14:36:46 trickard_ is now known as trickard
2025-08-28 14:37:08 × tromp quits (~textual@2001:1c00:3487:1b00:6941:8da5:79d5:ac1b) (Quit: My iMac has gone to sleep. ZZZzzz…)
2025-08-28 14:39:17 × __monty__ quits (~toonn@user/toonn) (Quit: leaving)
2025-08-28 14:41:36 Square2 joins (~Square@user/square)
2025-08-28 14:42:22 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
2025-08-28 14:45:44 × Square3 quits (~Square4@user/square) (Ping timeout: 260 seconds)
2025-08-28 14:46:37 × tbahne quits (~tbahne@user/tbahne) (Quit: tbahne)
2025-08-28 14:46:53 tbahne joins (~tbahne@user/tbahne)
2025-08-28 14:49:13 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 260 seconds)
2025-08-28 14:50:24 × arandombit quits (~arandombi@user/arandombit) (Ping timeout: 260 seconds)
2025-08-28 14:51:29 × tbahne quits (~tbahne@user/tbahne) (Ping timeout: 248 seconds)
2025-08-28 14:52:29 × hakutaku quits (~textual@chen.yukari.eu.org) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2025-08-28 14:52:51 machinedgod joins (~machinedg@d75-159-126-101.abhsia.telus.net)
2025-08-28 14:53:19 × Frostillicus quits (~Frostilli@pool-71-174-119-69.bstnma.fios.verizon.net) (Ping timeout: 260 seconds)
2025-08-28 14:56:01 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
2025-08-28 14:57:17 × vanishingideal quits (~vanishing@user/vanishingideal) (Remote host closed the connection)
2025-08-28 14:58:54 <absence> Leary: Do you mean pattern matching on STrue and SFalse, and manually passing @True and @False in each case?
2025-08-28 14:59:43 × tomboy64 quits (~tomboy64@user/tomboy64) (Ping timeout: 260 seconds)
2025-08-28 15:01:05 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds)
2025-08-28 15:01:26 Frostillicus joins (~Frostilli@pool-71-174-119-69.bstnma.fios.verizon.net)
2025-08-28 15:04:15 <Leary> That sounds like it should work, at least. You might want to factor things differently though, e.g. `instance SingI b => SomeConstraint b where ...`
2025-08-28 15:07:34 × Frostillicus quits (~Frostilli@pool-71-174-119-69.bstnma.fios.verizon.net) (Remote host closed the connection)
2025-08-28 15:07:52 mxs9 joins (~mxs@user/mxs)
2025-08-28 15:07:57 Frostillicus joins (~Frostilli@pool-71-174-119-69.bstnma.fios.verizon.net)
2025-08-28 15:10:46 <absence> Leary: In that case I don't need singletons at all, and can just pattern match on the Bool value directly, and match on True and False. I thought the idea was that singletons would let you avoid that kind of pattern match.
2025-08-28 15:11:43 Tuplanolla joins (~Tuplanoll@91-159-69-59.elisa-laajakaista.fi)
2025-08-28 15:11:49 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
2025-08-28 15:13:10 tomboy64 joins (~tomboy64@user/tomboy64)
2025-08-28 15:16:39 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 260 seconds)
2025-08-28 15:18:28 arandombit joins (~arandombi@user/arandombit)
2025-08-28 15:20:20 × lortabac quits (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4) (Quit: WeeChat 4.5.2)
2025-08-28 15:21:13 × ttybitnik quits (~ttybitnik@user/wolper) (Quit: Fading out...)
2025-08-28 15:21:19 × Frostillicus quits (~Frostilli@pool-71-174-119-69.bstnma.fios.verizon.net) (Ping timeout: 260 seconds)
2025-08-28 15:24:33 Frostillicus joins (~Frostilli@pool-71-174-119-69.bstnma.fios.verizon.net)
2025-08-28 15:24:56 <kuribas> absence: The right direction is to use idris2 once you start medling with singletons.
2025-08-28 15:25:08 <kuribas> absence: or write boring haskell :)
2025-08-28 15:25:11 <kuribas> absence: IMHO
2025-08-28 15:25:37 × arandombit quits (~arandombi@user/arandombit) (Ping timeout: 248 seconds)
2025-08-28 15:27:36 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
2025-08-28 15:29:50 tromp joins (~textual@2001:1c00:3487:1b00:6941:8da5:79d5:ac1b)
2025-08-28 15:29:57 × humasect quits (~humasect@dyn-192-249-132-90.nexicom.net) (Quit: Leaving...)
2025-08-28 15:30:19 gmg joins (~user@user/gehmehgeh)
2025-08-28 15:31:36 <geekosaur> absence, kuribas: strong agreement
2025-08-28 15:31:49 × Frostillicus quits (~Frostilli@pool-71-174-119-69.bstnma.fios.verizon.net) (Ping timeout: 260 seconds)
2025-08-28 15:32:59 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 260 seconds)
2025-08-28 15:33:52 × Googulator quits (~Googulato@2a01-036d-0106-28ad-d14e-68ce-c41e-4464.pool6.digikabel.hu) (Quit: Client closed)
2025-08-28 15:34:09 Googulator joins (~Googulato@2a01-036d-0106-28ad-d14e-68ce-c41e-4464.pool6.digikabel.hu)
2025-08-28 15:34:33 lightspell joins (~lightspel@dhcp-143-103-27-110.gobrightspeed.net)
2025-08-28 15:38:08 poscat joins (~poscat@user/poscat)
2025-08-28 15:39:30 × poscat0x04 quits (~poscat@user/poscat) (Ping timeout: 245 seconds)
2025-08-28 15:42:00 <absence> The ergonomics decrease quickly when using type-level stuff for sure...
2025-08-28 15:42:29 Frostillicus joins (~Frostilli@pool-71-174-119-69.bstnma.fios.verizon.net)
2025-08-28 15:43:24 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
2025-08-28 15:45:19 hakutaku joins (~textual@chen.yukari.eu.org)
2025-08-28 15:45:20 arandombit joins (~arandombi@2603:7000:4600:ffbe:2ca2:a28f:2f37:22f6)
2025-08-28 15:45:20 × arandombit quits (~arandombi@2603:7000:4600:ffbe:2ca2:a28f:2f37:22f6) (Changing host)
2025-08-28 15:45:20 arandombit joins (~arandombi@user/arandombit)
2025-08-28 15:47:45 × hakutaku quits (~textual@chen.yukari.eu.org) (Client Quit)
2025-08-28 15:48:43 × Googulator quits (~Googulato@2a01-036d-0106-28ad-d14e-68ce-c41e-4464.pool6.digikabel.hu) (Quit: Client closed)
2025-08-28 15:48:44 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 260 seconds)
2025-08-28 15:48:57 Googulator joins (~Googulato@2a01-036d-0106-28ad-d14e-68ce-c41e-4464.pool6.digikabel.hu)
2025-08-28 15:53:16 hakutaku joins (~textual@chen.yukari.eu.org)
2025-08-28 15:56:41 <geekosaur> haskell still doesn't have dependent types and (compared to languages that do) barely has a type level. singletons is IMO a horrible hack to try to get around this
2025-08-28 15:57:02 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
2025-08-28 15:57:03 <geekosaur> pretty much everything that uses Haskell with singletons should really be in Idris
2025-08-28 15:57:20 <geekosaur> except, of course, that Idris barely has an ecosystem
2025-08-28 15:57:37 × hakutaku quits (~textual@chen.yukari.eu.org) (Ping timeout: 248 seconds)
2025-08-28 16:02:08 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 260 seconds)
2025-08-28 16:08:34 × Googulator quits (~Googulato@2a01-036d-0106-28ad-d14e-68ce-c41e-4464.pool6.digikabel.hu) (Quit: Client closed)
2025-08-28 16:08:49 Googulator joins (~Googulato@2a01-036d-0106-28ad-d14e-68ce-c41e-4464.pool6.digikabel.hu)
2025-08-28 16:09:13 hakutaku joins (~textual@chen.yukari.eu.org)
2025-08-28 16:11:21 <lightspell> Hi, I'm learning Haskell by writing a simple card game. I'm using StateT to maintain the game state, and I'm using StatefulGen for randomly shuffling the deck when necessary. However, I can't figure out how to use both at the same time. Any chance someone could let me know what I'm doing wrong? I've made a simple version of the game to show the
2025-08-28 16:11:22 <lightspell> issue, with only the shuffle and draw logic: https://play.haskell.org/saved/SKCK9WHL
2025-08-28 16:12:48 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
2025-08-28 16:18:29 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 260 seconds)
2025-08-28 16:19:45 <absence> lightspell: You've hard coded the base monad to [] in GameState. Instead, you probably want something like "StatefulGen g m => StateT Game m a", i.e. StateT should sit on top of the StatefulGen. You could also use mtl, e.g. "(MonadState Game m, StatefulGen g m) => m a"
2025-08-28 16:19:53 lightspell10 joins (~lightspel@dhcp-143-103-27-110.gobrightspeed.net)
2025-08-28 16:20:08 × lightspell10 quits (~lightspel@dhcp-143-103-27-110.gobrightspeed.net) (Client Quit)
2025-08-28 16:20:24 lightspell1 joins (~lightspel@dhcp-143-103-27-110.gobrightspeed.net)
2025-08-28 16:21:19 <lightspell1> I included the rest of the code so it could run, but the main question is really just how to write a function like `shuffleDiscards`, which uses StatefulGen and StateT. The way I tried to write the type signature is `shuffleDiscards :: (StatefulGen g m) => PlayerId -> g -> m ()`, hoping that `m ()` would be equivalent to `StateT Game [] ()`, but
2025-08-28 16:21:19 <lightspell1> clearly I have no idea what I'm doing.
2025-08-28 16:22:56 <absence> lightspell1: Maybe you missed my message in the reconnect: You've hard coded the base monad to [] in GameState. Instead, you probably want something like "StatefulGen g m => StateT Game m a", i.e. StateT should sit on top of the StatefulGen. You could also use mtl, e.g. "(MonadState Game m, StatefulGen g m) => m a"
2025-08-28 16:23:11 <lightspell1> whoops, sorry got disconnected and somehow got assigned a new handle. Thanks for the hint!
2025-08-28 16:23:35 × lightspell quits (~lightspel@dhcp-143-103-27-110.gobrightspeed.net) (Ping timeout: 250 seconds)
2025-08-28 16:24:36 <lightspell1> That makes sense, thank you. I thought that somehow the StateT should already be wrapping the random generator, but I wasn't sure how.
2025-08-28 16:25:37 × Googulator quits (~Googulato@2a01-036d-0106-28ad-d14e-68ce-c41e-4464.pool6.digikabel.hu) (Quit: Client closed)

All times are in UTC.