Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2021-04-07 13:09:51 <ADG1089> is prof binaries slower if i don't pass RTS args?
2021-04-07 13:10:08 × v01d4lph4 quits (~v01d4lph4@223.177.183.124) (Remote host closed the connection)
2021-04-07 13:10:15 <ADG1089> I think this is the case, just wanted to confirm
2021-04-07 13:10:38 <geekosaur> perf disables most optimizations because they'd interfere with profiling, yes
2021-04-07 13:10:58 × stree quits (~stree@68.36.8.116) (Ping timeout: 260 seconds)
2021-04-07 13:12:25 royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9)
2021-04-07 13:15:27 feb6 joins (67cb4855@103.203.72.85)
2021-04-07 13:15:51 <feb6> Hey
2021-04-07 13:17:58 <geekosaur> hello
2021-04-07 13:19:29 × feb6 quits (67cb4855@103.203.72.85) (Client Quit)
2021-04-07 13:22:37 dhouthoo joins (~dhouthoo@ptr-eitgbj2w0uu6delkbrh.18120a2.ip6.access.telenet.be)
2021-04-07 13:23:35 stree joins (~stree@68.36.8.116)
2021-04-07 13:24:37 barthandelous joins (~cbrzezins@2600:1007:b01a:85d2:6685:eca8:992:2c72)
2021-04-07 13:25:23 <merijn> ADG1089: They don't have to be, but it is not unlikely that they are
2021-04-07 13:26:10 <merijn> ADG1089: (i.e. profiling binaries aren't *always* slower, but "my binaries are slower" is a common and known side-effect of profiling builds)
2021-04-07 13:27:25 acarrico joins (~acarrico@dhcp-68-142-39-249.greenmountainaccess.net)
2021-04-07 13:27:43 acarrico parts (~acarrico@dhcp-68-142-39-249.greenmountainaccess.net) ()
2021-04-07 13:28:05 ddellacosta joins (~ddellacos@ool-44c73afa.dyn.optonline.net)
2021-04-07 13:28:38 waleee-cl joins (uid373333@gateway/web/irccloud.com/x-lyzlpexksowrzqil)
2021-04-07 13:30:45 × averell quits (~averell@unaffiliated/averell) (Quit: .)
2021-04-07 13:32:51 Tario joins (~Tario@201.192.165.173)
2021-04-07 13:33:00 × Franciman quits (~francesco@host-87-20-23-243.retail.telecomitalia.it) (Quit: Leaving)
2021-04-07 13:34:07 × olligobber quits (olligobber@gateway/vpn/privateinternetaccess/olligobber) (Remote host closed the connection)
2021-04-07 13:41:42 frozenErebus joins (~frozenEre@37.231.244.249)
2021-04-07 13:42:05 × geekosaur quits (82650c7a@130.101.12.122) (Quit: Connection closed)
2021-04-07 13:44:10 averell joins (~averell@unaffiliated/averell)
2021-04-07 13:45:05 slack1256 joins (~slack1256@201-223-70-219.baf.movistar.cl)
2021-04-07 13:49:03 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Quit: Connection closed)
2021-04-07 13:49:23 royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9)
2021-04-07 13:51:03 <fendor> why is `class (Foo a, Foo a) => Bar a where` not a warning?
2021-04-07 13:51:31 <sshine> they unify? :-D
2021-04-07 13:52:05 × zebrag quits (~inkbottle@aaubervilliers-654-1-2-51.w83-200.abo.wanadoo.fr) (Quit: Konversation terminated!)
2021-04-07 13:52:14 <sshine> I guess there's room for improvement.
2021-04-07 13:52:24 zebrag joins (~inkbottle@aaubervilliers-654-1-2-51.w83-200.abo.wanadoo.fr)
2021-04-07 13:54:14 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Ping timeout: 265 seconds)
2021-04-07 13:56:46 sz0 joins (uid110435@gateway/web/irccloud.com/x-pwzpuvhtwmrmedza)
2021-04-07 13:57:32 mmmattyx joins (uid17782@gateway/web/irccloud.com/x-zogxbflcfypzetqv)
2021-04-07 13:59:00 × raym quits (~ray@45.64.220.78) (Quit: leaving)
2021-04-07 13:59:37 × juri__ quits (~juri@212.86.35.156) (Read error: Connection reset by peer)
2021-04-07 14:00:26 × malumore quits (~malumore@151.62.125.43) (Ping timeout: 240 seconds)
2021-04-07 14:00:54 Sgeo joins (~Sgeo@ool-18b98aa4.dyn.optonline.net)
2021-04-07 14:01:11 × nut quits (~user@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 246 seconds)
2021-04-07 14:01:19 juri_ joins (~juri@212.86.35.156)
2021-04-07 14:01:44 × oish quits (~charlie@228.25.169.217.in-addr.arpa) (Quit: leaving)
2021-04-07 14:01:52 × frozenErebus quits (~frozenEre@37.231.244.249) (Quit: leaving)
2021-04-07 14:03:21 LiaoTao_ joins (~LiaoTao@gateway/tor-sasl/liaotao)
2021-04-07 14:03:25 hexfive joins (~hexfive@50.35.83.177)
2021-04-07 14:03:46 × LiaoTao quits (~LiaoTao@gateway/tor-sasl/liaotao) (Remote host closed the connection)
2021-04-07 14:04:53 timCF joins (~i.tkachuk@200-149-20-81.sta.estpak.ee)
2021-04-07 14:05:19 × nbloomf quits (~nbloomf@2600:1700:ad14:3020:5c9f:f9c:c668:a47e) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2021-04-07 14:10:51 <timCF> Hello! Seems like I do need some help with unlifting. I have a custom monad where I do fun all application code and functions. And I do need to compose them with some IO functions (in my case WAI wants handlers to run in IO). I came up with something like this `grpcServer = withRunInIO $ \run -> runServer $ handlers run` where handlers is list of WAI-like handlers which have to be run in IO. It looks like
2021-04-07 14:10:57 <timCF> `handlers run = [run handler0, run handler1, ...]`. It compiles with zero or one handler. But in cases where there is more that one handler (handlers are accepting different types of requests and returning different types of responses) - it refuses to be compiled. How to fix that?
2021-04-07 14:13:56 <timCF> It's not exactly like that, handlers are technically have the same high-level type, but some parts of them are specific and I do need to unlift these parts into IO
2021-04-07 14:14:09 stef204 joins (~stef204@unaffiliated/stef-204/x-384198)
2021-04-07 14:14:10 malumore joins (~malumore@151.62.125.43)
2021-04-07 14:15:13 <andreabedini> timCF: I am very unfamiliar with unlifitng but to me it looks like the main problem you are having is putting things of different type into a list
2021-04-07 14:15:19 carp parts (5c17283b@host-92-23-40-59.as13285.net) ()
2021-04-07 14:15:41 <andreabedini> timCF: what's the type of runServer?
2021-04-07 14:16:07 × astroanax quits (~astroanax@cosmic.voyage) (Read error: Connection reset by peer)
2021-04-07 14:17:17 × rodriga quits (~quassel@134.204.25.66) (Read error: Connection reset by peer)
2021-04-07 14:17:30 <timCF> andreabedini: it's complicated -_- if simplified it's something like `runServer :: [ServerHandler] -> IO ()`
2021-04-07 14:18:43 Codaraxis_ joins (Codaraxis@gateway/vpn/mullvad/codaraxis)
2021-04-07 14:19:08 <timCF> andreabedini: items in list have to be the same type `ServerHandler`. And I though this function `run` for unlifting could be generic `m a -> IO a`. But seems like GHC does not agree
2021-04-07 14:19:36 frozenErebus joins (~frozenEre@37.231.244.249)
2021-04-07 14:20:05 <merijn> timCF: You need a more polymorphic version
2021-04-07 14:20:33 <merijn> timCF: You need: https://hackage.haskell.org/package/unliftio-core-0.2.0.1/docs/Control-Monad-IO-Unlift.html#v:withUnliftIO
2021-04-07 14:20:49 × ddellacosta quits (~ddellacos@ool-44c73afa.dyn.optonline.net) (Remote host closed the connection)
2021-04-07 14:21:05 <merijn> oh, wait, maybe not that one
2021-04-07 14:21:18 × Codaraxis quits (Codaraxis@gateway/vpn/mullvad/codaraxis) (Ping timeout: 265 seconds)
2021-04-07 14:21:31 <merijn> I think you can't use a lambda
2021-04-07 14:22:00 <merijn> You need a Rank2 "runInIO", but rank2 types can't be inferred, so you can't have an unannotated lambda like that
2021-04-07 14:22:17 ddellaco_ joins (~ddellacos@ool-44c73afa.dyn.optonline.net)
2021-04-07 14:22:26 Tuplanolla joins (~Tuplanoll@91-159-68-239.elisa-laajakaista.fi)
2021-04-07 14:23:15 <timCF> merijn: so I can't pass around `run` function and home that GHC will agree with polymorphic nature of it?
2021-04-07 14:23:27 <timCF> merijn: * and hope
2021-04-07 14:23:29 × jpds quits (~jpds@gateway/tor-sasl/jpds) (Remote host closed the connection)
2021-04-07 14:23:40 <merijn> timCF: No, you need to explicitly annotate that it's that polymorphic
2021-04-07 14:23:54 jpds joins (~jpds@gateway/tor-sasl/jpds)
2021-04-07 14:24:25 <merijn> timCF: Rank2 is *theoretically* inferrible, but the implementation is so complicated that GHC does not do it. So any use of Rank2 polymorphism requires explicit type signatures
2021-04-07 14:24:44 <merijn> timCF: Else GHC will infer a Rank1 type, which indeed doesn't type check
2021-04-07 14:25:10 <merijn> (if I understand the example correctly, anyway)
2021-04-07 14:25:47 <merijn> oh, wait, maybe withUnliftIO *does* solve it
2021-04-07 14:26:03 <merijn> timCF: Your handlers all have the same 'm', but different 'a's?
2021-04-07 14:26:05 × cfricke quits (~cfricke@unaffiliated/cfricke) (Ping timeout: 252 seconds)
2021-04-07 14:26:16 <timCF> merijn: yes!
2021-04-07 14:26:31 <merijn> timCF: Ok, then withUnliftIO probably will work
2021-04-07 14:26:51 <merijn> You'd have to do "\(UnliftIO run) -> ..." then
2021-04-07 14:27:17 <merijn> There you piggyback the polymorphic type off of the pattern match on UnliftIO
2021-04-07 14:27:21 <timCF> merijn: thanks, I'll try it! Usually `withRunInIO` was enough. Time to learn some new unlifting
2021-04-07 14:28:31 <merijn> timCF: withUnliftIO is basically the same, but it stuff the unlifting function in a datatype
2021-04-07 14:34:44 × gxt quits (~gxt@gateway/tor-sasl/gxt) (Remote host closed the connection)
2021-04-07 14:35:10 gxt joins (~gxt@gateway/tor-sasl/gxt)
2021-04-07 14:36:45 neysofu joins (~neysofu@net-47-53-239-127.cust.vodafonedsl.it)
2021-04-07 14:39:01 cr3 joins (~cr3@192-222-143-195.qc.cable.ebox.net)
2021-04-07 14:42:33 barthandelous parts (~cbrzezins@2600:1007:b01a:85d2:6685:eca8:992:2c72) ("WeeChat 3.1")
2021-04-07 14:42:58 × andreabedini quits (~andreabed@8s8kj6nq8lb1xsln9frf.ip6.superloop.com) (Quit: WeeChat 3.1)
2021-04-07 14:44:18 LKoen joins (~LKoen@65.250.88.92.rev.sfr.net)
2021-04-07 14:46:22 <timCF> merijn: do I need to enable any GHC extensions or write some magic forall to make this kind plymorphism happen?
2021-04-07 14:46:29 heatsink joins (~heatsink@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2021-04-07 14:48:02 rodriga joins (~quassel@134.204.25.66)

All times are in UTC.