Home liberachat/#haskell: Logs Calendar

Logs: liberachat/#haskell

←Prev  Next→ 1,803,970 events total
2021-08-03 10:36:46 mastarija joins (~mastarija@31.217.8.174)
2021-08-03 10:38:09 lortabac joins (~lortabac@2a01:e0a:541:b8f0:c3b9:c489:f445:c424)
2021-08-03 10:38:14 <mastarija> I don't quite get this ConstrainedMonad trick using EDSL, or rather, I get the idea, but I don't understand how they produced a Monad instance without doing the Functor and Applicative.
2021-08-03 10:38:29 <mastarija> Was this before Monad was dependent on Applicative and Functor?
2021-08-03 10:38:49 <mastarija> https://ku-fpg.github.io/files/Sculthorpe-13-ConstrainedMonad.pdf
2021-08-03 10:38:54 ubert joins (~Thunderbi@91.141.40.237.wireless.dyn.drei.com)
2021-08-03 10:39:12 Atum_ joins (IRC@user/atum/x-2392232)
2021-08-03 10:41:50 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 258 seconds)
2021-08-03 10:42:11 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
2021-08-03 10:42:58 × curiousgay quits (~curiousga@77-120-186-48.kha.volia.net) (Ping timeout: 240 seconds)
2021-08-03 10:43:51 Pickchea joins (~private@user/pickchea)
2021-08-03 10:46:04 integral_ is now known as integral
2021-08-03 10:46:48 <Arahael> I'm trying to figure out how to apply Middleware to a Yesod application - any tips/pointers?
2021-08-03 10:47:12 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 245 seconds)
2021-08-03 10:47:43 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
2021-08-03 10:47:46 × berberman_ quits (~berberman@user/berberman) (Ping timeout: 240 seconds)
2021-08-03 10:48:33 berberman joins (~berberman@user/berberman)
2021-08-03 10:49:27 curiousgay joins (~curiousga@77-120-186-48.kha.volia.net)
2021-08-03 10:50:02 anandprabhu joins (~anandprab@94.202.243.198)
2021-08-03 10:52:46 kilolympus joins (~kilolympu@cpc92710-cmbg20-2-0-cust265.5-4.cable.virginm.net)
2021-08-03 10:52:54 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 250 seconds)
2021-08-03 10:53:52 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
2021-08-03 10:54:06 × drd quits (~drd@2001:b07:a70:9f1f:1562:34de:f50f:77d4) (Ping timeout: 258 seconds)
2021-08-03 10:55:19 <Arahael> I'd be asking a more specific question if I knew what on earth it is you do. I want to add an etag to the headers of all responses.
2021-08-03 10:56:33 dschrempf joins (~dominik@070-207.dynamic.dsl.fonira.net)
2021-08-03 10:58:19 × cfricke quits (~cfricke@user/cfricke) (Quit: WeeChat 3.2)
2021-08-03 10:59:02 <Arahael> Aha, so rather than using Wai middleware, I have to override the implemetnation in my Yesod instance. That works.
2021-08-03 10:59:17 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 245 seconds)
2021-08-03 10:59:55 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
2021-08-03 11:01:49 × Atum_ quits (IRC@user/atum/x-2392232) (Quit: Atum_)
2021-08-03 11:03:17 <jippiedoe> mastarija: From what I can see (just a quick glance at the paper), they probably simply ignore the functor/applicative superclass because it's orthoganal to what they're talking about
2021-08-03 11:03:18 × Obo quits (~roberto@70.pool90-171-81.dynamic.orange.es) (Ping timeout: 258 seconds)
2021-08-03 11:03:57 <jippiedoe> At some point in the paper they even say "applicative functors lie between functors and monads" :)
2021-08-03 11:03:59 <mastarija> jippiedoe, I guess, but instance becomes much more complex and hard to derive once you add those in
2021-08-03 11:04:26 <dminuoso> mastarija: Not really.
2021-08-03 11:04:47 <dminuoso> mastarija: functor and applicative can be written in terms of monad, statically
2021-08-03 11:05:00 <dminuoso> instance Applicative where pure = return; (<*>) = ap
2021-08-03 11:05:08 <mastarija> dminuoso, oh... yes
2021-08-03 11:05:24 <dminuoso> instance Functor where fmap = liftM
2021-08-03 11:05:37 <jippiedoe> which is why they're a superclass of Monad to begin with :)
2021-08-03 11:05:41 <dminuoso> Oh, I was missing the type constructor there in each declaration, but you get it.
2021-08-03 11:05:43 × ubert quits (~Thunderbi@91.141.40.237.wireless.dyn.drei.com) (Quit: ubert)
2021-08-03 11:05:52 <mastarija> Yes
2021-08-03 11:05:53 <mastarija> thx
2021-08-03 11:05:57 × Pickchea quits (~private@user/pickchea) (Ping timeout: 245 seconds)
2021-08-03 11:08:07 AlexNoo_ joins (~AlexNoo@94.233.240.129)
2021-08-03 11:09:37 lavaman joins (~lavaman@98.38.249.169)
2021-08-03 11:10:08 × AlexZenon quits (~alzenon@178.34.150.193) (Ping timeout: 258 seconds)
2021-08-03 11:10:38 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 268 seconds)
2021-08-03 11:10:58 × Alex_test quits (~al_test@178.34.150.193) (Ping timeout: 240 seconds)
2021-08-03 11:11:40 × AlexNoo quits (~AlexNoo@178.34.150.193) (Ping timeout: 272 seconds)
2021-08-03 11:11:53 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
2021-08-03 11:12:23 bitmapper joins (uid464869@id-464869.tooting.irccloud.com)
2021-08-03 11:13:50 mousey joins (~skymouse@gateway/tor-sasl/mousey)
2021-08-03 11:14:20 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 268 seconds)
2021-08-03 11:14:28 × oxide quits (~lambda@user/oxide) (Read error: Connection reset by peer)
2021-08-03 11:14:32 AlexZenon joins (~alzenon@94.233.240.129)
2021-08-03 11:15:45 Obo joins (~roberto@70.pool90-171-81.dynamic.orange.es)
2021-08-03 11:17:13 Alex_test joins (~al_test@94.233.240.129)
2021-08-03 11:17:45 mastarija_ joins (~mastarija@31.217.8.174)
2021-08-03 11:17:57 <Arahael> Ok, I'm lost. Is there _any_ documentation that shows how one can add an etag to a yesod response in a Yesod Middleware? I've got a `HandlerFor App res`, but I have no idea what to do with it.
2021-08-03 11:18:56 <Arahael> Ah, I need to look at Yesod.Core.Handler
2021-08-03 11:19:35 gehmehgeh joins (~user@user/gehmehgeh)
2021-08-03 11:20:08 Atum_ joins (IRC@user/atum/x-2392232)
2021-08-03 11:20:56 × mastarija quits (~mastarija@31.217.8.174) (Ping timeout: 258 seconds)
2021-08-03 11:21:40 <Arahael> No, I'm still lost. :(
2021-08-03 11:22:24 <merijn> Arahael: That's natual with Yesod :p
2021-08-03 11:22:31 <Arahael> merijn: Ha. :(
2021-08-03 11:22:43 <Arahael> merijn: Sometimes I regret choosing it!
2021-08-03 11:22:51 <merijn> Only sometimes? :p
2021-08-03 11:22:57 phma_ joins (phma@2001:5b0:211c:72c8:b364:62c6:6db3:cb87)
2021-08-03 11:22:59 <Arahael> :)
2021-08-03 11:23:14 × phma quits (~phma@2600:1004:b127:459d:fed5:fe1c:2170:ecd1) (Ping timeout: 250 seconds)
2021-08-03 11:23:56 <Arahael> There is lots of good stuff, but whilst the regular boring stuff seems... Good... Stuff as simple as middleware is fiendlishly complex.
2021-08-03 11:25:43 <Arahael> I probably should just use warp directly if I were doing this again, and use Wai directly.
2021-08-03 11:26:42 <Arahael> Ok, there's nothing in Yesod.Core.Handler that seems to be helpful.
2021-08-03 11:27:01 <Arahael> Nothing that lets me get access to the response.
2021-08-03 11:28:17 machinedgod joins (~machinedg@135-23-192-217.cpe.pppoe.ca)
2021-08-03 11:32:13 × azeem quits (~azeem@dynamic-adsl-94-34-48-122.clienti.tiscali.it) (Read error: Connection reset by peer)
2021-08-03 11:32:56 <Arahael> Ok, it seems I can't realistically set etags as part of middleware. Yesod just doesn't allow it, I think.
2021-08-03 11:34:02 × Obo quits (~roberto@70.pool90-171-81.dynamic.orange.es) (Ping timeout: 252 seconds)
2021-08-03 11:34:35 burnsidesLlama joins (~burnsides@dhcp168-023.wadham.ox.ac.uk)
2021-08-03 11:35:06 chris joins (~chris@81.96.113.213)
2021-08-03 11:35:10 chris is now known as Guest7390
2021-08-03 11:35:30 <merijn> I guess that the best/only way to return a set of exceptions is to simpl return something like [SomeException]?
2021-08-03 11:36:29 oxide joins (~lambda@user/oxide)
2021-08-03 11:36:36 <dminuoso> merijn: hard to say, what's the exact semantics you're looking for?
2021-08-03 11:37:03 <merijn> dminuoso: I have N workers threads and if one hits an exception, I want to report it
2021-08-03 11:37:19 AlexNoo_ is now known as AlexNoo
2021-08-03 11:37:21 <merijn> dminuoso: Except, there's a conceptual race where 2 or more threads happen to hit an exception at the same time
2021-08-03 11:37:46 <dminuoso> Where does the set come in? Seems like each one would just report a singular exception
2021-08-03 11:38:04 <merijn> dminuoso: I have a parent thread responsible for the N children
2021-08-03 11:38:19 <merijn> dminuoso: If one of the children dies, I kill them all and report it in the parent thread
2021-08-03 11:38:29 <merijn> dminuoso: So in case of a race I have to report multiple exceptions
2021-08-03 11:38:34 <dminuoso> Intuitively I'd rather create a separate MultiException of some kind
2021-08-03 11:38:51 <dminuoso> But the details depend on how the parent deals with that exceptoin
2021-08-03 11:39:03 <merijn> dminuoso: Well, yes, hence my question how to best aggregate the multiple exception into one datatype :p
2021-08-03 11:39:34 <merijn> dminuoso: You can configure different behaviour for the parent, but by default it cleans up and rethrows
2021-08-03 11:40:06 × burnsidesLlama quits (~burnsides@dhcp168-023.wadham.ox.ac.uk) (Ping timeout: 258 seconds)
2021-08-03 11:40:49 mastarija__ joins (~mastarija@31.217.16.231)

All times are in UTC.