Home liberachat/#haskell: Logs Calendar

Logs: liberachat/#haskell

←Prev  Next→ 1,803,971 events total
2021-08-03 13:23:11 × markpythonicbitc quits (~textual@2601:647:5a00:35:e0da:ada7:2ca5:10dd) (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
2021-08-03 13:25:06 jippiedoe joins (~david@2a02-a44c-e14e-1-dfb3-4ecf-f29f-159d.fixed6.kpn.net)
2021-08-03 13:25:40 <merijn> hmm
2021-08-03 13:25:51 <merijn> What happens if the cleanup part of a bracket throws an exception?
2021-08-03 13:29:36 × agua_pesada quits (~agua_pesa@2804:14c:8793:8e2f:48b4:3d09:2f3b:552b) (Ping timeout: 276 seconds)
2021-08-03 13:30:05 slowButPresent joins (~slowButPr@user/slowbutpresent)
2021-08-03 13:30:11 <Taneb> merijn: I think the whole thing throws an exception
2021-08-03 13:30:21 <merijn> Yes, but which one
2021-08-03 13:30:55 shriekingnoise joins (~shrieking@186.137.144.80)
2021-08-03 13:33:45 <Taneb> The one the cleanup action throws
2021-08-03 13:34:08 <merijn> You say this very confidently, but I have serious question marks whether it does :p
2021-08-03 13:34:27 <Taneb> I'm looking at the source
2021-08-03 13:34:28 mr-red joins (~drd@2001:b07:a70:9f1f:1562:34de:f50f:77d4)
2021-08-03 13:34:30 <Taneb> https://hackage.haskell.org/package/base-4.15.0.0/docs/src/Control-Exception-Base.html#bracket
2021-08-03 13:34:31 <dminuoso> Im also confident Taneb is right
2021-08-03 13:34:35 <dminuoso> The implementation of bracket is dead simple
2021-08-03 13:34:40 <Taneb> Although I will admit I have done no experimentation
2021-08-03 13:34:57 <merijn> dminuoso: Hard disagree on it being simple :p
2021-08-03 13:35:23 <merijn> dminuoso: The runtime semantics of bracket are anything but simple, imo
2021-08-03 13:35:33 × hendursa1 quits (~weechat@user/hendursaga) (Quit: hendursa1)
2021-08-03 13:35:52 × drd quits (~drd@2001:b07:a70:9f1f:1562:34de:f50f:77d4) (Ping timeout: 258 seconds)
2021-08-03 13:36:01 hendursaga joins (~weechat@user/hendursaga)
2021-08-03 13:36:13 × burnside_ quits (~burnsides@dhcp168-023.wadham.ox.ac.uk) (Remote host closed the connection)
2021-08-03 13:36:52 <dminuoso> merijn: Well if you follow this rabbit hole, it ends up being a discussion about "what happens if you throw an exception in the catch clause", no?
2021-08-03 13:37:11 <merijn> dminuoso: Well yes, that's exactly the rabbit hole I'm currently heading down
2021-08-03 13:37:40 <dminuoso> Sorry I meant "in the catching part of `catch`"
2021-08-03 13:38:58 burnsidesLlama joins (~burnsides@client-8-91.eduroam.oxuni.org.uk)
2021-08-03 13:39:46 <Taneb> Oh, hmm, experimentation suggests that I was wrong
2021-08-03 13:39:59 PinealGlandOptic joins (~PinealGla@37.115.210.35)
2021-08-03 13:40:01 <Taneb> No, I'm just using bracket wrong
2021-08-03 13:40:09 <merijn> Taneb: I'm not even sure it's deterministic, tbh
2021-08-03 13:40:19 <Taneb> The release is the second argument, not the third
2021-08-03 13:40:39 <Taneb> merijn: I think it is. Have you seen anything that suggests it isn't?
2021-08-03 13:41:01 <merijn> Taneb: I'm just wildly paranoid about literally every part of async exceptions >.>
2021-08-03 13:41:24 <Taneb> merijn: do you agree that "throwIO a >> throwIO b" always throws a?
2021-08-03 13:41:39 <dminuoso> fsvo of "always"
2021-08-03 13:41:41 <merijn> Only probably >.>
2021-08-03 13:41:45 <dminuoso> in the presence of async exceptions it might not.
2021-08-03 13:41:54 <Taneb> Assuming there's no other threads messing with it
2021-08-03 13:41:55 <merijn> Because per GHC semantics it can throw either non-deterministically
2021-08-03 13:41:55 <srid[m]> lechner: sm if you haven't checked out already https://note.ema.srid.ca/
2021-08-03 13:42:03 <merijn> Taneb: Doesn't require other threads
2021-08-03 13:42:17 <Taneb> merijn: how can it throw b?
2021-08-03 13:42:41 <merijn> Taneb: GHC optimisation is allowed to make it throw b, iirc
2021-08-03 13:42:53 <Taneb> That's... very surprising
2021-08-03 13:43:02 <merijn> Lemme dig up the obscure example
2021-08-03 13:43:35 <Taneb> If that's true then bracket can also throw either exception, because it's basically doing that
2021-08-03 13:43:45 <merijn> Taneb: Throwing expressions are allowed to throw *any* of the exceptions that can hypothetically be thrown by that expression
2021-08-03 13:44:22 <merijn> Someone had a neat (and by neat I mean "maddening") example of code throwing the "wrong" exception
2021-08-03 13:44:41 <Taneb> throwIO is guaranteed to be sequential, right? That's like the whole point of it over plain throw
2021-08-03 13:45:11 <Taneb> "The throwIO variant should be used in preference to throw to raise an exception within the IO monad because it guarantees ordering with respect to other IO operations, whereas throw does not."
2021-08-03 13:46:00 × pmk quits (~user@195.114.237.86) (Ping timeout: 256 seconds)
2021-08-03 13:46:16 <merijn> Taneb: I'm not sure to what extend the IO guarantees affect imprecise exception semantics, hence why I said "probably 'a'" :)
2021-08-03 13:46:28 × mr-red quits (~drd@2001:b07:a70:9f1f:1562:34de:f50f:77d4) (Quit: ZNC 1.8.2 - https://znc.in)
2021-08-03 13:46:38 <Taneb> (from haddocks here: https://hackage.haskell.org/package/base-4.15.0.0/docs/GHC-IO.html#v:throwIO )
2021-08-03 13:46:57 <merijn> hmm, looks like throwIO is probably fine
2021-08-03 13:47:34 <Taneb> If it's not fine, I'm going to be very upset
2021-08-03 13:48:32 pmk joins (~user@62.103.231.196)
2021-08-03 13:49:01 agua_pesada joins (~agua_pesa@2804:14c:8793:8e2f:48b4:3d09:2f3b:552b)
2021-08-03 13:49:02 drd joins (~drd@93-39-151-19.ip76.fastwebnet.it)
2021-08-03 13:49:49 <merijn> ugh
2021-08-03 13:50:04 <merijn> Looks like I'm going to have to fundamentally redesign this code
2021-08-03 13:50:55 <Taneb> merijn: so, with somewhat more confidence now, I will say that, assuming no other threads or external signals, if an exception is thrown in the cleanup of a bracket, _that_ exception and not the inner one will be thrown
2021-08-03 13:51:40 Sgeo joins (~Sgeo@user/sgeo)
2021-08-03 13:52:21 mr-red joins (~drd@93-39-151-19.ip76.fastwebnet.it)
2021-08-03 13:53:44 × drd quits (~drd@93-39-151-19.ip76.fastwebnet.it) (Ping timeout: 252 seconds)
2021-08-03 13:54:01 × mr-red quits (~drd@93-39-151-19.ip76.fastwebnet.it) (Client Quit)
2021-08-03 13:54:46 drd joins (~drd@93-39-151-19.ip76.fastwebnet.it)
2021-08-03 13:56:09 × timCF quits (~timCF@200-149-20-81.sta.estpak.ee) (Quit: leaving)
2021-08-03 13:56:34 tzh joins (~tzh@c-24-21-73-154.hsd1.or.comcast.net)
2021-08-03 14:00:33 jess joins (~jess@libera/staff/jess)
2021-08-03 14:04:15 phma_ is now known as phma
2021-08-03 14:05:15 <merijn> hmm
2021-08-03 14:05:31 <merijn> Maybe I should just say fuck it and depend on exceptions, that'd probably make my life infinitely easier
2021-08-03 14:06:24 amahl joins (~amahl@dsl-jklbng12-54fbca-64.dhcp.inet.fi)
2021-08-03 14:06:44 <Taneb> I feel like if you're worried about the low level semantics like that, exceptions might make your life harder
2021-08-03 14:08:27 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2021-08-03 14:08:34 × Pickchea quits (~private@user/pickchea) (Ping timeout: 240 seconds)
2021-08-03 14:08:45 <dminuoso> 15:44:23 merijn | Someone had a neat (and by neat I mean "maddening") example of code throwing the "wrong" exception
2021-08-03 14:08:52 <dminuoso> merijn: Are you sure you are not conflating it with pure exceptions?
2021-08-03 14:08:56 markpythonicbitc joins (~textual@50.228.44.6)
2021-08-03 14:09:21 <merijn> Taneb: The problem is that, right now I have a weird sort of "inversion of control" passing in different brackets (pipes-safe/conduit/etc.) into my own code and working with that, which is...god awful, would not recommend >.>
2021-08-03 14:09:40 <Taneb> Sounds Fun(tm)
2021-08-03 14:09:44 acidjnk_new joins (~acidjnk@p200300d0c72b95287d3c8ae91691b72a.dip0.t-ipconnect.de)
2021-08-03 14:09:50 <merijn> If I just require exceptions, I can just write it once with that bracket and then everything else is someone else's problem
2021-08-03 14:10:10 <merijn> Additionally, both pipes-safe, conduit, and resourcet all support exceptions, so then my life should be much simpler :p
2021-08-03 14:10:18 waleee joins (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
2021-08-03 14:10:27 <Taneb> :)
2021-08-03 14:10:40 × Guest7390 quits (~chris@81.96.113.213) (Remote host closed the connection)
2021-08-03 14:10:52 × solirc quits (~solirc@119.42.116.126) (Ping timeout: 246 seconds)
2021-08-03 14:11:05 deejaytee joins (~deejaytee@193.46-255-62.static.virginmediabusiness.co.uk)
2021-08-03 14:12:39 dschrempf joins (~dominik@070-207.dynamic.dsl.fonira.net)
2021-08-03 14:13:12 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 256 seconds)
2021-08-03 14:13:26 × acidjnk_new3 quits (~acidjnk@p200300d0c72b9591c199f99eb1b080aa.dip0.t-ipconnect.de) (Ping timeout: 258 seconds)
2021-08-03 14:14:24 × dschrempf quits (~dominik@070-207.dynamic.dsl.fonira.net) (Client Quit)
2021-08-03 14:14:52 <lechner> srid[m]: Hi, thanks for the link! Is that different from using Hugo with Jamstack (aside from your Haskell DSL)?
2021-08-03 14:15:34 chris joins (~chris@81.96.113.213)
2021-08-03 14:15:37 chris is now known as Guest9336
2021-08-03 14:16:49 <merijn> The only downside is that I lose my elegantly minimal dependencies :p
2021-08-03 14:17:12 <srid[m]> There is not Haskell DSL. It just converts a folder of Markdown notes to a website, which can be themed fully using Heist HTML templates, and optionally configured using .yml files lechner

All times are in UTC.