Logs: freenode/#haskell
| 2020-09-29 08:48:49 | <fog> | like, is this racing actors a way to avoid blocking at the expense of determinism? |
| 2020-09-29 08:49:14 | → | cpressey joins (~cpressey@79-72-202-166.dynamic.dsl.as9105.com) |
| 2020-09-29 08:49:21 | <fog> | that doesnt sound like a good idea from the tradition of pure functional programing where we require reproducibility of programs |
| 2020-09-29 08:49:23 | × | ChaiTRex quits (~ChaiTRex@gateway/tor-sasl/chaitrex) (Ping timeout: 240 seconds) |
| 2020-09-29 08:50:19 | <fog> | then you would need some way for this lattice of actors to have like a sat solver or something to guarantee it is free from blockages |
| 2020-09-29 08:50:42 | → | ChaiTRex joins (~ChaiTRex@gateway/tor-sasl/chaitrex) |
| 2020-09-29 08:51:03 | <fog> | that seems like it could somehow be encoded at type level as the topology, but that would require some kind of guarantees about the functions ability to return |
| 2020-09-29 08:51:24 | <fog> | like basically, you would have it in ST or pure, so that it wasnt doing any blocking IO |
| 2020-09-29 08:52:12 | <fog> | then these "pure actors" could have network topological guaranties basically as "the shape of the program" at type level to be non-blocking by construction |
| 2020-09-29 08:53:01 | <fog> | i guess that also then gives rise to a determinable evaluation order inferred by the topology |
| 2020-09-29 08:53:16 | → | Tops2 joins (~Tobias@dyndsl-091-249-082-222.ewe-ip-backbone.de) |
| 2020-09-29 08:53:46 | → | heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) |
| 2020-09-29 08:53:48 | <fog> | but then, actors are supposed to be able to spawn new actors - so how would you have these runtime guaranties at type level |
| 2020-09-29 08:54:43 | <fog> | i guess there is proabably some deep result there about how actors, by having runtime variable topoligies, *have* to have the racing and mailboxes in order to then not require this typechecking |
| 2020-09-29 08:55:14 | × | mnrmnaugh quits (~mnrmnaugh@unaffiliated/mnrmnaugh) (Ping timeout: 265 seconds) |
| 2020-09-29 08:55:26 | <fog> | then it seems like the fundamental problem is the reconciliation of runtime variable determinism guarantees in concurrent pure programming |
| 2020-09-29 08:55:47 | <fog> | which sounds kind of above my pay grade |
| 2020-09-29 08:56:01 | × | werneta quits (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 246 seconds) |
| 2020-09-29 08:56:31 | <fog> | maybe if i had a working actors model, i could get some simulated elves to do it... |
| 2020-09-29 08:56:56 | <fog> | all talking elvish |
| 2020-09-29 08:57:34 | × | jedws quits (~jedws@121.209.139.222) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 2020-09-29 08:57:39 | × | jonatanb quits (~jonatanb@83.24.231.247.ipv4.supernova.orange.pl) (Remote host closed the connection) |
| 2020-09-29 08:57:57 | × | fog quits (a1814696@gateway/web/cgi-irc/kiwiirc.com/ip.161.129.70.150) (Quit: Connection closed) |
| 2020-09-29 08:58:06 | → | mnrmnaugh joins (~mnrmnaugh@unaffiliated/mnrmnaugh) |
| 2020-09-29 08:58:35 | × | Clough quits (~Cain@210.185.68.138) (Ping timeout: 240 seconds) |
| 2020-09-29 08:58:37 | × | heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 265 seconds) |
| 2020-09-29 08:59:53 | → | Orbstheorem joins (~roosember@hellendaal.orbstheorem.ch) |
| 2020-09-29 09:00:01 | × | UltimateNate quits (~UltimateN@185.189.112.19) () |
| 2020-09-29 09:00:24 | × | snakemasterflex quits (~snakemast@213.100.206.23) (Ping timeout: 256 seconds) |
| 2020-09-29 09:00:36 | <dminuoso> | AWizzArd: getPostParam? |
| 2020-09-29 09:01:12 | <dminuoso> | Oh wait, this is something else |
| 2020-09-29 09:01:57 | <dminuoso> | snap is weird |
| 2020-09-29 09:02:12 | <hc> | why would you switch from servant to snap? |
| 2020-09-29 09:02:12 | <AWizzArd> | dminuoso: Yeah, I can fetch contents of the Request and then do with it whatever I want. |
| 2020-09-29 09:02:23 | <hc> | (just curious) |
| 2020-09-29 09:02:28 | <AWizzArd> | hc: experimentation, seeing different styles. |
| 2020-09-29 09:02:39 | <AWizzArd> | Our main service is using Servant. |
| 2020-09-29 09:02:43 | → | cfricke joins (~cfricke@unaffiliated/cfricke) |
| 2020-09-29 09:02:47 | <AWizzArd> | Now for a small email service I’m trying Snap. |
| 2020-09-29 09:03:18 | <AWizzArd> | I think in Snap I need to do things a tiny bit more manually. |
| 2020-09-29 09:03:59 | × | davve quits (davve@bsd.douchedata.com) (Read error: Connection reset by peer) |
| 2020-09-29 09:04:01 | <dminuoso> | AWizzArd: https://hackage.haskell.org/package/snap-core-1.0.4.2/docs/Snap-Internal-Core.html#v:getRequest |
| 2020-09-29 09:04:13 | <dminuoso> | There you can extract the body from. |
| 2020-09-29 09:04:56 | × | dredozubov quits (~dredozubo@37.139.21.214) (Ping timeout: 256 seconds) |
| 2020-09-29 09:04:58 | <AWizzArd> | dminuoso: Right, and it works. I guess my main question is if I need to do this manually. Or if there is a Servant-like mechanism that lets me declaritively describe an expected request, and have Snap deliver me automatically args. |
| 2020-09-29 09:05:15 | <AWizzArd> | The „YOU can extract the body” part (: |
| 2020-09-29 09:05:20 | <dminuoso> | So you're looking for servant? ;) |
| 2020-09-29 09:05:46 | <dminuoso> | But really, you can relatively trivially write your own combinator |
| 2020-09-29 09:06:03 | → | snakemasterflex joins (~snakemast@213.100.206.23) |
| 2020-09-29 09:06:42 | <AWizzArd> | dminuoso: Another thing I am looking for: what if I want to use a ReaderT Context where I can place some nice TVars? How would I serve a site using my own reader? |
| 2020-09-29 09:06:56 | → | carlomagno1 joins (~cararell@inet-hqmc02-o.oracle.com) |
| 2020-09-29 09:07:13 | <AWizzArd> | The httpServe function wants a `Snap ()` value. |
| 2020-09-29 09:07:22 | <dminuoso> | getJSONRequest :: (FromJson t, MonadSnap m) => m t; getJSONRequest = do <- body <- rqBody <$> getRequest; buf <- ...; decode buf `note` ParseError ... |
| 2020-09-29 09:07:54 | <dminuoso> | Some badly written pseudo, but i hope it conveys my thoughts |
| 2020-09-29 09:08:17 | <dminuoso> | AWizzArd: Write your own MonadSnap instance. |
| 2020-09-29 09:08:46 | <dminuoso> | In case of ReaderT, you can trivially unwrap it no? ;) |
| 2020-09-29 09:08:50 | <AWizzArd> | dminuoso: yes, the route :: MonadSnap m => [(ByteString, m a)] -> m a looks good. There also already IS a ReaderT instance for MonadSnap. |
| 2020-09-29 09:09:00 | × | dexterlb quits (~dexterlb@2a01:9e40:2:2::2) (Quit: Boing) |
| 2020-09-29 09:09:23 | <dminuoso> | say, you have `data App a = App { runApp :: ReaderT Env (Snap a) } deriving (Functor, Applicative, Monad, MonadSnap, MonadReader Env)` |
| 2020-09-29 09:09:26 | × | coot quits (~coot@37.30.59.210.nat.umts.dynamic.t-mobile.pl) (Quit: coot) |
| 2020-09-29 09:09:41 | <AWizzArd> | dminuoso: shouldn’t there me some foo :: (MonadSnap m) => m -> Snap () ? |
| 2020-09-29 09:09:41 | <dminuoso> | Then you can just say `httpServce . runReaderT someEnv . runApp $ someApp` |
| 2020-09-29 09:09:47 | × | carlomagno quits (~cararell@inet-hqmc02-o.oracle.com) (Ping timeout: 240 seconds) |
| 2020-09-29 09:09:52 | <dminuoso> | AWizzArd: ^- that. |
| 2020-09-29 09:10:03 | → | davve joins (~davve@bsd.douchedata.com) |
| 2020-09-29 09:10:18 | × | aplainzetakind quits (~johndoe@captainludd.powered.by.lunarbnc.net) (Quit: Free ZNC ~ Powered by LunarBNC: https://LunarBNC.net) |
| 2020-09-29 09:10:20 | <dminuoso> | Think of ReaderT as being just a function, then getting the Snap out of it is just a matter of providing the argument. |
| 2020-09-29 09:10:22 | → | TooDifficult joins (~TooDiffic@139.59.59.230) |
| 2020-09-29 09:10:35 | <AWizzArd> | Yes, that makes sense. |
| 2020-09-29 09:10:41 | → | coot joins (~coot@37.30.59.210.nat.umts.dynamic.t-mobile.pl) |
| 2020-09-29 09:10:41 | <dminuoso> | Oh, I think the argument was flipped around. |
| 2020-09-29 09:11:00 | <dminuoso> | so `httpSevce . flip runReaderT someEnv . runApp $ someApp` |
| 2020-09-29 09:11:46 | <dminuoso> | (So if we squint a bit, runReaderT is just ($)) |
| 2020-09-29 09:14:23 | → | heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) |
| 2020-09-29 09:15:55 | → | dredozubov joins (~dredozubo@37.139.21.214) |
| 2020-09-29 09:16:06 | × | jgt quits (~jgt@194.143.137.49.users.breezein.net) (Ping timeout: 256 seconds) |
| 2020-09-29 09:18:21 | <AWizzArd> | dminuoso: yes, that makes sense. The runReaderT is that function that returns the `Snap ()`. |
| 2020-09-29 09:18:47 | × | heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 260 seconds) |
| 2020-09-29 09:19:16 | <dminuoso> | This is no different than servant btw |
| 2020-09-29 09:20:50 | <dminuoso> | Abstractly, in both snap and servant you need a natural transformation `T ~> Snap` and respectively `T ~> Handler`. In servant you provide that in hoistServer, and in snap it's a bit more direct. |
| 2020-09-29 09:20:59 | <dminuoso> | (Where T is your custom monad) |
| 2020-09-29 09:21:09 | → | notzmv` joins (~user@179.100.115.46) |
| 2020-09-29 09:21:18 | → | supercoven_ joins (~Supercove@dsl-hkibng32-54fb54-166.dhcp.inet.fi) |
| 2020-09-29 09:21:19 | × | supercoven_ quits (~Supercove@dsl-hkibng32-54fb54-166.dhcp.inet.fi) (Max SendQ exceeded) |
| 2020-09-29 09:21:33 | → | supercoven_ joins (~Supercove@dsl-hkibng32-54fb54-166.dhcp.inet.fi) |
| 2020-09-29 09:21:43 | → | blase_ joins (~blase@4e69b241.skybroadband.com) |
| 2020-09-29 09:22:31 | → | dexterlb joins (~dexterlb@2a01:9e40:2:2::2) |
| 2020-09-29 09:22:33 | × | nkly quits (~nkly@2a02:8109:9a80:a74:201:2eff:fe81:c6dd) (Quit: ZNC 1.6.6+deb1ubuntu0.2 - http://znc.in) |
| 2020-09-29 09:24:24 | × | notzmv quits (~user@unaffiliated/zmv) (Ping timeout: 260 seconds) |
| 2020-09-29 09:24:24 | × | blase quits (~blase@4e69b241.skybroadband.com) (Ping timeout: 260 seconds) |
| 2020-09-29 09:24:31 | → | heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) |
| 2020-09-29 09:24:44 | → | josh_ joins (~josh@c-67-164-104-206.hsd1.ca.comcast.net) |
| 2020-09-29 09:24:52 | × | supercoven quits (~Supercove@dsl-hkibng32-54fb54-166.dhcp.inet.fi) (Ping timeout: 260 seconds) |
| 2020-09-29 09:26:01 | × | TooDifficult quits (~TooDiffic@139.59.59.230) (Quit: TooDifficult) |
| 2020-09-29 09:26:24 | → | zacts joins (~zacts@dragora/developer/zacts) |
| 2020-09-29 09:27:48 | → | jgt joins (~jgt@46.250.27.223.pool.breezein.net) |
| 2020-09-29 09:27:49 | × | snakemasterflex quits (~snakemast@213.100.206.23) (Ping timeout: 264 seconds) |
| 2020-09-29 09:27:58 | × | supercoven_ quits (~Supercove@dsl-hkibng32-54fb54-166.dhcp.inet.fi) (Max SendQ exceeded) |
| 2020-09-29 09:28:13 | → | supercoven joins (~Supercove@dsl-hkibng32-54fb54-166.dhcp.inet.fi) |
| 2020-09-29 09:28:13 | × | supercoven quits (~Supercove@dsl-hkibng32-54fb54-166.dhcp.inet.fi) (Max SendQ exceeded) |
All times are in UTC.