Logs: liberachat/#haskell
| 2021-06-10 13:36:29 | <jumper149> | ahhhhhh |
| 2021-06-10 13:36:32 | <jumper149> | now I see it |
| 2021-06-10 13:36:46 | × | wei2912 quits (~wei2912@112.199.250.21) (Quit: Lost terminal) |
| 2021-06-10 13:37:06 | <jumper149> | The argument of `atomically` would have type `STM (IO a)` |
| 2021-06-10 13:37:15 | <kritzefitz> | Right |
| 2021-06-10 13:37:33 | <kritzefitz> | And `join . atomically` turns it into `IO a`. |
| 2021-06-10 13:38:12 | <jumper149> | @src join |
| 2021-06-10 13:38:12 | <lambdabot> | join x = x >>= id |
| 2021-06-10 13:38:27 | <jumper149> | Isnt that still the same as using do-notation? |
| 2021-06-10 13:38:50 | → | jmcarthur joins (~jmcarthur@c-73-29-224-10.hsd1.nj.comcast.net) |
| 2021-06-10 13:39:12 | × | cheater quits (~Username@user/cheater) (Remote host closed the connection) |
| 2021-06-10 13:39:16 | <kritzefitz> | The same can be expressed in do-notation: `do { action <- atomically ...; action }`. |
| 2021-06-10 13:40:34 | <jumper149> | What I mean is: do { x <- atomically (readTVar v); case x of ... } |
| 2021-06-10 13:41:17 | <jumper149> | I don't see the difference to putting that lambda-case after atomically in your example |
| 2021-06-10 13:41:23 | → | derelict joins (~winter@2603-6011-f901-9e5b-78b5-8b2f-cdb2-4171.res6.spectrum.com) |
| 2021-06-10 13:41:28 | × | o1lo01ol_ quits (~o1lo01ol1@cpe-74-65-193-238.nyc.res.rr.com) (Remote host closed the connection) |
| 2021-06-10 13:41:29 | <kritzefitz> | Yes, my example was too simple. |
| 2021-06-10 13:41:31 | × | azeem quits (~azeem@176.200.245.34) (Read error: Connection reset by peer) |
| 2021-06-10 13:41:44 | → | azeem joins (~azeem@dynamic-adsl-94-34-34-125.clienti.tiscali.it) |
| 2021-06-10 13:42:10 | → | o1lo01ol1o joins (~o1lo01ol1@cpe-74-65-193-238.nyc.res.rr.com) |
| 2021-06-10 13:42:21 | <kritzefitz> | I'll paste a section from real code where I used this. |
| 2021-06-10 13:42:23 | → | eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:2121:a570:d35e:ba7a) |
| 2021-06-10 13:42:38 | <jumper149> | Ok very cool :) |
| 2021-06-10 13:43:22 | → | peterhil_ joins (~peterhil@mobile-access-bcee65-77.dhcp.inet.fi) |
| 2021-06-10 13:44:38 | → | yoctocell joins (~yoctocell@h87-96-130-155.cust.a3fiber.se) |
| 2021-06-10 13:44:59 | <kritzefitz> | jumper149, https://gitlab.com/Kritzefitz/reflex-gi-gtk/-/blob/next/src/Reflex/GI/Gtk/Run/Base.hs#L180 (Line 180). |
| 2021-06-10 13:45:28 | → | larkfisherman joins (~larkfishe@217.75.204.126) |
| 2021-06-10 13:45:54 | × | peterhil quits (~peterhil@dsl-hkibng32-54f849-252.dhcp.inet.fi) (Ping timeout: 245 seconds) |
| 2021-06-10 13:46:44 | × | eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:2121:a570:d35e:ba7a) (Ping timeout: 245 seconds) |
| 2021-06-10 13:46:49 | <kritzefitz> | There the resulting IO depends on the branching done by `orElse`. I can't do that after the transaction is finished. |
| 2021-06-10 13:47:58 | → | fendor__ joins (~fendor@212095005130.public.telering.at) |
| 2021-06-10 13:48:07 | → | Day1 joins (~Android@2a01cb06a02f03df0000005a611ae401.ipv6.abo.wanadoo.fr) |
| 2021-06-10 13:50:04 | × | benin03 quits (~benin@183.82.206.186) (Ping timeout: 272 seconds) |
| 2021-06-10 13:50:29 | × | fendor_ quits (~fendor@213142096031.public.telering.at) (Ping timeout: 245 seconds) |
| 2021-06-10 13:53:38 | → | boxscape joins (~boxscape@user/boxscape) |
| 2021-06-10 13:54:04 | × | Katarushisu quits (~Katarushi@cpc152083-finc20-2-0-cust170.4-2.cable.virginm.net) (Read error: Connection reset by peer) |
| 2021-06-10 13:54:22 | → | Katarushisu joins (~Katarushi@cpc152083-finc20-2-0-cust170.4-2.cable.virginm.net) |
| 2021-06-10 13:54:29 | × | Katarushisu quits (~Katarushi@cpc152083-finc20-2-0-cust170.4-2.cable.virginm.net) (Client Quit) |
| 2021-06-10 13:55:01 | <jumper149> | kritzefitz: That's some complicated piece of code ^^ |
| 2021-06-10 13:55:15 | → | Katarushisu joins (~Katarushi@cpc152083-finc20-2-0-cust170.4-2.cable.virginm.net) |
| 2021-06-10 13:56:43 | → | sayola joins (~vekto@dslc-082-082-145-205.pools.arcor-ip.net) |
| 2021-06-10 13:57:34 | × | dunkeln quits (~dunkeln@94.129.65.28) (Ping timeout: 245 seconds) |
| 2021-06-10 13:57:42 | <jumper149> | But I can see what you mean with the branching. |
| 2021-06-10 13:57:52 | × | o1lo01ol1o quits (~o1lo01ol1@cpe-74-65-193-238.nyc.res.rr.com) (Remote host closed the connection) |
| 2021-06-10 13:59:11 | × | chomwitt quits (~Pitsikoko@athedsl-20549.home.otenet.gr) (Quit: Leaving) |
| 2021-06-10 13:59:24 | → | chomwitt joins (~Pitsikoko@2a02:587:dc02:b00:98b0:cd42:bd6f:8295) |
| 2021-06-10 13:59:38 | → | o1lo01ol_ joins (~o1lo01ol1@cpe-74-65-193-238.nyc.res.rr.com) |
| 2021-06-10 14:00:23 | × | pgib quits (~textual@173.38.117.92) (Ping timeout: 244 seconds) |
| 2021-06-10 14:00:43 | <kritzefitz> | Yeah, that section is one of those places where FFI and concurrency bonded together to form the most complex code ever seen. |
| 2021-06-10 14:01:03 | × | chomwitt quits (~Pitsikoko@2a02:587:dc02:b00:98b0:cd42:bd6f:8295) (Read error: Connection reset by peer) |
| 2021-06-10 14:01:12 | → | chomwitt joins (~Pitsikoko@2a02:587:dc02:b00:98b0:cd42:bd6f:8295) |
| 2021-06-10 14:01:36 | → | jorjor joins (~jorgemene@85.251.190.6.dyn.user.ono.com) |
| 2021-06-10 14:01:54 | → | fluffyballoon joins (~fluffybal@2620:72:0:6480::10f7) |
| 2021-06-10 14:02:03 | <kritzefitz> | But the point is, with `x <- atomically ...; foo x` you have to decide before the transaction what `foo` will be. When you construct the `IO` in the transaction, you can push that decision to the very end of the transaction and still have all variables from the transaction at scope. |
| 2021-06-10 14:02:08 | <kritzefitz> | *in scope |
| 2021-06-10 14:02:24 | × | hendursa1 quits (~weechat@user/hendursaga) (Quit: hendursa1) |
| 2021-06-10 14:02:25 | → | eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:2121:a570:d35e:ba7a) |
| 2021-06-10 14:02:30 | <jumper149> | That puts it very nicely. |
| 2021-06-10 14:02:45 | → | hendursaga joins (~weechat@user/hendursaga) |
| 2021-06-10 14:05:03 | × | Torro quits (Torro@gateway/vpn/protonvpn/torro) (Quit: leaving) |
| 2021-06-10 14:05:51 | × | lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection) |
| 2021-06-10 14:06:44 | × | eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:2121:a570:d35e:ba7a) (Ping timeout: 245 seconds) |
| 2021-06-10 14:07:29 | → | Sgeo joins (~Sgeo@user/sgeo) |
| 2021-06-10 14:08:33 | → | mpt joins (~tom@2a02:908:1862:49e0::5) |
| 2021-06-10 14:08:49 | <ddellacosta> | is DerivingStrategies enabled by default when you use DerivingVia? I was going through this https://www.youtube.com/watch?v=UZaQuSIrO6s and I simply didn't need to include DerivingStrategies to be able to e.g. denote stock deriving or whatnot, so wondering why that is. I don't see it documented here https://downloads.haskell.org/~ghc/9.0.1/docs/html/users_guide/exts/deriving_via.html#deriving-via, although maybe I missed it |
| 2021-06-10 14:09:07 | → | jneira joins (~jneira@166.red-81-39-172.dynamicip.rima-tde.net) |
| 2021-06-10 14:10:08 | <ddellacosta> | or maybe the Implies thing at the top is telling me that? I wasn't sure |
| 2021-06-10 14:10:14 | <dminuoso> | ddellacosta: Itr says right there. Yes. |
| 2021-06-10 14:10:56 | <ddellacosta> | ah okay, so in general if I see "Implies" in the docs there, I can assume I don't need to explicitly import those extensions to use the extension I'm looking at? |
| 2021-06-10 14:11:08 | × | peterhil_ quits (~peterhil@mobile-access-bcee65-77.dhcp.inet.fi) (Ping timeout: 264 seconds) |
| 2021-06-10 14:11:10 | <jumper149> | ddellacosta: I would say yes. |
| 2021-06-10 14:11:17 | <jumper149> | GHC manual is very nice |
| 2021-06-10 14:11:22 | <ddellacosta> | okay, thanks folks |
| 2021-06-10 14:11:53 | → | peterhil joins (~peterhil@dsl-hkibng32-54f849-252.dhcp.inet.fi) |
| 2021-06-10 14:12:48 | → | dunkeln joins (~dunkeln@94.129.65.28) |
| 2021-06-10 14:13:12 | → | nsilv joins (~nsilv@212.103.198.210) |
| 2021-06-10 14:13:22 | × | jmcarthur quits (~jmcarthur@c-73-29-224-10.hsd1.nj.comcast.net) (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
| 2021-06-10 14:14:06 | → | wallymathieu joins (~wallymath@81-234-151-21-no94.tbcn.telia.com) |
| 2021-06-10 14:14:20 | × | jumper149 quits (~jumper149@80.240.31.34) (Quit: WeeChat 3.1) |
| 2021-06-10 14:16:07 | × | fendor__ quits (~fendor@212095005130.public.telering.at) (Remote host closed the connection) |
| 2021-06-10 14:17:08 | → | fendor_ joins (~fendor@212095005130.public.telering.at) |
| 2021-06-10 14:17:24 | → | fendor__ joins (~fendor@212095005130.public.telering.at) |
| 2021-06-10 14:18:04 | × | fendor__ quits (~fendor@212095005130.public.telering.at) (Client Quit) |
| 2021-06-10 14:20:04 | × | azeem quits (~azeem@dynamic-adsl-94-34-34-125.clienti.tiscali.it) (Ping timeout: 245 seconds) |
| 2021-06-10 14:20:04 | × | o1lo01ol_ quits (~o1lo01ol1@cpe-74-65-193-238.nyc.res.rr.com) (Remote host closed the connection) |
| 2021-06-10 14:20:46 | → | azeem joins (~azeem@176.201.14.251) |
| 2021-06-10 14:21:40 | × | v01d4lph4 quits (~v01d4lph4@user/v01d4lph4) (Remote host closed the connection) |
| 2021-06-10 14:22:14 | → | v01d4lph4 joins (~v01d4lph4@user/v01d4lph4) |
| 2021-06-10 14:22:38 | → | xkuru joins (~xkuru@user/xkuru) |
| 2021-06-10 14:23:44 | × | Day1 quits (~Android@2a01cb06a02f03df0000005a611ae401.ipv6.abo.wanadoo.fr) (Read error: Connection reset by peer) |
| 2021-06-10 14:25:25 | × | azeem quits (~azeem@176.201.14.251) (Ping timeout: 268 seconds) |
| 2021-06-10 14:26:22 | → | azeem joins (~azeem@176.201.37.85) |
| 2021-06-10 14:26:39 | × | waleee quits (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 268 seconds) |
| 2021-06-10 14:26:44 | × | v01d4lph4 quits (~v01d4lph4@user/v01d4lph4) (Ping timeout: 264 seconds) |
| 2021-06-10 14:26:50 | → | eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:2121:a570:d35e:ba7a) |
| 2021-06-10 14:28:55 | o | is now known as niko |
| 2021-06-10 14:30:20 | × | geekosaur quits (~geekosaur@069-135-003-034.biz.spectrum.com) (Remote host closed the connection) |
| 2021-06-10 14:30:25 | → | zebrag joins (~chris@user/zebrag) |
| 2021-06-10 14:30:58 | → | fendor__ joins (~fendor@77.119.128.226.wireless.dyn.drei.com) |
| 2021-06-10 14:31:09 | → | geekosaur joins (~geekosaur@069-135-003-034.biz.spectrum.com) |
All times are in UTC.