2022/08/23

2022-08-23 00:00:18 +0200FinnElija(~finn_elij@user/finn-elija/x-0085643)
2022-08-23 00:04:39 +0200 <zzz> haskell doesn't really need syntax highlighting honestly. just keywords like data, type, newtype, let, where... maybe symbols vs letters
2022-08-23 00:04:52 +0200 <zzz> dim comments
2022-08-23 00:05:11 +0200 <zzz> but anything else is pretty much unnecessary
2022-08-23 00:05:56 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
2022-08-23 00:06:24 +0200merijn(~merijn@c-001-001-007.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds)
2022-08-23 00:07:25 +0200FinnElija(~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection)
2022-08-23 00:07:56 +0200FinnElija(~finn_elij@user/finn-elija/x-0085643)
2022-08-23 00:11:05 +0200causal(~user@50.35.83.177)
2022-08-23 00:11:33 +0200sakura(~sakura@cpc118064-lewi21-2-0-cust98.2-4.cable.virginm.net) (Quit: Leaving)
2022-08-23 00:14:09 +0200raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
2022-08-23 00:15:49 +0200ralu1(~ralu@static.211.245.203.116.clients.your-server.de)
2022-08-23 00:20:08 +0200hgolden(~hgolden2@cpe-172-251-233-141.socal.res.rr.com)
2022-08-23 00:20:13 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-08-23 00:24:32 +0200matthewmosior(~matthewmo@173.170.253.91) (Ping timeout: 256 seconds)
2022-08-23 00:25:41 +0200mmhat(~mmh@p200300f1c7086050ee086bfffe095315.dip0.t-ipconnect.de) (Ping timeout: 255 seconds)
2022-08-23 00:29:55 +0200AlexZenon(~alzenon@178.34.150.204) (Ping timeout: 268 seconds)
2022-08-23 00:30:35 +0200hgolden(~hgolden2@cpe-172-251-233-141.socal.res.rr.com) (Remote host closed the connection)
2022-08-23 00:30:46 +0200Alex_test(~al_test@178.34.150.204) (Ping timeout: 256 seconds)
2022-08-23 00:31:36 +0200azimut_(~azimut@gateway/tor-sasl/azimut)
2022-08-23 00:32:28 +0200azimut(~azimut@gateway/tor-sasl/azimut) (Ping timeout: 268 seconds)
2022-08-23 00:32:35 +0200acidjnk(~acidjnk@p200300d6e7137a19a561eed7706d09b0.dip0.t-ipconnect.de) (Ping timeout: 248 seconds)
2022-08-23 00:33:50 +0200eikke(~nicolas@88.126.78.98) (Quit: leaving)
2022-08-23 00:36:59 +0200Sgeo(~Sgeo@user/sgeo)
2022-08-23 00:37:06 +0200Alex_test(~al_test@178.34.150.204)
2022-08-23 00:37:18 +0200AlexZenon(~alzenon@178.34.150.204)
2022-08-23 00:38:22 +0200mmhat(~mmh@p200300f1c7086024ee086bfffe095315.dip0.t-ipconnect.de)
2022-08-23 00:43:55 +0200ChaiTRex(~ChaiTRex@user/chaitrex) (Remote host closed the connection)
2022-08-23 00:43:55 +0200FinnElija(~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection)
2022-08-23 00:43:55 +0200azimut_(~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection)
2022-08-23 00:44:26 +0200FinnElija(~finn_elij@user/finn-elija/x-0085643)
2022-08-23 00:44:28 +0200azimut(~azimut@gateway/tor-sasl/azimut)
2022-08-23 00:44:32 +0200ChaiTRex(~ChaiTRex@user/chaitrex)
2022-08-23 00:46:24 +0200money(~Gambino@pool-100-11-18-203.phlapa.fios.verizon.net)
2022-08-23 00:46:54 +0200finsternis(~X@23.226.237.192)
2022-08-23 00:49:55 +0200jao(~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net)
2022-08-23 00:52:39 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-08-23 00:54:49 +0200ChaiTRex(~ChaiTRex@user/chaitrex) (Remote host closed the connection)
2022-08-23 00:55:21 +0200ChaiTRex(~ChaiTRex@user/chaitrex)
2022-08-23 00:55:34 +0200Tuplanolla(~Tuplanoll@91-159-69-12.elisa-laajakaista.fi) (Quit: Leaving.)
2022-08-23 00:57:11 +0200matthewmosior(~matthewmo@173.170.253.91) (Ping timeout: 255 seconds)
2022-08-23 00:58:49 +0200 <qrpnxz> finally gonna get to use the Tenet Monad (forward and backwards state transformer) xDD. Love this thing.
2022-08-23 00:59:59 +0200jgeerds(~jgeerds@55d46bad.access.ecotel.net) (Ping timeout: 252 seconds)
2022-08-23 01:00:47 +0200 <qrpnxz> or damn, i could just use a stream. lol interesting!
2022-08-23 01:02:31 +0200Successus(~Successus@user/Successus) (Ping timeout: 256 seconds)
2022-08-23 01:02:34 +0200money(~Gambino@pool-100-11-18-203.phlapa.fios.verizon.net) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2022-08-23 01:03:17 +0200beteigeuze(~Thunderbi@bl11-28-222.dsl.telepac.pt) (Ping timeout: 252 seconds)
2022-08-23 01:04:09 +0200Successus(~Successus@user/Successus)
2022-08-23 01:04:33 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2022-08-23 01:06:17 +0200 <dsal> qrpnxz: tardis
2022-08-23 01:06:30 +0200 <qrpnxz> better known as tardis monad yes :)
2022-08-23 01:06:50 +0200 <qrpnxz> i think Tenet fits better, but hey
2022-08-23 01:06:57 +0200 <qrpnxz> not bad either
2022-08-23 01:07:08 +0200 <dsal> Someone didn't grow up with Doctor Who. :p
2022-08-23 01:07:14 +0200 <dsal> I've only ever used tardis to confuse people.
2022-08-23 01:07:36 +0200 <hpc> chronologically, almost everyone alive grew up with doctor who :D
2022-08-23 01:07:46 +0200 <dsal> haha
2022-08-23 01:07:57 +0200 <qrpnxz> yeah i didn't, but i have watched and rewatched from eccleston to capaldi
2022-08-23 01:08:01 +0200 <qrpnxz> good show
2022-08-23 01:08:58 +0200 <dsal> I recently watched Whittaker. I liked it.
2022-08-23 01:09:34 +0200 <qrpnxz> i like her, but i don't like the writing of the new one. Hope it get better.
2022-08-23 01:10:16 +0200 <dsal> More actual history telling stories that people don't actually know that well. I appreciated that part.
2022-08-23 01:13:10 +0200chexum(~quassel@gateway/tor-sasl/chexum) (Ping timeout: 268 seconds)
2022-08-23 01:13:30 +0200chexum(~quassel@gateway/tor-sasl/chexum)
2022-08-23 01:13:51 +0200wonko(~wjc@2a0e:1c80:2::130)
2022-08-23 01:16:04 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex)
2022-08-23 01:18:47 +0200wonko(~wjc@2a0e:1c80:2::130) (Ping timeout: 244 seconds)
2022-08-23 01:21:15 +0200raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 252 seconds)
2022-08-23 01:27:16 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-08-23 01:28:23 +0200jero98772(~jero98772@2800:484:1d80:d8ce:efcc:cbb3:7f2a:6dff)
2022-08-23 01:29:09 +0200faultline(~christian@200116b82b104e00fb802468084b9d47.dip.versatel-1u1.de) (Ping timeout: 256 seconds)
2022-08-23 01:29:34 +0200 <sm> https://hackage.haskell.org/package/breakpoint seems quite useful. Am I right in thinking a plugin like this is cheap to have enabled all the time, no significant impact on compilation ?
2022-08-23 01:30:50 +0200zebrag(~chris@user/zebrag) (Read error: Connection reset by peer)
2022-08-23 01:31:05 +0200zebrag(~chris@user/zebrag)
2022-08-23 01:31:58 +0200matthewmosior(~matthewmo@173.170.253.91) (Ping timeout: 256 seconds)
2022-08-23 01:37:32 +0200Successus(~Successus@user/Successus) ()
2022-08-23 01:39:52 +0200kannon(~NK@135-180-47-54.fiber.dynamic.sonic.net)
2022-08-23 01:40:58 +0200dkh^(~dkh@96.70.11.181)
2022-08-23 01:48:56 +0200califax(~califax@user/califx) (Ping timeout: 268 seconds)
2022-08-23 01:49:26 +0200mvk(~mvk@2607:fea8:5ce3:8500::a1ec)
2022-08-23 01:50:00 +0200 <Benzi-Junior> hey, is there a way for me to declare a constant without giving it's type
2022-08-23 01:50:04 +0200califax(~califax@user/califx)
2022-08-23 01:50:19 +0200 <hpc> yes
2022-08-23 01:50:20 +0200 <dibblego> x = "hi"
2022-08-23 01:50:32 +0200 <Benzi-Junior> i.e. I want something like "myConst :: Num a -> a"
2022-08-23 01:50:40 +0200 <dibblego> x = 9
2022-08-23 01:50:50 +0200 <hpc> :t let x = 5 in x
2022-08-23 01:50:52 +0200 <lambdabot> Num p => p
2022-08-23 01:51:36 +0200 <hpc> haskell's type inference (without extensions) can infer types for any valid code, so you technically never need to write a type signature
2022-08-23 01:52:23 +0200kannon(~NK@135-180-47-54.fiber.dynamic.sonic.net) (Ping timeout: 244 seconds)
2022-08-23 01:52:42 +0200 <hpc> type checking and type inference are basically the same equations in the opposite direction, but that's a whole other topic :D
2022-08-23 01:54:01 +0200 <dsal> Benzi-Junior: myConst :: Num a -> a is a function. Do you mean `myConst :: Num a => a` ?
2022-08-23 01:54:16 +0200 <dsal> Actually, not a function, just invalid syntax.
2022-08-23 01:57:33 +0200 <Benzi-Junior> so the problem I'm having is that I have a type signature for most of my functions, and pretty much every one is a "Floating a => ..." and for one of the functions I wanted to hard code this constant (because it was that or add an extra variable to the type signature of every function) but when I added it I got a "no instance of Double arising from Floating a" error and if I try to give it the
2022-08-23 01:57:35 +0200 <Benzi-Junior> type "Floating a => a" I get an illegal type signature error
2022-08-23 01:57:41 +0200 <Benzi-Junior> dsal: yes
2022-08-23 01:57:46 +0200motersen_(~motersen@user/motersen)
2022-08-23 01:58:11 +0200motersen(~motersen@user/motersen) (Ping timeout: 268 seconds)
2022-08-23 01:58:35 +0200 <c_wraith> "no instance of Double" tells me you put (Double a) as a constraint on something
2022-08-23 01:58:36 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-08-23 01:58:45 +0200 <c_wraith> but Double is a type, not a class
2022-08-23 02:02:35 +0200merijn(~merijn@c-001-001-007.client.esciencecenter.eduvpn.nl)
2022-08-23 02:02:53 +0200matthewmosior(~matthewmo@173.170.253.91) (Ping timeout: 255 seconds)
2022-08-23 02:04:03 +0200 <Benzi-Junior> c_wraith: yes, the issue is that since I'm doing a calculation with the constant all of the variables which I wanted to have just a "Floating a" constraint get constrained to the type myConstant, which is Double but I want to leave the type of this constant ambiguous (it's just a placeholder until I get a more complete problem specification anyways) only constrained by "Floating a"
2022-08-23 02:05:03 +0200 <c_wraith> I think you missed my point. that error message directly implies you've conflated types and classes. fix that first!
2022-08-23 02:06:20 +0200polyphem_(~rod@2a02:810d:840:8754:224e:f6ff:fe5e:bc17) (Ping timeout: 244 seconds)
2022-08-23 02:06:36 +0200hgolden(~hgolden2@cpe-172-251-233-141.socal.res.rr.com)
2022-08-23 02:06:42 +0200 <geekosaur> Benzi-Junior, I think you need to pastebin an actual example plus full error message
2022-08-23 02:06:45 +0200 <geekosaur> @where paste
2022-08-23 02:06:45 +0200 <lambdabot> Help us help you: please paste full code, input and/or output at e.g. https://paste.tomsmeding.com
2022-08-23 02:07:23 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-08-23 02:08:13 +0200 <lbseale> I'm trying to parse a big text file (~1.5m lines, 316MB). It needs to find certain lines and save their line numbers. I wrote something with attoparsec that works on a small subset of the file, but is super slow on the whole thing. I haven't implemented any kind of streaming library, could that be it?
2022-08-23 02:09:02 +0200 <c_wraith> possibly, if you're holding on to a large portion of the contents of the file.
2022-08-23 02:09:40 +0200 <c_wraith> but it's more likely that your grammar has triggered some backtracking case and there's some O(n²) logic someplace
2022-08-23 02:09:44 +0200 <lbseale> It saves them into an IntMap, maybe 30 lines out of every 20000
2022-08-23 02:09:59 +0200 <lbseale> Hm yeah that sounds more like it
2022-08-23 02:10:00 +0200 <dsal> lbseale: There's a conduit attoparsec thing that should manage that pretty well if a line is an independent unit.
2022-08-23 02:11:02 +0200polyphem_(~rod@2a02:810d:840:8754:224e:f6ff:fe5e:bc17)
2022-08-23 02:11:34 +0200 <Benzi-Junior> geekosaur: nevermind, I should have the full spech to be able to get rid of this issue tomorrow, not really worth burning through cycles for
2022-08-23 02:11:43 +0200 <lbseale> Ok that sounds good. The way I'm tracking the line numbers is unsatisfying. I'm kinda parsing them as I parse what I care about
2022-08-23 02:11:55 +0200 <lbseale> It feels like there should be a better way
2022-08-23 02:12:22 +0200 <c_wraith> oh, yikes. that definitely sounds like a performance trap.
2022-08-23 02:12:34 +0200Polo(~Gambino@user/polo)
2022-08-23 02:12:51 +0200mmhat(~mmh@p200300f1c7086024ee086bfffe095315.dip0.t-ipconnect.de) (Quit: WeeChat 3.6)
2022-08-23 02:13:44 +0200segfaultfizzbuzz(~segfaultf@192-184-223-154.static.sonic.net)
2022-08-23 02:13:51 +0200matthewmosior(~matthewmo@173.170.253.91) (Remote host closed the connection)
2022-08-23 02:13:58 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-08-23 02:14:17 +0200Polo(~Gambino@user/polo) (Client Quit)
2022-08-23 02:14:25 +0200justsomeguy(~justsomeg@user/justsomeguy)
2022-08-23 02:14:34 +0200 <segfaultfizzbuzz> okay so if i am on an m1 is there a favored way to use haskell (like,... cabal?) or is that still in flux
2022-08-23 02:15:49 +0200 <dsal> I've been on m1 since it came out. I mostly just use nix, but ghcup should also work for you.
2022-08-23 02:17:40 +0200 <segfaultfizzbuzz> install ghcup via curl?
2022-08-23 02:18:11 +0200gurkenglas(~gurkengla@p548ac72e.dip0.t-ipconnect.de) (Ping timeout: 248 seconds)
2022-08-23 02:19:02 +0200 <lbseale> c_wraith: do you have thoughts on how to do this? At a small scale, I would do something like zip the lines with their numbers and parse that. Would that idea work for this?
2022-08-23 02:19:54 +0200 <lbseale> Or maybe do something like find the lines I want without their numbers, then do another pass and find what number they're on? That seems dumb because I should only have to do one pass
2022-08-23 02:19:57 +0200 <c_wraith> it's how I'd start, but I'd keep an eye on memory use.
2022-08-23 02:20:43 +0200 <c_wraith> something that handles streaming the file line-by-line would be my next step if that gave me trouble.
2022-08-23 02:21:03 +0200 <c_wraith> any of the streaming libraries handle that case well enough
2022-08-23 02:21:30 +0200 <lbseale> Ok I think looking into streaming is the next step
2022-08-23 02:21:37 +0200 <lbseale> Ty
2022-08-23 02:22:15 +0200motersen_(~motersen@user/motersen) (Remote host closed the connection)
2022-08-23 02:23:21 +0200motersen(~motersen@user/motersen)
2022-08-23 02:23:48 +0200 <segfaultfizzbuzz> ghcup installs 8.10.7 instead of 9.x,...
2022-08-23 02:24:33 +0200 <c_wraith> 8.10.7 is still the latest release that people are confident doesn't have issues.
2022-08-23 02:24:41 +0200 <segfaultfizzbuzz> i see ok. thanks :-)
2022-08-23 02:24:48 +0200 <c_wraith> but ghcup knows about a lot more versions
2022-08-23 02:25:04 +0200 <c_wraith> try "ghcup tui" to see what it knows about
2022-08-23 02:25:18 +0200 <segfaultfizzbuzz> oh fun :-)
2022-08-23 02:25:46 +0200 <segfaultfizzbuzz> i assume this is a haskell tui library? if so which?
2022-08-23 02:27:20 +0200 <c_wraith> looks like brick, based on its cabal file
2022-08-23 02:28:14 +0200 <segfaultfizzbuzz> ok thanks i will go try to hack bye
2022-08-23 02:28:16 +0200segfaultfizzbuzz(~segfaultf@192-184-223-154.static.sonic.net) (Quit: segfaultfizzbuzz)
2022-08-23 02:29:47 +0200jpds1(~jpds@gateway/tor-sasl/jpds) (Remote host closed the connection)
2022-08-23 02:29:53 +0200dos__^^(~user@user/dos/x-1723657) (Read error: Connection reset by peer)
2022-08-23 02:30:58 +0200jpds1(~jpds@gateway/tor-sasl/jpds)
2022-08-23 02:33:07 +0200justsomeguy(~justsomeg@user/justsomeguy) (Ping timeout: 248 seconds)
2022-08-23 02:34:43 +0200vglfr(~vglfr@145.224.94.72) (Ping timeout: 248 seconds)
2022-08-23 02:36:01 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
2022-08-23 02:36:51 +0200merijn(~merijn@c-001-001-007.client.esciencecenter.eduvpn.nl) (Ping timeout: 248 seconds)
2022-08-23 02:40:20 +0200vysn(~vysn@user/vysn)
2022-08-23 02:52:18 +0200mvk(~mvk@2607:fea8:5ce3:8500::a1ec) (Ping timeout: 244 seconds)
2022-08-23 02:54:19 +0200 <Axman6> lbseale: is there anything wrong with doing filter (isJust . snd) . zipWith (\n l -> (n, parse myParser l)) [0..] . lines $ myData ?
2022-08-23 03:00:15 +0200[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470) (Ping timeout: 252 seconds)
2022-08-23 03:04:34 +0200[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470)
2022-08-23 03:08:31 +0200money_(~Gambino@pool-100-11-18-203.phlapa.fios.verizon.net)
2022-08-23 03:09:08 +0200matthewmosior(~matthewmo@173.170.253.91) (Remote host closed the connection)
2022-08-23 03:10:23 +0200xff0x(~xff0x@2405:6580:b080:900:732a:bfb0:2264:97bb) (Ping timeout: 244 seconds)
2022-08-23 03:10:34 +0200albet70(~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection)
2022-08-23 03:10:56 +0200stef204(~stef204@user/stef204) (Quit: WeeChat 3.6)
2022-08-23 03:12:20 +0200azimut(~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection)
2022-08-23 03:13:16 +0200azimut(~azimut@gateway/tor-sasl/azimut)
2022-08-23 03:14:12 +0200Midjak(~Midjak@82.66.147.146) (Quit: This computer has gone to sleep)
2022-08-23 03:15:20 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2022-08-23 03:16:41 +0200albet70(~xxx@2400:8902::f03c:92ff:fe60:98d8)
2022-08-23 03:17:56 +0200nate4(~nate@98.45.169.16)
2022-08-23 03:18:08 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-08-23 03:21:30 +0200segfaultfizzbuzz(~segfaultf@192-184-223-154.static.sonic.net)
2022-08-23 03:22:01 +0200 <segfaultfizzbuzz> i ran into llvm missing when trying to run cabal build after installing via ghcup despite having used brew to install llvm,...
2022-08-23 03:22:16 +0200matthewmosior(~matthewmo@173.170.253.91) (Ping timeout: 244 seconds)
2022-08-23 03:23:03 +0200nate4(~nate@98.45.169.16) (Ping timeout: 256 seconds)
2022-08-23 03:23:21 +0200money_(~Gambino@pool-100-11-18-203.phlapa.fios.verizon.net) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2022-08-23 03:25:03 +0200abraham(~abraham@159.89.183.132)
2022-08-23 03:26:55 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-08-23 03:32:29 +0200pieguy128_(~pieguy128@bas8-montreal02-65-93-195-183.dsl.bell.ca) (Ping timeout: 268 seconds)
2022-08-23 03:33:23 +0200merijn(~merijn@c-001-001-007.client.esciencecenter.eduvpn.nl)
2022-08-23 03:34:23 +0200 <maerwald[m]> segfaultfizzbuzz: needs to be in PATH
2022-08-23 03:34:49 +0200 <segfaultfizzbuzz> i'll check up on that but brew in my experience normally takes care of that (??)
2022-08-23 03:35:25 +0200 <geekosaur> brew has casks, especially for things that can be installed with multiple versions like llvm
2022-08-23 03:35:39 +0200 <geekosaur> it's on you to add the appropriate cask to $PATH
2022-08-23 03:36:38 +0200 <segfaultfizzbuzz> oh it's because people commonly use different versions and are quite sensitive to the version number, ok
2022-08-23 03:39:04 +0200dkh^(~dkh@96.70.11.181) (Remote host closed the connection)
2022-08-23 03:42:47 +0200machinedgod(~machinedg@d198-53-218-113.abhsia.telus.net) (Ping timeout: 252 seconds)
2022-08-23 03:45:42 +0200waleee(~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Ping timeout: 256 seconds)
2022-08-23 03:45:43 +0200euandreh(~euandreh@179.214.113.107) (Ping timeout: 252 seconds)
2022-08-23 03:47:11 +0200fserucas(~fserucas@89.214.149.93) (Ping timeout: 252 seconds)
2022-08-23 03:49:28 +0200euandreh(~euandreh@179.214.113.107)
2022-08-23 03:52:45 +0200azimut(~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection)
2022-08-23 03:53:03 +0200azimut(~azimut@gateway/tor-sasl/azimut)
2022-08-23 03:54:36 +0200xff0x(~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp)
2022-08-23 03:56:51 +0200segfaultfizzbuzz(~segfaultf@192-184-223-154.static.sonic.net) (Ping timeout: 248 seconds)
2022-08-23 04:03:01 +0200money(~Gambino@pool-100-11-18-203.phlapa.fios.verizon.net)
2022-08-23 04:05:57 +0200finn_elija(~finn_elij@user/finn-elija/x-0085643)
2022-08-23 04:05:57 +0200FinnElija(~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija)))
2022-08-23 04:05:57 +0200finn_elijaFinnElija
2022-08-23 04:07:43 +0200merijn(~merijn@c-001-001-007.client.esciencecenter.eduvpn.nl) (Ping timeout: 252 seconds)
2022-08-23 04:10:36 +0200abraham(~abraham@159.89.183.132) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2022-08-23 04:10:38 +0200bontaq(~user@ool-45779fe5.dyn.optonline.net) (Ping timeout: 256 seconds)
2022-08-23 04:11:27 +0200abraham(~abraham@159.89.183.132)
2022-08-23 04:12:01 +0200kannon(~NK@135-180-47-54.fiber.dynamic.sonic.net)
2022-08-23 04:14:06 +0200money(~Gambino@pool-100-11-18-203.phlapa.fios.verizon.net) (Remote host closed the connection)
2022-08-23 04:15:44 +0200[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470) (Remote host closed the connection)
2022-08-23 04:16:49 +0200zebrag(~chris@user/zebrag) (Quit: Konversation terminated!)
2022-08-23 04:17:55 +0200matthewmosior(~matthewmo@173.170.253.91) (Remote host closed the connection)
2022-08-23 04:18:01 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-08-23 04:18:34 +0200td_(~td@muedsl-82-207-238-019.citykom.de) (Ping timeout: 256 seconds)
2022-08-23 04:19:24 +0200ChaiTRex(~ChaiTRex@user/chaitrex) (Ping timeout: 268 seconds)
2022-08-23 04:19:41 +0200kannon(~NK@135-180-47-54.fiber.dynamic.sonic.net) (Ping timeout: 255 seconds)
2022-08-23 04:20:13 +0200dsrt^(~dsrt@96.70.11.181)
2022-08-23 04:20:16 +0200td_(~td@muedsl-82-207-238-030.citykom.de)
2022-08-23 04:20:32 +0200abraham(~abraham@159.89.183.132) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2022-08-23 04:21:33 +0200abraham(~abraham@159.89.183.132)
2022-08-23 04:22:55 +0200kimjetwav(~user@2607:fea8:235e:b600:ed0:fc28:dc0a:d8c3)
2022-08-23 04:28:35 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection)
2022-08-23 04:29:12 +0200nate4(~nate@98.45.169.16)
2022-08-23 04:29:45 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex)
2022-08-23 04:29:47 +0200ezzieyguywuf(~Unknown@user/ezzieyguywuf) (Remote host closed the connection)
2022-08-23 04:29:51 +0200abraham(~abraham@159.89.183.132) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2022-08-23 04:33:04 +0200segfaultfizzbuzz(~segfaultf@192-184-223-154.static.sonic.net)
2022-08-23 04:33:16 +0200vglfr(~vglfr@145.224.94.199)
2022-08-23 04:34:02 +0200jargon(~jargon@174-22-194-180.phnx.qwest.net) (Remote host closed the connection)
2022-08-23 04:35:05 +0200ezzieyguywuf(~Unknown@user/ezzieyguywuf)
2022-08-23 04:37:56 +0200wrengr(~wrengr@201.59.83.34.bc.googleusercontent.com) (Quit: leaving)
2022-08-23 04:40:39 +0200ChaiTRex(~ChaiTRex@user/chaitrex)
2022-08-23 04:42:08 +0200jao(~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Ping timeout: 268 seconds)
2022-08-23 04:42:22 +0200nate4(~nate@98.45.169.16) (Ping timeout: 256 seconds)
2022-08-23 04:42:49 +0200terrorjack(~terrorjac@2a01:4f8:1c1e:509a::1) (Quit: The Lounge - https://thelounge.chat)
2022-08-23 04:43:49 +0200terrorjack(~terrorjac@2a01:4f8:1c1e:509a::1)
2022-08-23 04:46:36 +0200nate4(~nate@2600:1010:b06b:152:9c94:ff0b:6bbb:1d01)
2022-08-23 04:46:42 +0200kannon(~NK@135-180-47-54.fiber.dynamic.sonic.net)
2022-08-23 04:46:46 +0200pieguy128(~pieguy128@bras-base-mtrlpq5031w-grc-49-67-70-103-208.dsl.bell.ca)
2022-08-23 04:51:08 +0200kannon(~NK@135-180-47-54.fiber.dynamic.sonic.net) (Ping timeout: 244 seconds)
2022-08-23 04:56:17 +0200ChaiTRex(~ChaiTRex@user/chaitrex) (Remote host closed the connection)
2022-08-23 04:56:28 +0200polykernel[m](~polykerne@user/polykernel)
2022-08-23 04:56:46 +0200ChaiTRex(~ChaiTRex@user/chaitrex)
2022-08-23 04:58:51 +0200jargon(~jargon@174-22-194-180.phnx.qwest.net)
2022-08-23 05:13:55 +0200jero98772(~jero98772@2800:484:1d80:d8ce:efcc:cbb3:7f2a:6dff) (Remote host closed the connection)
2022-08-23 05:14:16 +0200Kaipei(~Kaiepi@142.68.249.28)
2022-08-23 05:16:51 +0200Kaiepi(~Kaiepi@142.68.249.28) (Ping timeout: 248 seconds)
2022-08-23 05:17:55 +0200segfaultfizzbuzz(~segfaultf@192-184-223-154.static.sonic.net) (Ping timeout: 248 seconds)
2022-08-23 05:23:40 +0200segfaultfizzbuzz(~segfaultf@192-184-223-154.static.sonic.net)
2022-08-23 05:23:47 +0200nate4(~nate@2600:1010:b06b:152:9c94:ff0b:6bbb:1d01) (Ping timeout: 248 seconds)
2022-08-23 05:25:27 +0200vglfr(~vglfr@145.224.94.199) (Ping timeout: 252 seconds)
2022-08-23 05:26:50 +0200nate4(~nate@98.45.169.16)
2022-08-23 05:27:42 +0200kannon(~NK@135-180-47-54.fiber.dynamic.sonic.net)
2022-08-23 05:27:59 +0200tomboy64(~tomboy64@user/tomboy64) (Quit: Off to see the wizard.)
2022-08-23 05:31:04 +0200matthewmosior(~matthewmo@173.170.253.91) (Remote host closed the connection)
2022-08-23 05:31:40 +0200segfaultfizzbuzz(~segfaultf@192-184-223-154.static.sonic.net) (Ping timeout: 256 seconds)
2022-08-23 05:31:57 +0200kannon(~NK@135-180-47-54.fiber.dynamic.sonic.net) (Ping timeout: 244 seconds)
2022-08-23 05:32:14 +0200nate4(~nate@98.45.169.16) (Ping timeout: 256 seconds)
2022-08-23 05:32:15 +0200Vajb(~Vajb@2001:999:705:3c86:e7ea:442b:1e01:22d8) (Read error: Connection reset by peer)
2022-08-23 05:33:04 +0200Vajb(~Vajb@hag-jnsbng11-58c3ad-40.dhcp.inet.fi)
2022-08-23 05:38:00 +0200ddellacosta(~ddellacos@143.244.47.100)
2022-08-23 05:40:08 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-08-23 05:44:43 +0200abraham(~abraham@159.89.183.132)
2022-08-23 05:44:44 +0200matthewmosior(~matthewmo@173.170.253.91) (Ping timeout: 255 seconds)
2022-08-23 05:45:50 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-08-23 05:50:33 +0200matthewmosior(~matthewmo@173.170.253.91) (Ping timeout: 244 seconds)
2022-08-23 05:50:38 +0200vglfr(~vglfr@145.224.94.199)
2022-08-23 05:51:36 +0200vysn(~vysn@user/vysn) (Ping timeout: 244 seconds)
2022-08-23 05:58:53 +0200kannon(~NK@135-180-47-54.fiber.dynamic.sonic.net)
2022-08-23 05:59:34 +0200ChaiTRex(~ChaiTRex@user/chaitrex) (Remote host closed the connection)
2022-08-23 06:00:33 +0200ChaiTRex(~ChaiTRex@user/chaitrex)
2022-08-23 06:03:54 +0200merijn(~merijn@c-001-001-007.client.esciencecenter.eduvpn.nl)
2022-08-23 06:07:16 +0200abraham(~abraham@159.89.183.132) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2022-08-23 06:11:36 +0200shriekingnoise(~shrieking@186.137.167.202) (Quit: Quit)
2022-08-23 06:12:53 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-08-23 06:13:32 +0200fraznel(~fuag1@c-73-221-56-19.hsd1.wa.comcast.net)
2022-08-23 06:15:04 +0200nate4(~nate@98.45.169.16)
2022-08-23 06:16:51 +0200segfaultfizzbuzz(~segfaultf@192-184-223-154.static.sonic.net)
2022-08-23 06:17:35 +0200martin02(~silas@141.84.69.76) (Ping timeout: 256 seconds)
2022-08-23 06:19:43 +0200nate4(~nate@98.45.169.16) (Ping timeout: 252 seconds)
2022-08-23 06:21:37 +0200Vajb(~Vajb@hag-jnsbng11-58c3ad-40.dhcp.inet.fi) (Read error: Connection reset by peer)
2022-08-23 06:21:51 +0200Vajb(~Vajb@2001:999:705:3c86:e7ea:442b:1e01:22d8)
2022-08-23 06:24:13 +0200 <fraznel> i'm running into an issue with postgresql-simple i think gobbling up some useful error messaging. I'm pooling database connections that are used very infrequently. On reading I see that I should probably be using the tcp_keepalive options on my connection string
2022-08-23 06:25:04 +0200 <fraznel> but whats worrying is that in the scenario where the postgresql-simple connection gets dropped, any further queries lock up the thread they are attempting to execute from and dont display any error or whatnot
2022-08-23 06:26:04 +0200 <fraznel> I'm putting in a fix that I assume will fix the problem for a bit via adding the keepalive options on the connection string but was wondering if anyone in here knows of a way to get postgresql-simple to give any feedback on a broken connection
2022-08-23 06:28:20 +0200benin0(~benin@183.82.206.27) (Ping timeout: 256 seconds)
2022-08-23 06:31:13 +0200martin02(~silas@141.84.69.76)
2022-08-23 06:34:38 +0200ChaiTRex(~ChaiTRex@user/chaitrex) (Remote host closed the connection)
2022-08-23 06:35:11 +0200ChaiTRex(~ChaiTRex@user/chaitrex)
2022-08-23 06:35:35 +0200mbuf(~Shakthi@122.165.55.71)
2022-08-23 06:37:58 +0200qrpnxz(~qrpnxz@fsf/member/qrpnxz) (Ping timeout: 256 seconds)
2022-08-23 06:38:03 +0200merijn(~merijn@c-001-001-007.client.esciencecenter.eduvpn.nl) (Ping timeout: 252 seconds)
2022-08-23 06:44:57 +0200nate4(~nate@98.45.169.16)
2022-08-23 06:45:55 +0200 <fraznel> huh, in the docs it says these throw exceptions, I must be eating exceptions from this thread :|
2022-08-23 06:49:25 +0200nate4(~nate@98.45.169.16) (Ping timeout: 252 seconds)
2022-08-23 06:51:19 +0200lisbeths(uid135845@id-135845.lymington.irccloud.com)
2022-08-23 07:08:42 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2022-08-23 07:09:29 +0200 <Axman6> Is there an applicative newtype wrapper that runs effects in the reverse order? (Foo af) <*> (Foo ax) = Foo ((\x f -> f x) <$> ax <*> af)
2022-08-23 07:09:35 +0200hgolden(~hgolden2@cpe-172-251-233-141.socal.res.rr.com) (Quit: Konversation terminated!)
2022-08-23 07:09:56 +0200hgolden(~hgolden2@cpe-172-251-233-141.socal.res.rr.com)
2022-08-23 07:10:30 +0200 <Axman6> fraznel: sounds worth making an issue oni the project for, particularly if the behaviour seems to not math the docs, or it's confusing
2022-08-23 07:11:44 +0200 <Axman6> Re: above, we have some code that does reverse <*> mapM f (reverse xs) and I was wondering if we could avoid the double reverse (also trying to decide if it would actually be beneficial)
2022-08-23 07:19:21 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2022-08-23 07:20:35 +0200segfaultfizzbuzz(~segfaultf@192-184-223-154.static.sonic.net) (Ping timeout: 248 seconds)
2022-08-23 07:25:31 +0200 <fraznel> Axman6, roger that, will do
2022-08-23 07:29:36 +0200hgolden(~hgolden2@cpe-172-251-233-141.socal.res.rr.com) (Quit: Konversation terminated!)
2022-08-23 07:30:37 +0200hgolden(~hgolden2@cpe-172-251-233-141.socal.res.rr.com)
2022-08-23 07:42:00 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2022-08-23 07:44:54 +0200pagnol(~me@213-205-209-87.ftth.glasoperator.nl)
2022-08-23 07:48:27 +0200nilradical(~nilradica@user/naso)
2022-08-23 07:51:58 +0200kimjetwav(~user@2607:fea8:235e:b600:ed0:fc28:dc0a:d8c3) (Ping timeout: 244 seconds)
2022-08-23 07:52:40 +0200zeenk(~zeenk@2a02:2f04:a311:2d00:6865:d863:4c93:799f)
2022-08-23 07:53:04 +0200nate4(~nate@98.45.169.16)
2022-08-23 07:56:22 +0200nilradical(~nilradica@user/naso) (Remote host closed the connection)
2022-08-23 07:57:52 +0200nate4(~nate@98.45.169.16) (Ping timeout: 256 seconds)
2022-08-23 08:07:28 +0200kannon(~NK@135-180-47-54.fiber.dynamic.sonic.net) (Ping timeout: 244 seconds)
2022-08-23 08:08:37 +0200 <jackdk> Axman6: https://hackage.haskell.org/package/transformers-0.6.0.4/docs/Control-Applicative-Backwards.html
2022-08-23 08:08:59 +0200 <jackdk> Also `Compose Dual Ap`, possibly?
2022-08-23 08:14:43 +0200kannon(~NK@135-180-47-54.fiber.dynamic.sonic.net)
2022-08-23 08:15:19 +0200 <pareto-optimal-d> <fraznel> "I'm putting in a fix that I..." <- You probably want this:
2022-08-23 08:15:19 +0200 <pareto-optimal-d> https://github.com/haskellari/postgresql-simple/pull/71
2022-08-23 08:16:31 +0200nilradical(~nilradica@user/naso)
2022-08-23 08:22:36 +0200jakalx(~jakalx@base.jakalx.net) ()
2022-08-23 08:26:02 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2022-08-23 08:27:08 +0200 <fraznel> pareto-optimal-d: thats super useful :) Thanks!
2022-08-23 08:28:20 +0200 <pareto-optimal-d> fraznel: Have fun on the async exceptions resource cleanup rabbit hole!
2022-08-23 08:29:25 +0200 <fraznel> yeah it looks scary, and i'm doing this inside a thread as well. set this stuff up long ago and need to take out the shovel and dig at what exceptions work where again...
2022-08-23 08:30:44 +0200 <fraznel> seems like even with that fix i should be using something like safe-exceptions to do clean up w.r.t ResourcePool
2022-08-23 08:30:51 +0200 <fraznel> er, Data.Pool
2022-08-23 08:31:47 +0200 <fraznel> wait, pool is supposed to handle that... hopefully the core issue was postgresql eating the exception and now things will "just work"
2022-08-23 08:32:04 +0200 <fraznel> unlikely but that's what i'm going to tell myself till the server falls over next :P
2022-08-23 08:34:28 +0200merijn(~merijn@c-001-001-007.client.esciencecenter.eduvpn.nl)
2022-08-23 08:34:59 +0200nilradical(~nilradica@user/naso) (Remote host closed the connection)
2022-08-23 08:36:05 +0200nilradical(~nilradica@user/naso)
2022-08-23 08:36:09 +0200 <pareto-optimal-d> That PR and using safe-exceptions should solve Data.Pool being poisoned with broken postgres connections.
2022-08-23 08:38:13 +0200nilradical(~nilradica@user/naso) (Remote host closed the connection)
2022-08-23 08:38:29 +0200nilradical(~nilradica@user/naso)
2022-08-23 08:39:15 +0200jakalx(~jakalx@base.jakalx.net)
2022-08-23 08:40:52 +0200mmhat(~mmh@p200300f1c7086024ee086bfffe095315.dip0.t-ipconnect.de)
2022-08-23 08:41:45 +0200 <dminuoso> tomsmeding: Fun thing, it turns out Andrew Martin has stepped into similar issues with regards to pretty printing, and ended up writing a custom builder for very short strings in his `ip` package. (Well in fact he build packages bytebuild and bytesmith to deal with this in a generalized manner)
2022-08-23 08:42:43 +0200 <dminuoso> It would be nice if I could just reuse my ShortByteString buffers in an UTF8 buffer, but `ip` incurs a `text < 1.3` constraint.
2022-08-23 08:43:07 +0200 <dminuoso> Does GHC come with some interleaveZero C function to copy an ASCII buffer into a UTF8 buffer?
2022-08-23 08:43:10 +0200 <dminuoso> *UTF16
2022-08-23 08:45:11 +0200califax(~califax@user/califx) (Ping timeout: 268 seconds)
2022-08-23 08:45:11 +0200adanwan(~adanwan@gateway/tor-sasl/adanwan) (Ping timeout: 268 seconds)
2022-08-23 08:45:57 +0200adanwan(~adanwan@gateway/tor-sasl/adanwan)
2022-08-23 08:46:04 +0200azimut_(~azimut@gateway/tor-sasl/azimut)
2022-08-23 08:46:23 +0200califax(~califax@user/califx)
2022-08-23 08:46:25 +0200azimut(~azimut@gateway/tor-sasl/azimut) (Ping timeout: 268 seconds)
2022-08-23 08:47:02 +0200ChaiTRex(~ChaiTRex@user/chaitrex) (Ping timeout: 268 seconds)
2022-08-23 08:47:02 +0200jpds1(~jpds@gateway/tor-sasl/jpds) (Ping timeout: 268 seconds)
2022-08-23 08:47:02 +0200chexum(~quassel@gateway/tor-sasl/chexum) (Ping timeout: 268 seconds)
2022-08-23 08:47:02 +0200stiell(~stiell@gateway/tor-sasl/stiell) (Ping timeout: 268 seconds)
2022-08-23 08:47:36 +0200chexum(~quassel@gateway/tor-sasl/chexum)
2022-08-23 08:47:48 +0200Sgeo(~Sgeo@user/sgeo) (Read error: Connection reset by peer)
2022-08-23 08:47:57 +0200 <fraznel> pareto-optimal-d, thanks, that link is gold, i need to work on a repro for the failure case in isolation but will chime in on that pr, hopefully it gets merged soon
2022-08-23 08:49:15 +0200ChaiTRex(~ChaiTRex@user/chaitrex)
2022-08-23 08:49:53 +0200adanwan(~adanwan@gateway/tor-sasl/adanwan) (Client Quit)
2022-08-23 08:50:25 +0200stiell(~stiell@gateway/tor-sasl/stiell)
2022-08-23 08:51:38 +0200jpds1(~jpds@gateway/tor-sasl/jpds)
2022-08-23 08:51:46 +0200alternateved(~user@staticline-31-183-146-203.toya.net.pl)
2022-08-23 08:52:17 +0200adanwan(~adanwan@gateway/tor-sasl/adanwan)
2022-08-23 08:53:17 +0200`2jt(~jtomas@56.red-88-17-82.dynamicip.rima-tde.net)
2022-08-23 08:56:22 +0200coot(~coot@213.134.176.158)
2022-08-23 08:57:41 +0200 <pareto-optimal-d> <fraznel> "pareto-optimal-dev, thanks, that..." <- There are some in the related issues
2022-08-23 08:59:04 +0200kannon(~NK@135-180-47-54.fiber.dynamic.sonic.net) (Ping timeout: 256 seconds)
2022-08-23 08:59:36 +0200 <pareto-optimal-d> pareto-optimal-d: https://github.com/haskellari/postgresql-simple/issues/69#issuecomment-1167690911
2022-08-23 09:02:06 +0200lortabac(~lortabac@2a01:e0a:541:b8f0:4fe7:bccf:37a6:be4b)
2022-08-23 09:03:09 +0200waldo(~waldo@user/waldo)
2022-08-23 09:08:42 +0200merijn(~merijn@c-001-001-007.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds)
2022-08-23 09:10:49 +0200alternateved(~user@staticline-31-183-146-203.toya.net.pl) (Remote host closed the connection)
2022-08-23 09:13:16 +0200Techcable(~Techcable@user/Techcable)
2022-08-23 09:13:20 +0200alternateved(~user@staticline-31-183-146-203.toya.net.pl)
2022-08-23 09:16:14 +0200matthewmosior(~matthewmo@173.170.253.91) (Ping timeout: 255 seconds)
2022-08-23 09:16:48 +0200cfricke(~cfricke@user/cfricke)
2022-08-23 09:16:50 +0200benin0(~benin@183.82.205.32)
2022-08-23 09:20:19 +0200zaquest(~notzaques@5.130.79.72) (Remote host closed the connection)
2022-08-23 09:21:26 +0200zaquest(~notzaques@5.130.79.72)
2022-08-23 09:21:43 +0200merijn(~merijn@c-001-001-007.client.esciencecenter.eduvpn.nl)
2022-08-23 09:21:48 +0200akegalj(~akegalj@135-40.dsl.iskon.hr)
2022-08-23 09:22:19 +0200nilradical(~nilradica@user/naso) (Remote host closed the connection)
2022-08-23 09:23:23 +0200nilradical(~nilradica@user/naso)
2022-08-23 09:23:54 +0200vysn(~vysn@user/vysn)
2022-08-23 09:24:27 +0200 <akegalj> Is there a way to run `cabal repl` from command line with some package sandboxed. Something like `cabal repl --package vector` which would give me repl with vector installed ?
2022-08-23 09:24:39 +0200azimut_(~azimut@gateway/tor-sasl/azimut) (Ping timeout: 268 seconds)
2022-08-23 09:24:50 +0200 <tomsmeding> akegalj: `cabal repl --build-depends vector`, or shorter `cabal repl -b vector`
2022-08-23 09:24:51 +0200 <dminuoso> `cabal repl --build-depends optics`
2022-08-23 09:25:10 +0200 <tomsmeding> dminuoso: how long are your buffers that you want to interleaveZero
2022-08-23 09:25:28 +0200 <akegalj> thanks <3 , couldn't find that info in cabal --help
2022-08-23 09:25:39 +0200 <dminuoso> tomsmeding: Potentially up to 255 bytes, realistically as long as usual domain labels.
2022-08-23 09:25:54 +0200azimut(~azimut@gateway/tor-sasl/azimut)
2022-08-23 09:26:02 +0200 <dminuoso> akegalj: Try `cabal repl --help`
2022-08-23 09:26:21 +0200merijn(~merijn@c-001-001-007.client.esciencecenter.eduvpn.nl) (Ping timeout: 252 seconds)
2022-08-23 09:26:26 +0200 <dminuoso> akegalj: Right at the bottom, above where your prompt returns, would have been some examples. :)
2022-08-23 09:26:29 +0200 <akegalj> dminuoso: i did, but couldn't find that info... I mean there is a lot of options so I must have missed it
2022-08-23 09:27:49 +0200nilradical(~nilradica@user/naso) (Ping timeout: 252 seconds)
2022-08-23 09:28:14 +0200 <akegalj> dminuoso: there are no examples of said commands when `cabal repl --help` is entered with cabal version 3.0.0.0 on my machine.
2022-08-23 09:28:51 +0200acidjnk(~acidjnk@p200300d6e7137a19a561eed7706d09b0.dip0.t-ipconnect.de)
2022-08-23 09:28:52 +0200 <dminuoso> Consider updating cabal, 3.0.0.0 is over 2 years old already
2022-08-23 09:28:52 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-08-23 09:30:00 +0200rembo10(~rembo10@main.remulis.com) (Quit: ZNC 1.8.2 - https://znc.in)
2022-08-23 09:30:16 +0200 <akegalj> dminuoso: good point
2022-08-23 09:31:04 +0200rembo10(~rembo10@main.remulis.com)
2022-08-23 09:34:13 +0200vysn(~vysn@user/vysn) (Ping timeout: 256 seconds)
2022-08-23 09:35:15 +0200 <sm> well, I'm removing all name shadowing.. it does add noise to the code
2022-08-23 09:35:40 +0200 <tomsmeding> sm: condolences with your '
2022-08-23 09:35:53 +0200`2jt(~jtomas@56.red-88-17-82.dynamicip.rima-tde.net) (Quit: Leaving)
2022-08-23 09:36:08 +0200merijn(~merijn@c-001-001-007.client.esciencecenter.eduvpn.nl)
2022-08-23 09:37:57 +0200jonathanx_(~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
2022-08-23 09:40:36 +0200jonathanx(~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Ping timeout: 268 seconds)
2022-08-23 09:41:32 +0200fserucas(~fserucas@89.214.149.93)
2022-08-23 09:43:49 +0200nattiestnate(~nate@202.138.250.62)
2022-08-23 09:45:25 +0200`2jt(~jtomas@56.red-88-17-82.dynamicip.rima-tde.net)
2022-08-23 09:45:51 +0200`2jt(~jtomas@56.red-88-17-82.dynamicip.rima-tde.net) (Client Quit)
2022-08-23 09:49:57 +0200 <dminuoso> Okay its decided. I will make modifications to haskell-ip to allow for text-2.0, so that I can simply copy the ASCII byte buffers into the underlying text ByteArray#
2022-08-23 09:50:22 +0200 <dminuoso> The other thing would just be a temporary workaround
2022-08-23 09:51:10 +0200chele(~chele@user/chele)
2022-08-23 09:53:26 +0200machinedgod(~machinedg@d198-53-218-113.abhsia.telus.net)
2022-08-23 09:56:50 +0200odnes(~odnes@5-203-132-117.pat.nym.cosmote.net)
2022-08-23 09:57:20 +0200kuribas(~user@ptr-17d51ep2y03n1mswpe5.18120a2.ip6.access.telenet.be)
2022-08-23 09:57:55 +0200machinedgod(~machinedg@d198-53-218-113.abhsia.telus.net) (Ping timeout: 248 seconds)
2022-08-23 09:58:43 +0200machinedgod(~machinedg@d198-53-218-113.abhsia.telus.net)
2022-08-23 10:07:35 +0200jpds1(~jpds@gateway/tor-sasl/jpds) (Remote host closed the connection)
2022-08-23 10:07:35 +0200califax(~califax@user/califx) (Remote host closed the connection)
2022-08-23 10:07:35 +0200FinnElija(~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection)
2022-08-23 10:07:38 +0200 <tomsmeding> dminuoso: https://paste.tomsmeding.com/aRMTTRPu
2022-08-23 10:07:50 +0200 <tomsmeding> requires AVX2
2022-08-23 10:08:20 +0200jpds1(~jpds@gateway/tor-sasl/jpds)
2022-08-23 10:08:24 +0200FinnElija(~finn_elij@user/finn-elija/x-0085643)
2022-08-23 10:08:25 +0200stiell(~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection)
2022-08-23 10:08:26 +0200califax(~califax@user/califx)
2022-08-23 10:09:27 +0200__monty__(~toonn@user/toonn)
2022-08-23 10:09:49 +0200stiell(~stiell@gateway/tor-sasl/stiell)
2022-08-23 10:10:39 +0200chexum(~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection)
2022-08-23 10:10:58 +0200ubert(~Thunderbi@77.119.220.133.wireless.dyn.drei.com)
2022-08-23 10:11:19 +0200stiell(~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection)
2022-08-23 10:11:37 +0200chexum(~quassel@gateway/tor-sasl/chexum)
2022-08-23 10:11:47 +0200stiell(~stiell@gateway/tor-sasl/stiell)
2022-08-23 10:12:03 +0200yvan-sraka(~yvan-srak@laubervilliers-656-1-51-219.w193-252.abo.wanadoo.fr)
2022-08-23 10:13:11 +0200 <dminuoso> Mmm, thats fast enough for an unsafe FFI call - added advantage would that I can just pass the unpinned bytearray buffer in an unsafe call
2022-08-23 10:13:25 +0200 <tomsmeding> (forgot to compile the functions into a separate translation units to prevent inlining; doing that, the times don't really change)
2022-08-23 10:14:13 +0200yvan-sraka(~yvan-srak@laubervilliers-656-1-51-219.w193-252.abo.wanadoo.fr) (Remote host closed the connection)
2022-08-23 10:14:13 +0200 <tomsmeding> YMMV on different CPUs though, so benchmark :p
2022-08-23 10:14:24 +0200yvan-sraka(~yvan-srak@laubervilliers-656-1-51-219.w193-252.abo.wanadoo.fr)
2022-08-23 10:14:52 +0200 <dminuoso> avx/avx2 is available on our hypervisors.
2022-08-23 10:14:59 +0200 <tomsmeding> yay!
2022-08-23 10:15:38 +0200 <tomsmeding> (license public domain, attribution not required)
2022-08-23 10:16:03 +0200 <dminuoso> Cheers, then.
2022-08-23 10:16:22 +0200 <dminuoso> I guess you have experience writing MIMO code?
2022-08-23 10:17:15 +0200coot(~coot@213.134.176.158) (Quit: coot)
2022-08-23 10:22:15 +0200 <dminuoso> tomsmeding: What's that second for-loop doing inside ascii_to_utf16?
2022-08-23 10:22:20 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2022-08-23 10:22:22 +0200 <dminuoso> Is that an accidental left over?
2022-08-23 10:23:01 +0200 <dminuoso> ohh no, hold on. That's just to deal with some modulo 16 leftovers, right?
2022-08-23 10:29:39 +0200nattiestnate(~nate@202.138.250.62) (Quit: WeeChat 3.6)
2022-08-23 10:30:21 +0200nate4(~nate@98.45.169.16)
2022-08-23 10:30:25 +0200 <tomsmeding> dminuoso: indeed to deal with the 100%16 leftover bytes
2022-08-23 10:30:42 +0200 <tomsmeding> I had a course in my masters that dealt with stuff like this :p
2022-08-23 10:31:37 +0200wonko(~wjc@2a0e:1c80:2::130)
2022-08-23 10:32:38 +0200 <tomsmeding> oh it's incorrect :')
2022-08-23 10:32:44 +0200 <tomsmeding> (I hadn't even tested the code)
2022-08-23 10:34:16 +0200matthewmosior(~matthewmo@173.170.253.91) (Ping timeout: 256 seconds)
2022-08-23 10:34:42 +0200 <tomsmeding> oh lol
2022-08-23 10:34:51 +0200 <tomsmeding> heu
2022-08-23 10:35:00 +0200 <int-e> > 256/8
2022-08-23 10:35:02 +0200adanwan(~adanwan@gateway/tor-sasl/adanwan) (Quit: _)
2022-08-23 10:35:04 +0200 <lambdabot> 32.0
2022-08-23 10:35:25 +0200nate4(~nate@98.45.169.16) (Ping timeout: 256 seconds)
2022-08-23 10:35:34 +0200azimut(~azimut@gateway/tor-sasl/azimut) (Ping timeout: 268 seconds)
2022-08-23 10:35:46 +0200adanwan(~adanwan@gateway/tor-sasl/adanwan)
2022-08-23 10:37:31 +0200jgeerds(~jgeerds@55d46bad.access.ecotel.net)
2022-08-23 10:41:20 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
2022-08-23 10:41:49 +0200nilradical(~nilradica@user/naso)
2022-08-23 10:41:56 +0200 <dminuoso> tomsmeding: Im trying to really understand the point of _mm256_unpacklo_epi8 mmm
2022-08-23 10:42:09 +0200 <tomsmeding> yeah that's the instruction where it goes wrong lol, I'm debugging
2022-08-23 10:42:18 +0200 <tomsmeding> that's supposed to do the interleaving
2022-08-23 10:42:31 +0200 <dminuoso> Well, it only interleaves low-order elements
2022-08-23 10:42:41 +0200 <dminuoso> See https://doc.rust-lang.org/core/arch/x86_64/fn._mm256_unpacklo_epi8.html
2022-08-23 10:43:36 +0200 <int-e> but that's fine if you process 16 bytes at a time?
2022-08-23 10:43:38 +0200 <tomsmeding> dminuoso: https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#techs=SSE,SSE2,SSE3,SSSE3…
2022-08-23 10:43:52 +0200nilradical(~nilradica@user/naso) (Remote host closed the connection)
2022-08-23 10:43:59 +0200 <tomsmeding> I'm reading 16 bytes from src, expanding (hopefully) that to 32 bytes with interleaved zeros using unpacklo, then writing 32 bytes to dst
2022-08-23 10:44:11 +0200 <dminuoso> Yeah, I just used the rust one because it had a reasonable presentation of what it does :P
2022-08-23 10:44:48 +0200 <dminuoso> tomsmeding: Check the rust one, can only read 8 and expand to 16
2022-08-23 10:44:49 +0200nilradical(~nilradica@user/naso)
2022-08-23 10:45:01 +0200 <tomsmeding> owait
2022-08-23 10:45:03 +0200 <tomsmeding> lol
2022-08-23 10:45:29 +0200 <dminuoso> Hence:
2022-08-23 10:45:30 +0200FinnElija(~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection)
2022-08-23 10:45:30 +0200stiell(~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection)
2022-08-23 10:45:30 +0200chexum(~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection)
2022-08-23 10:45:30 +0200califax(~califax@user/califx) (Write error: Connection reset by peer)
2022-08-23 10:45:33 +0200nilradical(~nilradica@user/naso) (Remote host closed the connection)
2022-08-23 10:45:33 +0200 <dminuoso> Im trying to really understand the point of _mm256_unpacklo_epi8 mm"
2022-08-23 10:45:37 +0200 <tomsmeding> :')
2022-08-23 10:45:49 +0200nilradical(~nilradica@user/naso)
2022-08-23 10:45:54 +0200chexum(~quassel@gateway/tor-sasl/chexum)
2022-08-23 10:45:57 +0200califax(~califax@user/califx)
2022-08-23 10:46:09 +0200FinnElija(~finn_elij@user/finn-elija/x-0085643)
2022-08-23 10:46:15 +0200 <tomsmeding> bummer we'll need a shuffle then
2022-08-23 10:46:20 +0200stiell(~stiell@gateway/tor-sasl/stiell)
2022-08-23 10:46:36 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2022-08-23 10:46:42 +0200 <tomsmeding> oh latency and throughput are the same on skylake? fancy
2022-08-23 10:46:42 +0200 <dminuoso> No, we can just follow this up with _mm256_unpacklo_epi8 + offset no?
2022-08-23 10:46:51 +0200 <dminuoso> _mm256_unpackhi_epi8
2022-08-23 10:46:58 +0200 <tomsmeding> apparently a single shuffle is equally fast as a single unpacklo
2022-08-23 10:47:03 +0200 <tomsmeding> lemme check and bench
2022-08-23 10:47:08 +0200 <int-e> Ah, there's a gap. That is nasty.
2022-08-23 10:47:57 +0200 <dminuoso> If I look at the _mm512 implementation, I think there's something instinsic about 128 bit lanes in there.
2022-08-23 10:48:10 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-08-23 10:48:19 +0200 <dminuoso> So all the unpacklo work on the lower order per 128 bit lane
2022-08-23 10:48:21 +0200 <int-e> tomsmeding: What happens when you do that masked read 16 bytes before the end of the page and the next page isn't mapped?
2022-08-23 10:48:47 +0200 <tomsmeding> int-e: the intel docs sample code don't do loads for the masked positions
2022-08-23 10:48:54 +0200 <tomsmeding> I checked that
2022-08-23 10:49:20 +0200 <tomsmeding> and IIRC that means the cpu will throw away any exception it gets for the masked-out bytes
2022-08-23 10:49:28 +0200 <tomsmeding> thereby becoming a lot slower probably for end-of-page cases, but eh
2022-08-23 10:49:33 +0200 <int-e> cool
2022-08-23 10:49:36 +0200 <dminuoso> tomsmeding: Is alternating _mm256_unpacklo_epi8 and _mm256_unpackhi_epi8 an option?
2022-08-23 10:49:39 +0200 <tomsmeding> yes
2022-08-23 10:49:40 +0200geekosaur(~geekosaur@xmonad/geekosaur) (Ping timeout: 268 seconds)
2022-08-23 10:49:42 +0200 <int-e> also crazy :P
2022-08-23 10:49:49 +0200 <tomsmeding> but shuffle is supposed to be equally fast as a single unpacklo
2022-08-23 10:50:03 +0200 <dminuoso> Or does _mm256_unpackhi_epi8 have an alignment requirement?
2022-08-23 10:50:10 +0200 <dminuoso> `shuffle` is that an instruction?
2022-08-23 10:50:27 +0200 <tomsmeding> _mm256_shuffle_epi8
2022-08-23 10:51:16 +0200 <dminuoso> Somehow I find the documentation on that not helpful
2022-08-23 10:51:20 +0200 <tomsmeding> no
2022-08-23 10:51:25 +0200geekosaur(~geekosaur@xmonad/geekosaur)
2022-08-23 10:51:28 +0200 <dminuoso> "Performs shuffle operations of the signed or unsigned 8-bit integers in the source vector as specified by the shuffle control mask in the second source operand."
2022-08-23 10:51:39 +0200 <tomsmeding> but the rust docs aren't much better, the reference code has a contradiction between the comments and the code
2022-08-23 10:52:35 +0200 <dminuoso> So what does that even do?
2022-08-23 10:52:43 +0200 <tomsmeding> it shuffles bytes in the simd vector!
2022-08-23 10:52:52 +0200 <tomsmeding> according to some index mapping
2022-08-23 10:52:58 +0200 <tomsmeding> the question is, how is the index mapping represented
2022-08-23 10:53:01 +0200 <int-e> "the halves are shuffled separately"
2022-08-23 10:53:11 +0200 <int-e> as bytes
2022-08-23 10:53:19 +0200 <tomsmeding> damn
2022-08-23 10:53:24 +0200 <tomsmeding> int-e++
2022-08-23 10:53:36 +0200 <tomsmeding> I was almost there figuring it out from the intel docs
2022-08-23 10:53:57 +0200 <int-e> once again, the code may be the most informative part of those docs
2022-08-23 10:54:05 +0200 <tomsmeding> the code _is_ the docs
2022-08-23 10:54:14 +0200 <tomsmeding> the description is vage and ambiguous at best
2022-08-23 10:54:53 +0200 <int-e> I had not read it... yeah, that's pretty awful.
2022-08-23 10:56:17 +0200 <int-e> Somehow I have to relearn those intrinsics every time I want to use them... they're so random.
2022-08-23 10:56:25 +0200 <tomsmeding> yeah
2022-08-23 10:56:43 +0200 <dminuoso> Mmm, maybe I need to do more SIMD, I dont grok what this shuffling does
2022-08-23 10:58:01 +0200fraznel(~fuag1@c-73-221-56-19.hsd1.wa.comcast.net) (Ping timeout: 252 seconds)
2022-08-23 10:58:10 +0200 <int-e> dminuoso: The 128 bit version takes 16 bytes, each treated as an index into another 16-byte vector (if the highest bit is unset), or as indicating zero (highest bit set).
2022-08-23 10:58:36 +0200 <int-e> The 256 bit version does this separately for the halves of the arguments. So you get awkward 16 offsets for the second half.
2022-08-23 10:58:40 +0200fraznel(~fuag1@c-73-221-56-19.hsd1.wa.comcast.net)
2022-08-23 10:59:04 +0200 <dminuoso> Okay, this "separately" makes sense, as Im seeing a pattern of a lot of AVX instructions working per 128 bit lane
2022-08-23 10:59:47 +0200 <dminuoso> Presumably the underlying physical register file is divided into 128 chunks or something along those lines
2022-08-23 11:00:00 +0200 <int-e> Hi, we saw that you love vectorization so we vectorized our vector operations!
2022-08-23 11:00:09 +0200 <dminuoso> heh
2022-08-23 11:00:45 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2022-08-23 11:01:27 +0200 <dminuoso> well presumably you can save some instruction decoding type if the vectorization is just a simple microop loop
2022-08-23 11:04:26 +0200 <kuribas> _mm256_shuffle_epi8 is basically a lookup table
2022-08-23 11:04:31 +0200 <kuribas> where the lookup gets overwritten.
2022-08-23 11:05:36 +0200 <dminuoso> int-e: Okay I think I get it. So per 128 slice the second argument, per byte, the lowbits declare where the source byte at the same index is copied. If the hibit of that byte is set, instead of copying a 0 byte is inserted at the lowbit address.
2022-08-23 11:05:39 +0200 <dminuoso> Does this sound about right?
2022-08-23 11:06:01 +0200 <int-e> yes
2022-08-23 11:06:41 +0200 <dminuoso> Then yeah, I think _mm_shuffle_epi8 will do fine.
2022-08-23 11:06:44 +0200 <kuribas> there are some nice hacks using this, like a leading zero count.
2022-08-23 11:06:55 +0200 <kuribas> dminuoso: what do you want to do?
2022-08-23 11:07:09 +0200 <dminuoso> Im golfing a prettyprinter.
2022-08-23 11:08:01 +0200 <tomsmeding> I tried _mm256_permute4x64_epi64 + _mm256_unpacklo_epi8 + _mm256_unpackhi_epi8 + _mm256_or_si256 and it makes all the _other_ code twice as slow
2022-08-23 11:08:10 +0200 <tomsmeding> I thought only avx512 pulled that shit
2022-08-23 11:08:13 +0200 <kuribas> how do you use intrinsics in haskell?
2022-08-23 11:08:19 +0200cfricke(~cfricke@user/cfricke) (Ping timeout: 248 seconds)
2022-08-23 11:08:19 +0200 <tomsmeding> C
2022-08-23 11:08:30 +0200 <kuribas> so #haskell-offtopic then?
2022-08-23 11:08:31 +0200 <merijn> Or ghc-prim + LLVM backend :p
2022-08-23 11:08:33 +0200 <dminuoso> Or: {-# LANGUAGE InlineAssembly #-}
2022-08-23 11:08:45 +0200 <dminuoso> That should be a thing.
2022-08-23 11:08:49 +0200 <merijn> (or does NCG support the ghc-prim vector ops now too)
2022-08-23 11:08:53 +0200 <merijn> +?
2022-08-23 11:09:08 +0200 <dminuoso> kuribas: Given that this is a Haskell library, its very ontopic.
2022-08-23 11:09:14 +0200 <kuribas> dminuoso: right
2022-08-23 11:09:17 +0200 <dminuoso> I just want to pretty print domain names as fast as possible.
2022-08-23 11:09:40 +0200 <merijn> kuribas: ghc-prim has a crapton of vector primitives, but you'd have to ping carter or #ghc to know how stable they are
2022-08-23 11:09:45 +0200 <dminuoso> So tomsmeding came up with AVX for doing an ASCII-to-UTF16 trick to copy already-ascii-encoded byte buffers directly into a text (pre 2.0) buffer
2022-08-23 11:09:48 +0200 <tomsmeding> dminuoso: I fear you'd have to use the avx (not-avx2) versions, i.e. 128-wide, because apparently unpacklo+unpackhi is bad? https://paste.tomsmeding.com/tCbbfnCe
2022-08-23 11:10:02 +0200 <tomsmeding> but I have to run so good luck :p
2022-08-23 11:10:02 +0200 <kuribas> tomsmeding: avx512 has some bad reputation.
2022-08-23 11:10:04 +0200 <tomsmeding> might have time later
2022-08-23 11:10:07 +0200akegalj(~akegalj@135-40.dsl.iskon.hr) (Ping timeout: 252 seconds)
2022-08-23 11:10:07 +0200 <tomsmeding> kuribas: I'm using avx2
2022-08-23 11:10:13 +0200 <tomsmeding> but I'm getting the same shenanigans somehow
2022-08-23 11:10:24 +0200 <dminuoso> tomsmeding: thanks for the efforts nevertheless, Ill take it from there. :)
2022-08-23 11:10:33 +0200 <dminuoso> Ill let you know what I end up using
2022-08-23 11:10:43 +0200jpds1(~jpds@gateway/tor-sasl/jpds) (Ping timeout: 268 seconds)
2022-08-23 11:11:17 +0200notzmv(~zmv@user/notzmv) (Ping timeout: 268 seconds)
2022-08-23 11:11:39 +0200 <dminuoso> Though I think a shuffle will suffice
2022-08-23 11:11:53 +0200tzh(~tzh@c-24-21-73-154.hsd1.or.comcast.net) (Quit: zzz)
2022-08-23 11:12:05 +0200jpds1(~jpds@gateway/tor-sasl/jpds)
2022-08-23 11:13:01 +0200 <int-e> kuribas: Does it still suffer from forced frequency scaling? https://blog.cloudflare.com/on-the-dangers-of-intels-frequency-scaling/ struck me as pretty embarrassing 5 years ago.
2022-08-23 11:13:15 +0200Pickchea(~private@user/pickchea)
2022-08-23 11:17:02 +0200 <kuribas> int-e: not sure
2022-08-23 11:17:38 +0200 <kuribas> But speeding up some code with only 30%, but then having the rest of the computer go slower seems pretty uninteresting to me...
2022-08-23 11:20:13 +0200 <kuribas> And there is Torvads criticism that the die space could be put to better use.
2022-08-23 11:20:40 +0200 <kuribas> tomsmeding: avx2 is widely supported now.
2022-08-23 11:20:42 +0200wonko(~wjc@2a0e:1c80:2::130) (Ping timeout: 244 seconds)
2022-08-23 11:20:54 +0200 <int-e> avx2 makes good sense since it matches cache line size
2022-08-23 11:23:49 +0200 <kuribas> dminuoso: you may want to check daniel lemire's blog for a sorts of SIMD projects.
2022-08-23 11:24:06 +0200 <kuribas> like parsing JSON, printing doubles, etc...
2022-08-23 11:25:28 +0200 <dminuoso> kuribas: Its not without cause. In production, the largest hotspot is a tight pretty printer loop where I foldl over a bytestring
2022-08-23 11:25:39 +0200 <dminuoso> *foldl'
2022-08-23 11:25:53 +0200stefan-_(~cri@42dots.de) (Ping timeout: 252 seconds)
2022-08-23 11:26:12 +0200 <dminuoso> At the end it only accounts for 10% of the time, but because it makes for a small portion of it, this will scale poorly
2022-08-23 11:26:25 +0200 <dminuoso> (We're pretty printing a low number of domain names right now, but this will become much larger)
2022-08-23 11:26:46 +0200 <kuribas> foldl' over bytestring bytes?
2022-08-23 11:28:01 +0200 <dminuoso> Yeah
2022-08-23 11:28:54 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2022-08-23 11:29:39 +0200beteigeuze(~Thunderbi@bl11-28-222.dsl.telepac.pt)
2022-08-23 11:31:23 +0200 <kuribas> Did you check the core, to see if it's being optimized into a loop?
2022-08-23 11:32:09 +0200 <dminuoso> I honestly dont want to cater to the optimizer, I want guaranteed performance.
2022-08-23 11:32:20 +0200 <dminuoso> Otherwise Ill have to repeat this every time GHC is updated
2022-08-23 11:32:38 +0200fraznel(~fuag1@c-73-221-56-19.hsd1.wa.comcast.net) (Ping timeout: 256 seconds)
2022-08-23 11:32:50 +0200odnes(~odnes@5-203-132-117.pat.nym.cosmote.net) (Ping timeout: 268 seconds)
2022-08-23 11:33:23 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 248 seconds)
2022-08-23 11:33:25 +0200stefan-_(~cri@42dots.de)
2022-08-23 11:33:49 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2022-08-23 11:36:01 +0200gurkenglas(~gurkengla@p548ac72e.dip0.t-ipconnect.de)
2022-08-23 11:36:12 +0200yvan-sraka(~yvan-srak@laubervilliers-656-1-51-219.w193-252.abo.wanadoo.fr) (Ping timeout: 252 seconds)
2022-08-23 11:36:58 +0200 <kuribas> dminuoso: maybe the foldl' itself is not slow, but the thing you are accumulating?
2022-08-23 11:37:08 +0200 <kuribas> (I assume another Bytestring)
2022-08-23 11:37:15 +0200 <dminuoso> Im constructing a text builder
2022-08-23 11:38:18 +0200 <kuribas> A Text Builder is a closure, so it will first build the closure from the ByteString, then execute it.
2022-08-23 11:38:23 +0200 <kuribas> That could be very slow.
2022-08-23 11:38:52 +0200 <kuribas> A lazy version would be faster, but still rely on ghc magic.
2022-08-23 11:40:19 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2022-08-23 11:40:20 +0200 <dminuoso> You know whats faster even still? Shuffling ASCII bytes into an UTF16 buffer, and just unsafely construct a `Text` out of that. :)
2022-08-23 11:40:33 +0200 <kuribas> sure
2022-08-23 11:40:39 +0200 <dminuoso> Hence AVX
2022-08-23 11:40:51 +0200 <kuribas> I just wonder if the SIMD isn't overkill.
2022-08-23 11:41:24 +0200 <dminuoso> Well you have to interleave all the bytes with 0s.
2022-08-23 11:41:31 +0200 <kuribas> did you try with lazy foldl?
2022-08-23 11:41:54 +0200 <dminuoso> I dont see how a lazy foldl could possibly cheaper
2022-08-23 11:42:06 +0200 <dminuoso> It just causes accumulation of intermediate results
2022-08-23 11:42:22 +0200 <dminuoso> Given that I foldl' and (<>) a *lot* of builders, its not going to be good.
2022-08-23 11:43:00 +0200 <geekosaur> doesn't that fix you at text < 2?
2022-08-23 11:43:16 +0200 <dminuoso> geekosaur: Its the other way around. Im already fixed to text < 2, otherwise I could just steal the buffer.
2022-08-23 11:43:22 +0200 <kuribas> dminuoso: hmm, maybe you need foldr then?
2022-08-23 11:43:50 +0200 <dminuoso> kuribas: foldr is only useful *if* you want to stream lazy results. For a computational loop a foldl' is going to be better
2022-08-23 11:44:15 +0200 <kuribas> dminuoso: yes, but you are creating a Text Builder, which is a closure.
2022-08-23 11:44:20 +0200 <kuribas> That's not a computation loop.
2022-08-23 11:45:23 +0200nilradical(~nilradica@user/naso) (Remote host closed the connection)
2022-08-23 11:45:43 +0200econo(uid147250@user/econo) (Quit: Connection closed for inactivity)
2022-08-23 11:45:58 +0200 <dminuoso> kuribas: same cost, its really just the builders that are costly
2022-08-23 11:46:17 +0200 <int-e> you may want laziness between chunks, but not while building a chunk
2022-08-23 11:46:18 +0200 <dminuoso> I dont get useful cost centers because everything is inlined into the foldr
2022-08-23 11:46:47 +0200nilradical(~nilradica@user/naso)
2022-08-23 11:46:52 +0200 <dminuoso> Even now I experimented by using T.decodeLatin1 per domain label, but thats also too expensive
2022-08-23 11:47:09 +0200 <dminuoso> (its comparable to just foldl'ing over the bytes and using Data.Text.Builder.singleton
2022-08-23 11:48:49 +0200mima(mmh@gateway/vpn/airvpn/mima)
2022-08-23 11:48:55 +0200 <kuribas> int-e: how do you do that with ByteString? You don't control chunks do you?
2022-08-23 11:49:41 +0200 <kuribas> int-e: you cannot read the bytes lazily, but create the Text eagerly?
2022-08-23 11:50:38 +0200 <int-e> kuribas: Which kind of ByteString? We're producing Text, which /may/ be chunked. I'm only half following, I don't know how big the strings are.
2022-08-23 11:51:12 +0200 <kuribas> int-e: as I understand, dminuoso is reading the characters of a (lazy?) ByteString, then creating a Text Builder out of that.
2022-08-23 11:51:20 +0200nilradical(~nilradica@user/naso) (Ping timeout: 268 seconds)
2022-08-23 11:51:48 +0200 <int-e> In any case, you don't have to use the same chunking as the source.
2022-08-23 11:51:55 +0200 <dminuoso> Imagine just [ShortByteString] where each bytestring is just a domain label, like ["www", "google", "de"]
2022-08-23 11:52:08 +0200 <int-e> And if the strings are short then you'll not want to chunk the Text at all.
2022-08-23 11:52:16 +0200 <int-e> Which means you won't want any laziness.
2022-08-23 11:52:23 +0200 <kuribas> int-e: why would I think about chunking, when the Text Builder library does that for me?
2022-08-23 11:52:52 +0200 <int-e> kuribas: It's not your problem at all, is it?
2022-08-23 11:52:55 +0200 <dminuoso> kuribas: text builder is very inefficient for appending very small fragments.
2022-08-23 11:54:17 +0200 <int-e> kuribas: I'm spouting generalities but I think your call for laziness is misguided in this context.
2022-08-23 11:54:48 +0200berberman_(~berberman@user/berberman) (Ping timeout: 244 seconds)
2022-08-23 11:54:49 +0200 <dminuoso> kuribas: In our degenerate case where we build ip6.arpa zones we end up with something like "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.a.e.c.5.a.b.c.1.2.b.b.d.f.ip6.arpa."
2022-08-23 11:55:21 +0200 <int-e> dminuoso: Hah, you may want tables of hex digits and small ASCII numbers (up to 255).
2022-08-23 11:55:24 +0200kannon(~NK@135-180-47-54.fiber.dynamic.sonic.net)
2022-08-23 11:55:34 +0200 <dminuoso> So we have a foldl' over each 1-byte ShortByteString, so we end up doing something like: TB.singleton '0' <> TB.singleton '0' ...
2022-08-23 11:55:44 +0200 <kuribas> int-e: I am just saying that using foldl' to create a Text Builder is very, very inefficient.
2022-08-23 11:55:59 +0200 <dminuoso> int-e: Heh we already do just that for case folding already. :)
2022-08-23 11:56:15 +0200 <dminuoso> int-e: https://gist.github.com/dminuoso/d263aefb9d60cad2c46a72c9e69a001d
2022-08-23 11:57:26 +0200 <dminuoso> int-e: But it wont work for what you suggest well
2022-08-23 11:57:53 +0200 <dminuoso> There's some gross impedance mismatch between how ip6.arpa zones are represented and how IPv6 addresses work.
2022-08-23 11:58:17 +0200 <int-e> I don't have the context. Are you splitting domain names or building them from chunks? Or both?
2022-08-23 11:58:19 +0200 <kuribas> int-e: because you have to go over each character just to create the closure, before anything is written to the output Text.
2022-08-23 11:58:27 +0200 <kuribas> int-e: tell me if I am wrong?
2022-08-23 11:59:00 +0200 <dminuoso> int-e: So a domain is formally a list of domain labels, each of which is just a series of up to 64 arbitrary octets. So I represent a Domain as [ShortByteString]
2022-08-23 11:59:21 +0200 <dminuoso> This representation is very useful in a bunch of places
2022-08-23 11:59:35 +0200kannon(~NK@135-180-47-54.fiber.dynamic.sonic.net) (Ping timeout: 255 seconds)
2022-08-23 11:59:41 +0200 <dminuoso> But at some point I want to pretty print that back into a text
2022-08-23 12:00:06 +0200 <int-e> kuribas: Ah. Awkward.
2022-08-23 12:00:47 +0200 <dminuoso> kuribas: either way, foldr yields the exact same runtime duration
2022-08-23 12:01:01 +0200dschrempf(~dominik@mobiledyn-62-240-134-145.mrsn.at)
2022-08-23 12:01:07 +0200 <kuribas> dminuoso: ok
2022-08-23 12:01:29 +0200dschrempf(~dominik@mobiledyn-62-240-134-145.mrsn.at) (Client Quit)
2022-08-23 12:04:14 +0200 <kuribas> dminuoso: I also read that the strict builder is much more efficient.
2022-08-23 12:04:33 +0200 <kuribas> But ok, a direct loop with avx and mutation will outperform anything else :)
2022-08-23 12:04:48 +0200 <int-e> I don't see TextBuilder doing a great job for this at all. You want `foldl'` to get the length but the compiler will never see through the closures and turn them into good code.
2022-08-23 12:05:03 +0200nilradical(~nilradica@user/naso)
2022-08-23 12:05:12 +0200coot(~coot@213.134.176.158)
2022-08-23 12:05:54 +0200califax(~califax@user/califx) (Remote host closed the connection)
2022-08-23 12:06:11 +0200califax(~califax@user/califx)
2022-08-23 12:08:54 +0200xff0x(~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp) (Ping timeout: 256 seconds)
2022-08-23 12:10:55 +0200 <int-e> kuribas: Anyway, the way the abstraction works, I agree that `foldr` will usually do better than `foldl'`. But I think none of this will be very fast except in simple cases that don't involve any folds at all.
2022-08-23 12:11:05 +0200 <int-e> emphasis on *very*
2022-08-23 12:11:06 +0200 <kuribas> agreed
2022-08-23 12:11:18 +0200 <int-e> it's still a step up from concatenating Text values.
2022-08-23 12:11:51 +0200 <int-e> except when the result gets big... because there's no chunking at all
2022-08-23 12:13:16 +0200wonko(~wjc@2a0e:1c80:2::130)
2022-08-23 12:13:49 +0200 <kuribas> maybe text-builder is just slow...
2022-08-23 12:14:17 +0200waldo(~waldo@user/waldo) (Ping timeout: 252 seconds)
2022-08-23 12:17:11 +0200 <int-e> Well as you said, it is building clousres (except when everything gets inlined; buildText (char 'a' <> char 'b' <> char 'c') should produce pretty good code: allocate an array and fill it with 3 or 6 bytes, depending on the Text version. Though it's up to ghc to do all the constant folding.)
2022-08-23 12:19:10 +0200 <kuribas> what if you write an explicit loop, and use linear text builder instead?
2022-08-23 12:20:32 +0200lisbeths(uid135845@id-135845.lymington.irccloud.com) (Quit: Connection closed for inactivity)
2022-08-23 12:27:24 +0200 <dminuoso> kuribas: The haskell way would be to calculate the length of the required buffer, and then looping over the bytes and poking them directly into a MutableByteArray
2022-08-23 12:27:33 +0200 <dminuoso> I think this is the fastest way
2022-08-23 12:31:02 +0200vjoki(~vjoki@2a00:d880:3:1::fea1:9ae) (Quit: ...)
2022-08-23 12:40:12 +0200 <int-e> Right. An elaborate fusion framework might achieve that with folds on top of TextBuilder but it doesn't have such a framework. (Not a complaint; fusion is hard and a lot of work.)
2022-08-23 12:41:31 +0200vjoki(~vjoki@2a00:d880:3:1::fea1:9ae)
2022-08-23 12:41:32 +0200 <int-e> text-builder-linear doesn't do any of this either; it's mostly using a buffer size doubling strategy and doesn't build closures.
2022-08-23 12:42:10 +0200 <int-e> so it should land somewhere in the middle between text-builder and the manual direct loop.
2022-08-23 12:42:12 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2022-08-23 12:42:46 +0200 <int-e> But it also pulls in linear types.
2022-08-23 12:46:52 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 256 seconds)
2022-08-23 12:49:17 +0200nate4(~nate@98.45.169.16)
2022-08-23 12:54:14 +0200nate4(~nate@98.45.169.16) (Ping timeout: 268 seconds)
2022-08-23 12:56:42 +0200pagnol(~me@213-205-209-87.ftth.glasoperator.nl) (Remote host closed the connection)
2022-08-23 12:57:57 +0200lambro(~lambro@user/lambro)
2022-08-23 12:58:38 +0200xff0x(~xff0x@2405:6580:b080:900:19d1:e58d:306e:9622)
2022-08-23 12:59:48 +0200nilradical(~nilradica@user/naso) (Remote host closed the connection)
2022-08-23 13:00:26 +0200foul_owl(~kerry@23.82.194.107) (Read error: Connection reset by peer)
2022-08-23 13:00:43 +0200nilradical(~nilradica@user/naso)
2022-08-23 13:05:39 +0200nilradical(~nilradica@user/naso) (Ping timeout: 248 seconds)
2022-08-23 13:06:38 +0200wonko(~wjc@2a0e:1c80:2::130) (Ping timeout: 255 seconds)
2022-08-23 13:08:25 +0200acidjnk(~acidjnk@p200300d6e7137a19a561eed7706d09b0.dip0.t-ipconnect.de) (Ping timeout: 256 seconds)
2022-08-23 13:14:24 +0200nilradical(~nilradica@user/naso)
2022-08-23 13:17:31 +0200foul_owl(~kerry@23.82.194.108)
2022-08-23 13:20:08 +0200notzmv(~zmv@user/notzmv)
2022-08-23 13:29:09 +0200nilradical(~nilradica@user/naso) ()
2022-08-23 13:32:28 +0200acidjnk(~acidjnk@p200300d6e7137a19a561eed7706d09b0.dip0.t-ipconnect.de)
2022-08-23 13:33:46 +0200 <dminuoso> tomsmeding: By the way, your code has alignment assumptions that wont work (unless GHC has some guarantee that ByteArray# was 16-byte aligned
2022-08-23 13:34:13 +0200 <dminuoso> I find it quite confusing and hard to navigate all the AVX intrinsics that are supported on AVX1/2, but would work here
2022-08-23 13:35:41 +0200lambro(~lambro@user/lambro) (Quit: quit)
2022-08-23 13:36:49 +0200califax(~califax@user/califx) (Quit: ZNC 1.8.2 - https://znc.in)
2022-08-23 13:37:03 +0200lieven(~mal@ns2.wyrd.be) (Quit: WeeChat 3.0)
2022-08-23 13:38:17 +0200jao(~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net)
2022-08-23 13:38:25 +0200califax(~califax@user/califx)
2022-08-23 13:39:41 +0200 <tomsmeding> dminuoso: I don't think it had many alignment requirements? the load intrinsic didn't have any alignment requirements specified in the docs, and I used `storeu` instead of `store` precisely to avoid alignment requirements
2022-08-23 13:39:42 +0200lieven(~mal@ns2.wyrd.be)
2022-08-23 13:39:52 +0200jgeerds(~jgeerds@55d46bad.access.ecotel.net) (Ping timeout: 268 seconds)
2022-08-23 13:40:05 +0200 <geekosaur> I think ghc may guarantee 16 byte alignment on x86 anyway
2022-08-23 13:40:12 +0200 <tomsmeding> dminuoso: to filter on __m128i stuff, filter on _mm_
2022-08-23 13:41:45 +0200 <dminuoso> Uh maybe I looked at the wrong thing.
2022-08-23 13:42:51 +0200 <dminuoso> For a load without mask Id have to use _mm_maskload_si128 right?
2022-08-23 13:42:59 +0200 <dminuoso> (or si32/si64)
2022-08-23 13:43:19 +0200 <dminuoso> Err _mm_loadu_si128
2022-08-23 13:43:29 +0200 <tomsmeding> yeah that last one
2022-08-23 13:43:31 +0200 <dminuoso> because it seems that _mm_loadu_epi8 is avx512
2022-08-23 13:43:37 +0200 <dminuoso> Sadly
2022-08-23 13:43:49 +0200 <tomsmeding> that makes zero sense, what's the difference
2022-08-23 13:44:07 +0200 <carter> Avx 512 isn’t always a win though
2022-08-23 13:44:12 +0200 <dminuoso> i8 vs i128
2022-08-23 13:44:15 +0200 <carter> Depending on the cpu
2022-08-23 13:44:17 +0200 <dminuoso> _m128i
2022-08-23 13:44:18 +0200 <tomsmeding> carter: no one here is using avx512
2022-08-23 13:44:36 +0200 <carter> Good
2022-08-23 13:45:28 +0200 <dminuoso> __m128i _mm_loadu_epi8 (void const* mem_addr)
2022-08-23 13:45:30 +0200 <dminuoso> __m128i _mm_loadu_si128 (__m128i const* mem_addr)
2022-08-23 13:45:36 +0200 <carter> Shuffles are great
2022-08-23 13:45:51 +0200 <dminuoso> tomsmeding: Its just frustrating because I have to figure out how to cleanly pun that pointer now. :(
2022-08-23 13:45:58 +0200 <tomsmeding> dminuoso: the only difference in the operation description is that _mm_loadu_epi8 zeros the part above the lower 128 bits
2022-08-23 13:46:08 +0200 <tomsmeding> dminuoso: just pun it
2022-08-23 13:46:13 +0200 <tomsmeding> since there are no alignment requirements
2022-08-23 13:46:28 +0200 <dminuoso> tomsmeding: You do realizse that punning is not allowed in C right? :)
2022-08-23 13:46:44 +0200 <tomsmeding> you either make your life impossible, or you pun here
2022-08-23 13:46:50 +0200 <tomsmeding> there is no intrinsic to do that punning for you
2022-08-23 13:46:55 +0200 <dminuoso> Can you add C flags in the cabal file?
2022-08-23 13:47:06 +0200 <dminuoso> tomsmeding: there's a GCC builtin
2022-08-23 13:47:07 +0200 <tomsmeding> cc-flags: ...
2022-08-23 13:47:09 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2022-08-23 13:47:10 +0200 <dminuoso> Ah
2022-08-23 13:47:19 +0200 <tomsmeding> dminuoso: O.o which
2022-08-23 13:48:57 +0200CiaoSen(~Jura@p200300c95738a5002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
2022-08-23 13:50:36 +0200 <dminuoso> tomsmeding: __attribute__ ((__may_alias__))
2022-08-23 13:51:16 +0200 <dminuoso> But its impossible to use in this case, because the AVX implementation would have to use this
2022-08-23 13:51:27 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 252 seconds)
2022-08-23 13:51:31 +0200Pickchea(~private@user/pickchea) (Ping timeout: 248 seconds)
2022-08-23 13:51:32 +0200 <dminuoso> So -fno-strict-aliasing is required then
2022-08-23 13:51:52 +0200 <dminuoso> Or I could rely on GCCs extension to permit union punning
2022-08-23 13:54:05 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2022-08-23 13:56:32 +0200 <carter> What do you mean by pun?
2022-08-23 13:58:32 +0200 <merijn> carter: accessing data through a pointer of the wrong type
2022-08-23 13:59:23 +0200 <merijn> carter: Also, glorious news I don't think I told you yet
2022-08-23 13:59:30 +0200 <carter> Oh?
2022-08-23 13:59:43 +0200 <carter> We can switch apps if you want
2022-08-23 13:59:46 +0200 <merijn> carter: Guess who has two thumbs and has his phd defense scheduled in less than a month ;)
2022-08-23 13:59:55 +0200 <carter> Ohhhhh man congrats
2022-08-23 14:04:26 +0200 <kuribas> dminuoso: I still think you are prematurely optimizing.
2022-08-23 14:04:44 +0200 <kuribas> With the simd intrinsics
2022-08-23 14:07:00 +0200akegalj(~akegalj@135-40.dsl.iskon.hr)
2022-08-23 14:12:54 +0200benin0(~benin@183.82.205.32) (Quit: The Lounge - https://thelounge.chat)
2022-08-23 14:13:54 +0200benin0(~benin@183.82.205.66)
2022-08-23 14:27:36 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex) (Quit: = "")
2022-08-23 14:27:43 +0200abraham(~abraham@159.89.183.132)
2022-08-23 14:29:40 +0200famubu(~famubu@14.139.174.50)
2022-08-23 14:29:40 +0200famubu(~famubu@14.139.174.50) (Changing host)
2022-08-23 14:29:40 +0200famubu(~famubu@user/famubu)
2022-08-23 14:30:25 +0200 <kuribas> OTOH SIMD intrinsics are cool :)
2022-08-23 14:30:25 +0200 <famubu> Hi. I got two lists [1,2,3] and [1,2]. I needed to left pad the shorter list with zeros so that they are both of the same length. What would be a good way to do that in haskell?
2022-08-23 14:31:31 +0200abraham(~abraham@159.89.183.132) ()
2022-08-23 14:31:34 +0200 <kuribas> famubu: and return which one?
2022-08-23 14:32:49 +0200img(~img@user/img) (Quit: ZNC 1.8.2 - https://znc.in)
2022-08-23 14:33:06 +0200img(~img@user/img)
2022-08-23 14:33:54 +0200 <kuribas> > let l1 = length [1, 2, 3]; l2 = length [1, 2] in (replicate (l2 - l1) 0 : l1, replicate (l1 - l2) 0: l2)
2022-08-23 14:33:55 +0200 <lambdabot> error:
2022-08-23 14:33:56 +0200 <lambdabot> • Couldn't match expected type ‘[[a]]’ with actual type ‘Int’
2022-08-23 14:33:56 +0200 <lambdabot> • In the second argument of ‘(:)’, namely ‘l1’
2022-08-23 14:34:15 +0200 <kuribas> > let l1 = length [1, 2, 3]; l2 = length [1, 2] in (replicate (l2 - l1) 0 ++ l1, replicate (l1 - l2) 0 ++ l2)
2022-08-23 14:34:17 +0200 <lambdabot> error:
2022-08-23 14:34:17 +0200 <lambdabot> • Couldn't match expected type ‘[a]’ with actual type ‘Int’
2022-08-23 14:34:17 +0200 <lambdabot> • In the second argument of ‘(++)’, namely ‘l1’
2022-08-23 14:35:27 +0200 <kuribas> > let l1 = [1, 2, 3]; l2 = [1, 2]; len1 = length l1; len2 = length l2 in (replicate (len2 - len1) 0 ++ l1, replicate (len1 - len2) 0 ++ l2)
2022-08-23 14:35:29 +0200 <lambdabot> ([1,2,3],[0,1,2])
2022-08-23 14:36:19 +0200 <famubu> kuribas: I wanted both lists, but with the smaller one zero-padded so that they are both of smae lenght.
2022-08-23 14:36:49 +0200 <famubu> Yeah something like that. Thanks.
2022-08-23 14:40:38 +0200kmein(~weechat@user/kmein) (Quit: ciao kakao)
2022-08-23 14:42:40 +0200kmein(~weechat@user/kmein)
2022-08-23 14:49:00 +0200 <dminuoso> famubu: do you know, beforehand, which list is shorter?
2022-08-23 14:54:28 +0200 <dminuoso> If yes, you can have a lazy option that admits the longer list to be infinite (and save work as well)
2022-08-23 14:54:34 +0200raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
2022-08-23 14:55:18 +0200Lord_of_Life_(~Lord@user/lord-of-life/x-2819915)
2022-08-23 14:55:55 +0200Lord_of_Life(~Lord@user/lord-of-life/x-2819915) (Read error: Connection reset by peer)
2022-08-23 14:56:04 +0200jpds1(~jpds@gateway/tor-sasl/jpds) (Remote host closed the connection)
2022-08-23 14:56:21 +0200 <famubu> dminuoso: No for my current problem, I can't know which one would be shorter, but this might come in useful. What is the lazy option?
2022-08-23 14:56:29 +0200 <famubu> Had another doubt: I was looking to generate `[(0,0), (1,0), (1,1), (2,0), (2,1), (2,2)]`. Can we use nest list comprehension for that? I tried `[(n,k) | k <- [0..n] | n <- [0..2] ]` but that gave error.
2022-08-23 14:56:54 +0200 <merijn> famubu: n isn't in scope there
2022-08-23 14:57:00 +0200 <merijn> Reverse the <- parts
2022-08-23 14:57:35 +0200kmein(~weechat@user/kmein) (Quit: ciao kakao)
2022-08-23 14:58:06 +0200Lord_of_Life_Lord_of_Life
2022-08-23 14:58:26 +0200 <famubu> merijn: You mean, make `n <- [0..2]` to `[0..2] <- n`? Or to reverse the arrow direction?
2022-08-23 14:58:34 +0200 <dminuoso> famubu: Mmm, maybe not. I was thinking of right padding actually
2022-08-23 14:58:37 +0200jpds1(~jpds@gateway/tor-sasl/jpds)
2022-08-23 14:58:58 +0200 <merijn> > [(n,k) | n <- [0..2] | k <- [0..n]]
2022-08-23 14:58:59 +0200 <lambdabot> *Exception: not an integer: n
2022-08-23 14:59:15 +0200 <merijn> wait, wut?
2022-08-23 14:59:23 +0200 <merijn> oh, wait
2022-08-23 14:59:38 +0200kmein(~weechat@user/kmein)
2022-08-23 14:59:38 +0200 <dminuoso> Num polymorphism?
2022-08-23 14:59:39 +0200 <merijn> > [(n,k) | n <- [0..2], k <- [0..n]] -- cartesian product is , not parallel list comprehension
2022-08-23 14:59:40 +0200 <geekosaur> > [(n,k) | n <- [0..2], k <- [0..n]]
2022-08-23 14:59:41 +0200 <lambdabot> [(0,0),(1,0),(1,1),(2,0),(2,1),(2,2)]
2022-08-23 14:59:42 +0200 <lambdabot> [(0,0),(1,0),(1,1),(2,0),(2,1),(2,2)]
2022-08-23 14:59:45 +0200 <geekosaur> yes
2022-08-23 15:00:11 +0200 <famubu> Oh the n got to come first. Got it. Thanks!
2022-08-23 15:00:16 +0200 <dminuoso> > [(n,k) | n <- [0..2] | k <- [0..n]]
2022-08-23 15:00:17 +0200 <lambdabot> *Exception: not an integer: n
2022-08-23 15:00:18 +0200 <dminuoso> How does that even parse?
2022-08-23 15:00:30 +0200 <geekosaur> look up ParallelListComprehension extension
2022-08-23 15:01:11 +0200 <famubu> I had come across an error saying something about parallel list as well when I was trying things out (wrongly).
2022-08-23 15:01:17 +0200 <famubu> :)
2022-08-23 15:01:29 +0200causal(~user@50.35.83.177) (Quit: WeeChat 3.6)
2022-08-23 15:02:16 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2022-08-23 15:02:42 +0200 <famubu> Is there a way to generate it like: `[[(0,0)],[(1,0),(1,1)],[(2,0),(2,1),(2,2)]]`?
2022-08-23 15:02:57 +0200matthewmosior(~matthewmo@173.170.253.91) (Remote host closed the connection)
2022-08-23 15:02:59 +0200 <famubu> Maybe a careful insertion of square bracket can help?
2022-08-23 15:03:03 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-08-23 15:03:10 +0200 <merijn> > sortOn snd $ [(n,k) | n <- [0..2], k <- [0..n]]
2022-08-23 15:03:12 +0200 <lambdabot> [(0,0),(1,0),(2,0),(1,1),(2,1),(2,2)]
2022-08-23 15:03:31 +0200 <merijn> ah, wait, no
2022-08-23 15:03:46 +0200 <famubu> Oh I think I got it: [[(n,k) | k <- [0..n]] | n <- [0..3] ]
2022-08-23 15:03:46 +0200 <merijn> > groupBy fst . sort $ [(n,k) | n <- [0..2], k <- [0..n]]
2022-08-23 15:03:48 +0200 <lambdabot> error:
2022-08-23 15:03:48 +0200 <lambdabot> • Occurs check: cannot construct the infinite type:
2022-08-23 15:03:48 +0200 <lambdabot> b ~ (b, b) -> Bool
2022-08-23 15:03:58 +0200 <famubu> [[(n,k) | k <- [0..n]] | n <- [0..3] ]
2022-08-23 15:04:16 +0200 <famubu> How do we trigger lambdabot?
2022-08-23 15:04:39 +0200 <merijn> > groupBy ((==) `on` fst) . sort $ [(n,k) | n <- [0..2], k <- [0..n]]
2022-08-23 15:04:41 +0200 <lambdabot> [[(0,0)],[(1,0),(1,1)],[(2,0),(2,1),(2,2)]]
2022-08-23 15:05:11 +0200 <merijn> famubu: "> " in front
2022-08-23 15:05:27 +0200 <famubu> > [[(n,k) | k <- [0..n]] | n <- [0..3] ]
2022-08-23 15:05:28 +0200 <lambdabot> [[(0,0)],[(1,0),(1,1)],[(2,0),(2,1),(2,2)],[(3,0),(3,1),(3,2),(3,3)]]
2022-08-23 15:05:46 +0200 <famubu> Thanks!
2022-08-23 15:07:15 +0200cfricke(~cfricke@user/cfricke)
2022-08-23 15:12:41 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2022-08-23 15:17:18 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 268 seconds)
2022-08-23 15:18:03 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2022-08-23 15:18:41 +0200nate4(~nate@98.45.169.16)
2022-08-23 15:23:51 +0200nate4(~nate@98.45.169.16) (Ping timeout: 256 seconds)
2022-08-23 15:30:17 +0200jgeerds(~jgeerds@55d46bad.access.ecotel.net)
2022-08-23 15:34:40 +0200coot(~coot@213.134.176.158) (Quit: coot)
2022-08-23 15:34:41 +0200nschoe(~quassel@2a04:cec0:116d:ab5f:e90c:6f4d:989:53d0)
2022-08-23 15:38:03 +0200 <tomsmeding> merijn: good luck!
2022-08-23 15:39:02 +0200 <dminuoso> Did he submit his thesis?
2022-08-23 15:39:18 +0200 <merijn> dminuoso: I did *that* literal months ago :p
2022-08-23 15:39:29 +0200 <dminuoso> Hey I did not get the memo
2022-08-23 15:39:35 +0200 <dminuoso> Wasn't very active recently
2022-08-23 15:39:41 +0200 <merijn> dminuoso: The last few weeks were the painful last finishing touches :p
2022-08-23 15:39:56 +0200 <dminuoso> I thought you submitted already, now you're back to finishing?
2022-08-23 15:40:02 +0200 <dminuoso> Which one is it?
2022-08-23 15:40:19 +0200 <merijn> dminuoso: Easy, submit unfinished thesis ;)
2022-08-23 15:40:43 +0200 <dminuoso> Does that even work?
2022-08-23 15:40:47 +0200 <merijn> dminuoso: Specifically, acknowledgements, overall summary, Dutch translation of the summary, cover, etc. don't need to be done to send it to the committee
2022-08-23 15:40:57 +0200 <dminuoso> Like, can you publish an altered thesis?
2022-08-23 15:41:11 +0200 <dminuoso> Or do the alternations need to be accepted as well?
2022-08-23 15:41:52 +0200 <merijn> dminuoso: You're not allowed to make alterations to content (i.e. the science bits), but it doesn't have to be print ready so stuff like acknowledgements, layout, etc.
2022-08-23 15:43:42 +0200 <merijn> dminuoso: So it was just designing a cover, messing with styling and fighting the dreaded overfull/underfull hbox demons :p
2022-08-23 15:44:24 +0200caffery156(~caffery@user/caffery156)
2022-08-23 15:45:03 +0200 <caffery156> guys does haskell creates a new list or map when we change certain value
2022-08-23 15:45:18 +0200 <kuribas> caffery156: yes, but it can share
2022-08-23 15:45:24 +0200 <dminuoso> caffery156: You cannot "change" values, you can only create new ones.
2022-08-23 15:45:48 +0200 <dminuoso> (Well we do have mutability if you need it, but you likely are not referring to that)
2022-08-23 15:46:09 +0200 <kuribas> > let x = [1, 2..] in 2:drop 1 x
2022-08-23 15:46:11 +0200 <lambdabot> [2,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,...
2022-08-23 15:46:16 +0200Pickchea(~private@user/pickchea)
2022-08-23 15:46:36 +0200 <kuribas> caffery156: this doesn't copy all of x, but shares the tail of x
2022-08-23 15:47:20 +0200 <caffery156> yes i am not referring to mutability.I am java programmer and i am curious about haskell.
2022-08-23 15:47:51 +0200 <dminuoso> If I want guaranteed deforestation of Maybe, should I just use a continuation? Or is there some kind of fusion trick like Codensity/Yoneda?
2022-08-23 15:48:15 +0200 <tomsmeding> caffery156: in-memory representation of kuribas' example https://tomsmeding.com/ss/get/tomsmeding/ZXhJj9
2022-08-23 15:48:18 +0200 <dminuoso> caffery156: Well you were asking about mutation. :)
2022-08-23 15:49:51 +0200 <caffery156> tomsmeding: ah i see.so you guys have linkedlist as list?so haskell does not has an "array" i guess
2022-08-23 15:49:58 +0200 <merijn> Sure it does
2022-08-23 15:49:59 +0200 <dminuoso> caffery156: we do have arrays too.
2022-08-23 15:50:19 +0200 <caffery156> dminuoso: ah i meant evalution of value
2022-08-23 15:50:45 +0200 <tomsmeding> but changing an element of an _array_ means copying the array (not necessarily its values -- the array backing structure)
2022-08-23 15:50:47 +0200 <dminuoso> caffery156: Yes, and Im saying: during evaluation we do not have mutation (this is strictly speaking also not true, we can sneak in mutations)
2022-08-23 15:51:19 +0200 <tomsmeding> we do also have actual mutable arrays, but those are slightly harder to use
2022-08-23 15:52:12 +0200 <tomsmeding> you can express your favourite imperative algorithm in haskell, but it's not what the haskell designers were focusing on to make easy or natural
2022-08-23 15:54:02 +0200 <dminuoso> caffery156: To explain my remark, we have facilities to do something like an `in-place quicksort` inside pure code. So we get to have the best of all worlds. Pure code without mutation, limited mutation usable inside pure code, and full imperative code. :)
2022-08-23 15:54:04 +0200waleee(~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340)
2022-08-23 15:54:15 +0200 <caffery156> so if i have array of [1..20] if i wanted to change value 3 to 4.How does haskell changes/replaces value in the list/map without copying the all the contents of the list/map?if the datastructure used is array
2022-08-23 15:54:32 +0200 <[Leary]> dminuoso: You could try `Maybe a ~ forall r. r -> (a -> r) -> r`, but I don't actually know how that will affect performance. I'd be interested to hear, if you benchmark it.
2022-08-23 15:55:07 +0200 <dminuoso> [Leary]: Yeah that's what I was thinking of with continuations. Ill definitely benchmark and let you know
2022-08-23 15:55:10 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2022-08-23 15:55:26 +0200 <lortabac> caffery156: if you use an immutable array then the whole array is copied
2022-08-23 15:55:58 +0200kannon(~NK@135-180-47-54.fiber.dynamic.sonic.net)
2022-08-23 15:56:00 +0200 <geekosaur> note that [1..20] is a linked list, not an array. tails can be shared
2022-08-23 15:56:02 +0200 <lortabac> caffery156: if you use a list, part of the list can be shared
2022-08-23 15:56:10 +0200 <dminuoso> caffery156: I find this question quite interesting, because it turns out situations where you mutate arrays in place are not very common in functional code.
2022-08-23 15:56:12 +0200 <geekosaur> arrays come in mutable and immutable varieties
2022-08-23 15:56:33 +0200 <dminuoso> caffery156: In Haskell a list is less data structure, its more control flow.
2022-08-23 15:56:45 +0200 <dminuoso> Most lists in Haskell represent loops rather
2022-08-23 15:57:07 +0200 <caffery156> by concept wise or actually?
2022-08-23 15:57:08 +0200 <geekosaur> and immutable ones use "cards": the array is split into chunks internally for mutation purposes, and only the chunks that have changes need to be copied
2022-08-23 15:57:38 +0200 <caffery156> oh thats really a beautiful idea which haskell has
2022-08-23 15:57:43 +0200 <caffery156> very efficient
2022-08-23 15:58:08 +0200 <dminuoso> caffery156: Yes and yes. Once you get into "impure access" we're talking about data structure, which puts you into Array/Vector territories.
2022-08-23 15:58:20 +0200img(~img@user/img) (Quit: ZNC 1.8.2 - https://znc.in)
2022-08-23 15:58:48 +0200 <dminuoso> The major exception to this "lists represent loops" is String, which is [Char] as a historical accident rather.
2022-08-23 15:59:07 +0200 <caffery156> oh
2022-08-23 15:59:33 +0200 <geekosaur> enh, it's still useful
2022-08-23 15:59:37 +0200 <dminuoso> But it may help explain why lists are singly linked lists in Haskell. The only useful operation is just taking the head off and doing something, which leaves you with the tail (another list).
2022-08-23 15:59:38 +0200 <caffery156> monads were quiet hard to digest concept
2022-08-23 15:59:42 +0200 <tdammers> even String is arguably a loop more than a data structure
2022-08-23 16:00:08 +0200 <dminuoso> caffery156: And what can you do with the tail? Well again, you can only take its head off and do something, which leaves you with the tail (another list).. and so on.
2022-08-23 16:00:12 +0200 <dminuoso> Until the tail is empty.
2022-08-23 16:00:13 +0200kannon(~NK@135-180-47-54.fiber.dynamic.sonic.net) (Ping timeout: 244 seconds)
2022-08-23 16:00:15 +0200 <dminuoso> That is just a loop.
2022-08-23 16:00:34 +0200 <caffery156> ah you mean loop in recursive sense
2022-08-23 16:00:44 +0200 <dminuoso> Recursion is how we encode loops.
2022-08-23 16:01:20 +0200img(~img@user/img)
2022-08-23 16:01:43 +0200 <caffery156> in all the languages?
2022-08-23 16:02:09 +0200 <dminuoso> Most languages can encode the idea of a loop via recursion, but in many implementations it may not be efficient
2022-08-23 16:02:55 +0200 <caffery156> ya since not all compilers/interpreters do not provide tail recursion
2022-08-23 16:03:00 +0200 <caffery156> optimization
2022-08-23 16:03:46 +0200 <dminuoso> tdammers: Mmm, is it?
2022-08-23 16:04:19 +0200acidjnk(~acidjnk@p200300d6e7137a19a561eed7706d09b0.dip0.t-ipconnect.de) (Ping timeout: 248 seconds)
2022-08-23 16:04:28 +0200 <tdammers> dminuoso: people may not think of it that way, but it's still a "data structure" that is only efficient for loop-like traversal operations
2022-08-23 16:05:51 +0200 <dminuoso> Doesnt GHC at least offer ways to do buffer stealing, so things like fromString wont be frustratingly slow?
2022-08-23 16:06:00 +0200toeffel(~toeffel@user/toeffel)
2022-08-23 16:06:16 +0200 <dminuoso> for say Text
2022-08-23 16:06:41 +0200 <dminuoso> Or no.. looking at the implementation they are streamed into Text
2022-08-23 16:07:12 +0200lortabac(~lortabac@2a01:e0a:541:b8f0:4fe7:bccf:37a6:be4b) (Quit: WeeChat 2.8)
2022-08-23 16:09:10 +0200 <caffery156> geekosaur: what if i have a mutable array in haskell?how does it handles change i want to perform? does haskell has somekind of pointer arrays which is abstracted to us?
2022-08-23 16:09:41 +0200 <dminuoso> caffery156: We have Array, which offers a mutable interface. We also have Vector, which also offers a mutable interface.
2022-08-23 16:09:51 +0200 <kuribas> caffery156: a mutable array in haskell is just like one in Java.
2022-08-23 16:09:58 +0200 <caffery156> ah ok
2022-08-23 16:10:00 +0200 <dminuoso> These can do mutations either in-plane (using ST or IO), or by copying (as pure code)
2022-08-23 16:10:05 +0200 <dminuoso> Let me show you
2022-08-23 16:10:08 +0200 <kuribas> caffery156: the "immutable" bit is the reference to the array.
2022-08-23 16:10:22 +0200 <dminuoso> For simplicity I will just refer to Vector for now, but we have a wealth of other, similar, data types
2022-08-23 16:10:40 +0200 <caffery156> ok i see
2022-08-23 16:11:54 +0200 <dminuoso> https://hackage.haskell.org/package/vector-0.13.0.0/docs/Data-Vector.html gives you something that is similar to java lists. You get to do either pure updates using: https://hackage.haskell.org/package/vector-0.13.0.0/docs/Data-Vector.html#v:-47--47-
2022-08-23 16:12:02 +0200famubu(~famubu@user/famubu) (Quit: leaving)
2022-08-23 16:13:03 +0200 <dminuoso> You can also turn a Vector into a mutable Vector https://hackage.haskell.org/package/vector-0.13.0.0/docs/Data-Vector.html#v:thaw, and then write https://hackage.haskell.org/package/vector-0.13.0.0/docs/Data-Vector-Mutable.html#v:write to a given location and modify it in place.
2022-08-23 16:13:32 +0200 <dminuoso> And if you're done with your modifications, you can freeze https://hackage.haskell.org/package/vector-0.13.0.0/docs/Data-Vector.html#v:freeze it and get a non-mutable vector back
2022-08-23 16:14:22 +0200 <dminuoso> (thaw copies the underlying vector, and then inside the ST/IO region you can do all kinds of imperative modifications with it, and freeze copies it back into an immutable vector
2022-08-23 16:15:52 +0200 <caffery156> nice thats quiet lot of inbuilt functionaliy
2022-08-23 16:16:52 +0200 <dminuoso> It's not really built-in, they are Haskell libraries (though they are official Haskell libraries and come with GHC)
2022-08-23 16:17:45 +0200 <geekosaur> there is built in functionality that's used by Array, Vector, ByteString, Text, etc. though
2022-08-23 16:18:15 +0200segfaultfizzbuzz(~segfaultf@192-184-223-154.static.sonic.net)
2022-08-23 16:22:31 +0200segfaultfizzbuzz(~segfaultf@192-184-223-154.static.sonic.net) (Ping timeout: 252 seconds)
2022-08-23 16:22:50 +0200waleee(~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Ping timeout: 255 seconds)
2022-08-23 16:23:15 +0200waleee(~waleee@h-176-10-137-138.NA.cust.bahnhof.se)
2022-08-23 16:24:43 +0200o-90(~o-90@gateway/tor-sasl/o-90)
2022-08-23 16:26:30 +0200o-90(~o-90@gateway/tor-sasl/o-90) (Remote host closed the connection)
2022-08-23 16:28:38 +0200zmt01(~zmt00@user/zmt00)
2022-08-23 16:30:01 +0200mastarija(~mastarija@2a05:4f46:e03:6000:2897:ebb0:5975:dab9)
2022-08-23 16:30:42 +0200zmt00(~zmt00@user/zmt00) (Ping timeout: 244 seconds)
2022-08-23 16:34:14 +0200shriekingnoise(~shrieking@186.137.167.202)
2022-08-23 16:40:01 +0200 <dminuoso> tomsmeding: Hah, I came up with another solution that apparently works *well* enough.
2022-08-23 16:41:34 +0200 <dminuoso> I unpack the ShortByteString into [Word8], convert them into DList, map with w2c, and then I build them with Data.Text.unpack (which has a streaming framework underneath). As an extra optimization I can precalculate the buffer size and construcft the underlying Stream by hand, so only a single allocation ever takes place
2022-08-23 16:41:57 +0200 <dminuoso> The core trick is the DList, which allows me to just concatenate all the domain labels together quickly
2022-08-23 16:43:26 +0200 <dminuoso> https://paste.tomsmeding.com/SzdhzWGC
2022-08-23 16:44:17 +0200 <dminuoso> It wasnt until this discussion just a moment ago, that I took a look at how `IsString Text` was implemented. At that point I realized Text had a suitable character-by-character streaming framework
2022-08-23 16:50:41 +0200bitmapper(uid464869@id-464869.lymington.irccloud.com)
2022-08-23 16:53:55 +0200waleee(~waleee@h-176-10-137-138.NA.cust.bahnhof.se) (Ping timeout: 248 seconds)
2022-08-23 16:54:27 +0200segfaultfizzbuzz(~segfaultf@192-184-223-154.static.sonic.net)
2022-08-23 16:59:02 +0200segfaultfizzbuzz(~segfaultf@192-184-223-154.static.sonic.net) (Ping timeout: 256 seconds)
2022-08-23 17:01:26 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2022-08-23 17:02:00 +0200Achylles(~Achylles_@2804:431:d725:6988:1e6b:2df1:d746:824)
2022-08-23 17:02:27 +0200CiaoSen(~Jura@p200300c95738a5002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 248 seconds)
2022-08-23 17:10:45 +0200 <tomsmeding> dminuoso: cool!
2022-08-23 17:11:11 +0200 <dminuoso> With this in place, I can just inject the escaping into the stream of characters. :)
2022-08-23 17:11:16 +0200 <tomsmeding> it feels to me like having a chain of closures, i.e. what DList gives you, should not be very efficient; but perhaps the RTS is so good that it does actually work well :p
2022-08-23 17:11:31 +0200 <tomsmeding> do ping back about benchmarks
2022-08-23 17:11:57 +0200 <dminuoso> Yeah, I will provide a few alternate implementations and benchmark them.
2022-08-23 17:12:20 +0200 <dminuoso> With the sample size from our production compiler its more than sufficient to bring the pretty printing back to 0.01% of total runtime
2022-08-23 17:12:39 +0200 <tomsmeding> oh wow
2022-08-23 17:12:41 +0200 <tomsmeding> so it does really work
2022-08-23 17:13:03 +0200 <tomsmeding> I would never have expected a chain of closures to be really constant-factor efficient
2022-08-23 17:13:29 +0200 <dminuoso> Well that is what DList is for, no?
2022-08-23 17:13:35 +0200 <tomsmeding> does it get optimised to a tight loop by GHC? Feels super hard to me. Or do processors just not care as much about indirect calls as I thought they did?
2022-08-23 17:13:58 +0200 <tomsmeding> dminuoso: DList is for fixing complexity issues, not for necessarily getting great constant-factor performance
2022-08-23 17:14:34 +0200 <dminuoso> complexity issues? and here I was, thinking it was a vehicle for getting constant append on lists.
2022-08-23 17:14:39 +0200 <tomsmeding> or was the original implementation so grossly inefficient that a tight loop would still be faster than DList, but DList is already more than fast enough?
2022-08-23 17:14:43 +0200cfricke(~cfricke@user/cfricke) (Quit: WeeChat 3.6)
2022-08-23 17:14:46 +0200 <tomsmeding> dminuoso: that's a complexity issue
2022-08-23 17:15:02 +0200 <tomsmeding> ((a ++ b) ++ c) ++ d has quadratic complexity, whereas doing it via DList has linear complexity
2022-08-23 17:15:14 +0200 <tomsmeding> not constant, linear
2022-08-23 17:15:28 +0200 <dminuoso> tomsmeding: Well so the underlying trick is not necessarily DList, but the Stream framework of `text`
2022-08-23 17:15:43 +0200 <tomsmeding> (well, the <> is constant-time, but to convert it back to a list takes linear time)
2022-08-23 17:16:02 +0200 <dminuoso> So if I do a simple `pprLabel :: DomainLabel -> String`, I would still suffer from a complexity problem as I would have to ((a ++ b) ++ c) these labels together
2022-08-23 17:16:28 +0200vysn(~vysn@user/vysn)
2022-08-23 17:16:28 +0200 <tomsmeding> I have never understood those RULE-based streaming frameworks, and I still don't
2022-08-23 17:16:29 +0200 <dminuoso> tomsmeding: The linear time price is irrelevant, because to consume a list you *eventually* have to go through it
2022-08-23 17:16:35 +0200 <tomsmeding> so that might be where the magic is
2022-08-23 17:16:40 +0200 <tomsmeding> dminuoso: true
2022-08-23 17:17:07 +0200 <dminuoso> As far as I can tell, its not really RULE based
2022-08-23 17:17:23 +0200 <tomsmeding> then how is it all compiled down to a tight loop???
2022-08-23 17:17:29 +0200 <dminuoso> https://hackage.haskell.org/package/text-2.0.1/docs/src/Data.Text.Internal.Encoding.Fusion.html#un…
2022-08-23 17:17:51 +0200 <dminuoso> tomsmeding: because it just *is* a tight loop
2022-08-23 17:18:10 +0200 <tomsmeding> that traverses this linked list of instructions
2022-08-23 17:18:17 +0200 <dminuoso> Oh I see what you mean
2022-08-23 17:18:21 +0200 <tomsmeding> hm, it can't be that simple
2022-08-23 17:18:50 +0200 <tomsmeding> what I mean with a tight loop in this case is a tight loop that reads from a buffer and writes to a buffer
2022-08-23 17:18:56 +0200 <dminuoso> The stream builder just injects each characfter at a time
2022-08-23 17:19:01 +0200caffery156(~caffery@user/caffery156) (Quit: WeeChat 3.6)
2022-08-23 17:19:08 +0200 <dminuoso> Yeah
2022-08-23 17:19:09 +0200 <tomsmeding> not some haskell code that produces a linked list and a tight loop that consumes said linked list
2022-08-23 17:19:16 +0200 <dminuoso> Ultimately the main problem is lack of text-2.0
2022-08-23 17:19:18 +0200 <tomsmeding> maybe those get fused together!
2022-08-23 17:19:22 +0200 <tomsmeding> I don't know!@
2022-08-23 17:19:26 +0200 <tomsmeding> But it feels really hard
2022-08-23 17:19:29 +0200 <dminuoso> Otherwise this would just be bunch of buffer copies at various offsets
2022-08-23 17:19:49 +0200 <tomsmeding> right, and buffer copies are ✨
2022-08-23 17:20:15 +0200 <dminuoso> Yeah, which is why Im tempted to do still do this in C
2022-08-23 17:20:20 +0200 <dminuoso> at least for text < 2
2022-08-23 17:20:33 +0200 <tomsmeding> at least compare it with my naive2 if at all reasonable in terms of time investment
2022-08-23 17:20:50 +0200 <dminuoso> Your naive2 is what I was going for. :)
2022-08-23 17:21:04 +0200 <tomsmeding> though you'd have to inject the escaping, I guess
2022-08-23 17:21:08 +0200 <dminuoso> I was just busy rebuilding the escaping logic and offset calculations with continuattions
2022-08-23 17:21:17 +0200 <dminuoso> Sure, I would just do that in C.
2022-08-23 17:21:40 +0200 <dminuoso> Know whats still sad about it?
2022-08-23 17:21:48 +0200 <dminuoso> I have to use a pinned buffer each time
2022-08-23 17:22:11 +0200 <tomsmeding> why?
2022-08-23 17:23:02 +0200 <dminuoso> Because there's no way to get Ptr into a non-pinned ByteArray
2022-08-23 17:23:09 +0200 <dminuoso> https://hackage.haskell.org/package/primitive-0.7.4.0/docs/Data-Primitive-ByteArray.html#v:byteArr…
2022-08-23 17:23:28 +0200 <tomsmeding> ah you need the pinning to be able to pass it to C
2022-08-23 17:23:31 +0200 <tomsmeding> that makes sense
2022-08-23 17:23:32 +0200 <dminuoso> No!
2022-08-23 17:23:34 +0200 <tomsmeding> oh
2022-08-23 17:23:35 +0200 <dminuoso> That's the sadness of it.
2022-08-23 17:23:44 +0200 <dminuoso> If you use an unsafe call, you can pass pointers to unpinned memory just fine.
2022-08-23 17:23:55 +0200 <dminuoso> But apparently there's no safe way to get a Ptr to unpinned memory
2022-08-23 17:23:59 +0200 <dminuoso> *unpinned ByteArray#
2022-08-23 17:24:17 +0200 <tomsmeding> then how would you normally pass a pointer to unpinned memory to C
2022-08-23 17:24:36 +0200 <dminuoso> No clue ¯\_(ツ)_/¯
2022-08-23 17:24:40 +0200 <dminuoso> I wondered that myself
2022-08-23 17:24:45 +0200 <tomsmeding> like, if not this, then what
2022-08-23 17:25:07 +0200 <tomsmeding> there _is_ no other sensible thing to pass to C that is not a primitive type
2022-08-23 17:25:16 +0200 <dminuoso> Maybe it works for other primitive things?
2022-08-23 17:25:23 +0200 <tomsmeding> such as?
2022-08-23 17:25:28 +0200 <dminuoso> dminuoso | No clue ¯\_(ツ)_/¯
2022-08-23 17:25:31 +0200 <tomsmeding> :')
2022-08-23 17:25:32 +0200 <tomsmeding> my point
2022-08-23 17:25:56 +0200 <dminuoso> All I know is, the documentation says its unsafe, but the ffi documentation says you can pass unpinned memory in unsafe FFI calls
2022-08-23 17:27:09 +0200 <dminuoso> tomsmeding: More confusing: https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/ffi.html
2022-08-23 17:27:15 +0200 <dminuoso> Explicitly mentions `unpinned ByteArray#`
2022-08-23 17:27:22 +0200 <dminuoso> But...
2022-08-23 17:27:25 +0200 <dminuoso> Hey I have an idea.
2022-08-23 17:27:41 +0200 <tomsmeding> dminuoso: see also 6.17.3.6, which explicitly mentions byteArrayContents# even
2022-08-23 17:27:42 +0200 <dminuoso> tomsmeding: I just understood, I think.
2022-08-23 17:28:09 +0200dsrt^(~dsrt@96.70.11.181) (Remote host closed the connection)
2022-08-23 17:28:11 +0200 <dminuoso> tomsmeding: WEll that section just says you can use it on a pinned bytearray
2022-08-23 17:28:16 +0200 <dminuoso> The crus is just the Ptr conversion
2022-08-23 17:28:18 +0200 <dminuoso> *crux
2022-08-23 17:28:35 +0200 <dminuoso> Nothing prevents you from declaring an ffi like this:
2022-08-23 17:29:01 +0200 <dminuoso> `foreign import ccall unsafe "foo" foo :: MutableByteArray# RealWorld -> IO ()`
2022-08-23 17:29:12 +0200 <dminuoso> (That RealWorld token there, I love it)
2022-08-23 17:29:26 +0200 <tomsmeding> see also this table https://downloads.haskell.org/ghc/latest/docs/users_guide/exts/ffi.html#id9
2022-08-23 17:29:40 +0200 <dminuoso> tomsmeding: Yes, read the table carefully.
2022-08-23 17:29:42 +0200 <dminuoso> Actually its all there
2022-08-23 17:29:49 +0200 <dminuoso> "When value is used as asrugment to FFI call that is"
2022-08-23 17:30:01 +0200 <dminuoso> Not "Soundness when casting to PTR"
2022-08-23 17:30:08 +0200 <tomsmeding> I see
2022-08-23 17:30:23 +0200 <tomsmeding> question is, what C type does `MutableByteArray# RealWorld` translate to
2022-08-23 17:30:44 +0200 <dminuoso> `uint8_t*` works according to the example
2022-08-23 17:31:02 +0200tomsmedingshould have scrolled down 3cm further
2022-08-23 17:31:06 +0200 <dminuoso> I know right
2022-08-23 17:31:23 +0200 <dminuoso> Though Im not really sure wabout the logic there
2022-08-23 17:31:34 +0200 <tomsmeding> is there documentation about the precise translation of FFI types to C types
2022-08-23 17:31:35 +0200 <dminuoso> The next example maps ArrayArray# (that name...) to `StgArrBytes **`
2022-08-23 17:31:43 +0200 <tomsmeding> there is also ArrayArrayArray#
2022-08-23 17:32:08 +0200 <tomsmeding> or rather, was, since with some recent GHC version (9.4?) the Array(Array)+# things got redundant
2022-08-23 17:32:57 +0200 <dminuoso> Maybe you can just whatever you want in the C code?
2022-08-23 17:33:04 +0200 <dminuoso> I mean there's just linkage
2022-08-23 17:33:05 +0200 <tomsmeding> like `float`?
2022-08-23 17:33:10 +0200 <dminuoso> Maybe yes?
2022-08-23 17:33:11 +0200 <tomsmeding> that's clearly invalid
2022-08-23 17:33:14 +0200 <tomsmeding> I mean, it would compile
2022-08-23 17:33:21 +0200 <tomsmeding> but wouldn't do anything useful
2022-08-23 17:33:25 +0200 <dminuoso> It would be punning.
2022-08-23 17:33:31 +0200 <tomsmeding> no worse than punning
2022-08-23 17:33:39 +0200 <tomsmeding> if you pun within C, at least you get data
2022-08-23 17:33:45 +0200 <tomsmeding> here you might mess up the calling convention
2022-08-23 17:33:48 +0200 <dminuoso> Oh.
2022-08-23 17:33:57 +0200 <dminuoso> I guess there is that, heh
2022-08-23 17:34:07 +0200 <dminuoso> But you dont need any header files
2022-08-23 17:34:09 +0200 <tomsmeding> though if you use "capi" that might be slightly less bad
2022-08-23 17:34:16 +0200 <dminuoso> Or do you?
2022-08-23 17:34:58 +0200 <dminuoso> tomsmeding: Oh hold on!
2022-08-23 17:35:03 +0200 <dminuoso> Reading documentation helps!
2022-08-23 17:35:07 +0200 <tomsmeding> yes
2022-08-23 17:35:10 +0200 <dminuoso> "When passing any of the unlifted array types as an argument to a foreign C call, a foreign function sees a pointer that refers to the payload of the array"
2022-08-23 17:35:11 +0200 <tomsmeding> question is, which
2022-08-23 17:35:16 +0200 <tomsmeding> ah
2022-08-23 17:35:16 +0200 <dminuoso> So you always get a pointer.
2022-08-23 17:35:24 +0200 <dminuoso> And what that points at, I guess it really doesnt matter
2022-08-23 17:35:46 +0200 <dminuoso> So you can specify whatever pointee-type you want in the C function, ideally saving you a cast.
2022-08-23 17:35:49 +0200 <tomsmeding> table 8.2 in the haskell report at least explicitly gives the correspondence https://www.haskell.org/onlinereport/haskell2010/haskellch8.html
2022-08-23 17:36:29 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2022-08-23 17:37:10 +0200toeffel(~toeffel@user/toeffel) (Quit: quit)
2022-08-23 17:37:38 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2022-08-23 17:37:52 +0200 <tomsmeding> the ghc documentation is not super explicit, but at least you can indeed conclude that for ByteArray# you get an uint8_t*
2022-08-23 17:38:02 +0200 <tomsmeding> seems like you just get the heap representatoin
2022-08-23 17:38:12 +0200 <tomsmeding> "Although GHC allows the user to pass all unlifted boxed types to foreign functions, some of them are not amenable to useful work. Although Array# is unlifted, the elements in its payload are lifted, and a foreign C function cannot safely force thunks. Consequently, a foreign C function may not dereference any of the addresses that comprise the payload of the Array#."
2022-08-23 17:38:22 +0200 <tomsmeding> scaaaary
2022-08-23 17:38:43 +0200Pickchea(~private@user/pickchea) (Ping timeout: 248 seconds)
2022-08-23 17:39:07 +0200 <raehik> Is there a way I can tell GHC "don't warn on non-exhaustive pattern matches here, because you did it wrong"?
2022-08-23 17:39:32 +0200 <raehik> some singletons code compiles with no warnings on 9.2, but warns on 9.0
2022-08-23 17:39:53 +0200coot(~coot@213.134.176.158)
2022-08-23 17:40:51 +0200coot(~coot@213.134.176.158) (Client Quit)
2022-08-23 17:41:20 +0200coot(~coot@213.134.176.158)
2022-08-23 17:47:15 +0200segfaultfizzbuzz(~segfaultf@192-184-223-154.static.sonic.net)
2022-08-23 17:47:51 +0200etra0(~quassel@186-78-139-217.baf.movistar.cl)
2022-08-23 17:50:47 +0200aeka(~aeka@user/hiruji) (Ping timeout: 244 seconds)
2022-08-23 17:51:29 +0200segfaultfizzbuzz(~segfaultf@192-184-223-154.static.sonic.net) (Ping timeout: 255 seconds)
2022-08-23 17:51:50 +0200nineonine(~nineonine@2604:3d08:7780:cd00:5cc0:4b6c:24b1:bf92)
2022-08-23 17:53:08 +0200merijn(~merijn@c-001-001-007.client.esciencecenter.eduvpn.nl) (Quit: testing)
2022-08-23 17:53:43 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2022-08-23 17:55:08 +0200ddellacosta(~ddellacos@143.244.47.100) (Ping timeout: 256 seconds)
2022-08-23 17:57:59 +0200segfaultfizzbuzz(~segfaultf@192-184-223-154.static.sonic.net)
2022-08-23 17:59:29 +0200jgeerds(~jgeerds@55d46bad.access.ecotel.net) (Ping timeout: 268 seconds)
2022-08-23 18:00:12 +0200goran[m](~goranoour@2001:470:69fc:105::2:1b44) (Quit: You have been kicked for being idle)
2022-08-23 18:00:25 +0200akegalj(~akegalj@135-40.dsl.iskon.hr) (Ping timeout: 252 seconds)
2022-08-23 18:00:49 +0200ccntrq(~Thunderbi@172.209.94.92.rev.sfr.net) (Ping timeout: 256 seconds)
2022-08-23 18:05:11 +0200gurkenglas(~gurkengla@p548ac72e.dip0.t-ipconnect.de) (Ping timeout: 252 seconds)
2022-08-23 18:06:06 +0200econo(uid147250@user/econo)
2022-08-23 18:06:18 +0200nschoe(~quassel@2a04:cec0:116d:ab5f:e90c:6f4d:989:53d0) (Ping timeout: 268 seconds)
2022-08-23 18:06:22 +0200nschoe_(~quassel@2a01:e0a:8e:a190:c21d:44a3:63e2:38ba)
2022-08-23 18:07:25 +0200ccntrq(~Thunderbi@172.209.94.92.rev.sfr.net)
2022-08-23 18:08:48 +0200nschoe_(~quassel@2a01:e0a:8e:a190:c21d:44a3:63e2:38ba) (Client Quit)
2022-08-23 18:10:04 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
2022-08-23 18:10:39 +0200omantere(~pi@85-156-109-34.elisa-laajakaista.fi) (Ping timeout: 268 seconds)
2022-08-23 18:10:41 +0200szkl(uid110435@id-110435.uxbridge.irccloud.com) (Quit: Connection closed for inactivity)
2022-08-23 18:17:14 +0200mbuf(~Shakthi@122.165.55.71) (Quit: Leaving)
2022-08-23 18:19:05 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2022-08-23 18:19:14 +0200acidjnk(~acidjnk@p200300d6e7137a36187ce24caf80a2df.dip0.t-ipconnect.de)
2022-08-23 18:26:34 +0200matthewmosior(~matthewmo@173.170.253.91) (Remote host closed the connection)
2022-08-23 18:27:23 +0200remedan(~remedan@octo.cafe) (Ping timeout: 268 seconds)
2022-08-23 18:31:36 +0200pavonia(~user@user/siracusa) (Quit: Bye!)
2022-08-23 18:31:59 +0200remedan(~remedan@octo.cafe)
2022-08-23 18:42:43 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-08-23 18:43:22 +0200 <mastarija> raehik: {-# OPTIONS_GHC -Wno-incomplete-patterns #-}
2022-08-23 18:43:45 +0200 <mastarija> https://downloads.haskell.org/~ghc/latest/docs/users_guide/flags.html?highlight=fno%20warn%20incom…
2022-08-23 18:44:33 +0200 <raehik> mastarija: thanks, there was a stackoverflow question that indicated it might not work so I hadn't tried
2022-08-23 18:44:39 +0200 <raehik> that ^ might not work*
2022-08-23 18:44:59 +0200 <raehik> I removed the --pedantic flag from the build and I'm a lot happier
2022-08-23 18:45:43 +0200 <mastarija> :)
2022-08-23 18:47:06 +0200matthewmosior(~matthewmo@173.170.253.91) (Ping timeout: 244 seconds)
2022-08-23 18:48:11 +0200AndrewWaxCPU
2022-08-23 18:49:07 +0200ubert(~Thunderbi@77.119.220.133.wireless.dyn.drei.com) (Ping timeout: 248 seconds)
2022-08-23 18:49:31 +0200ubert(~Thunderbi@178.165.182.158.wireless.dyn.drei.com)
2022-08-23 18:52:14 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2022-08-23 18:54:08 +0200mastarija(~mastarija@2a05:4f46:e03:6000:2897:ebb0:5975:dab9) (Quit: WeeChat 3.5)
2022-08-23 18:54:30 +0200ardell(~ardell@user/ardell)
2022-08-23 18:55:25 +0200segfaultfizzbuzz(~segfaultf@192-184-223-154.static.sonic.net) (Ping timeout: 252 seconds)
2022-08-23 19:03:41 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2022-08-23 19:10:35 +0200akegalj(~akegalj@135-40.dsl.iskon.hr)
2022-08-23 19:10:38 +0200 <lbseale> Axman6: thanks for your suggestion yesterday ... it absolutely seems like this would work. Is there any reason to worry about memory usage?
2022-08-23 19:14:06 +0200Pickchea(~private@user/pickchea)
2022-08-23 19:14:36 +0200segfaultfizzbuzz(~segfaultf@192-184-223-154.static.sonic.net)
2022-08-23 19:15:53 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-08-23 19:20:11 +0200nate4(~nate@98.45.169.16)
2022-08-23 19:20:43 +0200matthewmosior(~matthewmo@173.170.253.91) (Ping timeout: 256 seconds)
2022-08-23 19:21:59 +0200gurkenglas(~gurkengla@p548ac72e.dip0.t-ipconnect.de)
2022-08-23 19:22:28 +0200wootehfoot(~wootehfoo@user/wootehfoot)
2022-08-23 19:24:51 +0200nate4(~nate@98.45.169.16) (Ping timeout: 248 seconds)
2022-08-23 19:25:30 +0200alternateved(~user@staticline-31-183-146-203.toya.net.pl) (Remote host closed the connection)
2022-08-23 19:30:14 +0200tzh(~tzh@c-24-21-73-154.hsd1.wa.comcast.net)
2022-08-23 19:34:53 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2022-08-23 19:37:25 +0200 <segfaultfizzbuzz> tried: '/opt/homebrew/opt/ghc/lib/ghc-8.10.7/bytestring-0.10.12.0/libHSbytestring-0.10.12.0-ghc8.10.7.dylib' (no such file), '/usr/local/lib/libHSbytestring-0.10.12.0-ghc8.10.7.dylib' (no such file), '/usr/lib/libHSbytestring-0.10.12.0-ghc8.10.7.dylib' (no such file) ...?
2022-08-23 19:37:52 +0200 <segfaultfizzbuzz> i'm guessing this is a path thing but it is already trying a sensible path, i think?
2022-08-23 19:38:37 +0200szkl(uid110435@id-110435.uxbridge.irccloud.com)
2022-08-23 19:39:44 +0200 <segfaultfizzbuzz> oh, ... it's a missing dependency it seems... but i was kind of expecting that to automatically resolve...?
2022-08-23 19:39:59 +0200 <segfaultfizzbuzz> wait scratch that, that is not a missing dependency
2022-08-23 19:40:28 +0200Achylles(~Achylles_@2804:431:d725:6988:1e6b:2df1:d746:824) (Remote host closed the connection)
2022-08-23 19:41:02 +0200a6a45081-2b83(~aditya@50.47.112.150)
2022-08-23 19:41:15 +0200 <geekosaur> do you need to install dynamic libs separately? ghjc normally uses static for Haskell dependencies
2022-08-23 19:41:35 +0200 <geekosaur> it's not that unusual for dynamic (and profiling) libs/ways to be separate installs
2022-08-23 19:41:48 +0200 <segfaultfizzbuzz> i'm trying to use either cabal or stack for the first time on an m1
2022-08-23 19:42:01 +0200 <a6a45081-2b83> Hi, so I'm writing a compiler for a subset of haskell and I am thinking how to handle wildcards. Have a `Maybe (case mapping) (default mapping)` or duplicate code?
2022-08-23 19:42:04 +0200 <segfaultfizzbuzz> and as my first attempt i am adding brick to a project via the cabal file
2022-08-23 19:42:17 +0200Benzi-Juniorfucked up
2022-08-23 19:42:21 +0200 <segfaultfizzbuzz> i also added vty after adding only brick but am continuing to get this dylib error
2022-08-23 19:43:39 +0200 <geekosaur> bytestring should have come with ghc
2022-08-23 19:43:49 +0200 <geekosaur> why are you building -dynamic anyway?
2022-08-23 19:44:09 +0200 <segfaultfizzbuzz> i literally don't know what i am doing here i just told cabal to make a new project
2022-08-23 19:44:49 +0200 <segfaultfizzbuzz> so i ran cabal init --interactive and then only added brick (and then vty) to the myproject.cabal file
2022-08-23 19:45:19 +0200 <segfaultfizzbuzz> i don't see a "-dynamic" option set anywhere at the moment,...
2022-08-23 19:45:52 +0200 <segfaultfizzbuzz> i'm guessing haskell doesn't really work on macos/m1 ..?
2022-08-23 19:46:56 +0200 <geekosaur> many people use it successfully
2022-08-23 19:47:09 +0200 <segfaultfizzbuzz> ok... anyway, i didn't type -dynamic myself at any point
2022-08-23 19:49:05 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-08-23 19:49:17 +0200qrpnxz(~qrpnxz@fsf/member/qrpnxz)
2022-08-23 19:49:32 +0200 <geekosaur> if you used ghcup to install ghc then I have to punt to maerwald because I can't imagine why either it defaulted to -dynamic or why the dynamic libs are missing
2022-08-23 19:49:53 +0200 <segfaultfizzbuzz> this is what my ghcup tui looks like: https://paste.rs/CDA
2022-08-23 19:50:05 +0200 <Benzi-Junior> so have a problem that essentially boils down to "least likely path" or to put it another way "shortest path in a probability space" so I decided to grab the search-algorthims package and use that ... once I start testing I realize I'm getting results that are above 1, because the search algorithm adds up rather than multiplying (of course), is anyone familiar with the search-algorithms package
2022-08-23 19:50:08 +0200 <Benzi-Junior> and sees an easier fix for me than copying the entire package contents to make the change ?
2022-08-23 19:52:59 +0200raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 255 seconds)
2022-08-23 19:53:26 +0200matthewmosior(~matthewmo@173.170.253.91) (Ping timeout: 255 seconds)
2022-08-23 19:54:48 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
2022-08-23 19:54:56 +0200raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
2022-08-23 19:56:37 +0200remedan(~remedan@octo.cafe) (Quit: Bye!)
2022-08-23 19:57:07 +0200odnes(~odnes@5-203-171-254.pat.nym.cosmote.net)
2022-08-23 19:57:37 +0200 <geekosaur> oh. do you have DYLD_LIBRARY_PATH set at all?
2022-08-23 19:58:07 +0200 <segfaultfizzbuzz> i'm not familiar with that, is that an LLVM or C or C/C++ on MacOS thing?
2022-08-23 19:58:15 +0200 <geekosaur> if so, stop it. it is not the same as Linux's LD_LIBRARY_PATH and will break things
2022-08-23 19:58:20 +0200 <geekosaur> it's a MacOS thing
2022-08-23 19:58:29 +0200 <segfaultfizzbuzz> yeah i'm not familiar with macos lol
2022-08-23 19:58:54 +0200 <geekosaur> and some people suggest setting it as if it were Linux's LD_LIBRARY_PATH, but it causes confusing breakage
2022-08-23 19:59:42 +0200 <segfaultfizzbuzz> i mean, export | grep DYLD shows nothing...
2022-08-23 19:59:44 +0200 <geekosaur> \anyway at this point I think I have to defer to maerwald, but I don't know if/when he'll be around
2022-08-23 19:59:47 +0200 <geekosaur> good
2022-08-23 19:59:48 +0200 <akegalj> I run into interesting implementation of breadth first search in haskell https://github.com/aaronallen8455/IHaskellNotebooks/blob/master/Breadth%20First%20Search.ipynb and in the second example there is some higher order function kungfu that confuses me. He defines function "let f (Node x xs) fw bw = x : fw (xs : bw)" which has nice expected type "Tree a -> ([Forest a] -> [a]) -> [Forest a] -> [a]" but
2022-08-23 19:59:54 +0200 <akegalj> later he does "foldl (foldr f) b qs []" which breaks my mind. So to check it I replaced Node with tupple and defined in my repl "let f (x:xs) fw bw = x : fw (xs : bw)" and asked for a type "f :: [a] -> ([[a]] -> [a]) -> [[a]] -> [a]". All seems good for now. Then I asked for ":t (foldr f)" and got "(foldr f) :: Foldable t => ([[a]] -> [a]) -> t [a] -> [[a]] -> [a]" . Can someone handhold and explain how
2022-08-23 20:00:01 +0200 <akegalj> `foldr f` got this type?
2022-08-23 20:00:16 +0200Hemmo(~IceChat95@2001:999:708:eb97:3d6e:5240:1496:7668)
2022-08-23 20:01:03 +0200azimut(~azimut@gateway/tor-sasl/azimut)
2022-08-23 20:02:13 +0200kuribas(~user@ptr-17d51ep2y03n1mswpe5.18120a2.ip6.access.telenet.be) (Quit: ERC (IRC client for Emacs 26.3))
2022-08-23 20:03:03 +0200 <Hemmo> https://paste.tomsmeding.com/vcfoutjB : Is there a way to compare those two statements to eachother in a one liner? As in anything compared with Unk3 equals Unk3. Seems sort of verbose and I just thought if there's a way to do it otherwise? I tried || between, but eh. Didn't work!
2022-08-23 20:03:36 +0200remedan(~remedan@octo.cafe)
2022-08-23 20:05:06 +0200 <qrpnxz> Hemmo: no
2022-08-23 20:05:34 +0200 <Hemmo> qrpnxz: Thanks!
2022-08-23 20:05:56 +0200 <qrpnxz> well, you could put them in variables and do | a == Un || b == Un, but is that better? hendi
2022-08-23 20:05:59 +0200 <qrpnxz> Hemmo:
2022-08-23 20:06:30 +0200wonko(~wjc@2a0e:1c80:2::130)
2022-08-23 20:06:39 +0200 <qrpnxz> to me it seems worse
2022-08-23 20:06:45 +0200 <Hemmo> Yeah probably
2022-08-23 20:06:49 +0200 <Hemmo> Just a random thought, really ;D
2022-08-23 20:06:55 +0200 <qrpnxz> np
2022-08-23 20:06:57 +0200 <Hemmo> Functions well enough with my way =)
2022-08-23 20:08:22 +0200wootehfoot(~wootehfoo@user/wootehfoot) (Ping timeout: 268 seconds)
2022-08-23 20:09:11 +0200nineonine(~nineonine@2604:3d08:7780:cd00:5cc0:4b6c:24b1:bf92) (Ping timeout: 255 seconds)
2022-08-23 20:10:13 +0200 <qrpnxz> a == b = not $ any (== Un) [a, b]
2022-08-23 20:10:15 +0200 <qrpnxz> lol
2022-08-23 20:10:29 +0200 <qrpnxz> if you had like 15 arguments this would be worth it
2022-08-23 20:10:58 +0200Tuplanolla(~Tuplanoll@91-159-69-12.elisa-laajakaista.fi)
2022-08-23 20:10:59 +0200azimut(~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection)
2022-08-23 20:11:17 +0200azimut(~azimut@gateway/tor-sasl/azimut)
2022-08-23 20:11:44 +0200Midjak(~Midjak@82.66.147.146)
2022-08-23 20:12:17 +0200segfaultfizzbuzz(~segfaultf@192-184-223-154.static.sonic.net) (Ping timeout: 256 seconds)
2022-08-23 20:14:19 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-08-23 20:14:45 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2022-08-23 20:16:20 +0200SebastianM(~seba@user/sebastianm)
2022-08-23 20:17:46 +0200nschoe(~quassel@2a01:e0a:8e:a190:c21d:44a3:63e2:38ba)
2022-08-23 20:19:55 +0200 <[Leary]> akegalj: Understanding what's happening in that code might be difficult, but understanding how `foldr f` got its type shouldn't be; it's pretty much mechanical substitution from the type of `f`. Bear in mind that `b` in the type signature of `foldr` can be a function type.
2022-08-23 20:20:02 +0200 <[Leary]> % :t foldr
2022-08-23 20:20:03 +0200 <yahb2> foldr :: Foldable t => (a -> b -> b) -> b -> t a -> b
2022-08-23 20:20:11 +0200 <[Leary]> % :t foldr (undefined :: a -> (c -> d) -> (c -> d))
2022-08-23 20:20:11 +0200 <yahb2> foldr (undefined :: a -> (c -> d) -> (c -> d)) ; :: Foldable t => (c -> d) -> t a -> c -> d
2022-08-23 20:23:33 +0200hrberg(~quassel@171.79-160-161.customer.lyse.net) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
2022-08-23 20:23:47 +0200hrberg(~quassel@171.79-160-161.customer.lyse.net)
2022-08-23 20:23:54 +0200vysn(~vysn@user/vysn) (Quit: WeeChat 3.5)
2022-08-23 20:26:06 +0200 <akegalj> [Leary]: ok that example clicked ... let me try to do the above step myself again
2022-08-23 20:26:53 +0200a6a45081-2b83(~aditya@50.47.112.150) (Remote host closed the connection)
2022-08-23 20:27:20 +0200 <qrpnxz> seems to me that code could use a couple of comments :)
2022-08-23 20:28:39 +0200 <qrpnxz> btw also checkout https://hackage.haskell.org/package/containers-0.6.6/docs/Data-Graph.html the paper there deals with depth-first search
2022-08-23 20:29:49 +0200 <akegalj> [Leary]: thanks a lot - it clicked now
2022-08-23 20:29:52 +0200jgeerds(~jgeerds@55d46bad.access.ecotel.net)
2022-08-23 20:30:09 +0200 <akegalj> qrpnxz: thanks!
2022-08-23 20:32:08 +0200Lord_of_Life(~Lord@user/lord-of-life/x-2819915) (Ping timeout: 255 seconds)
2022-08-23 20:32:37 +0200azimut_(~azimut@gateway/tor-sasl/azimut)
2022-08-23 20:33:27 +0200Lord_of_Life(~Lord@user/lord-of-life/x-2819915)
2022-08-23 20:33:44 +0200azimut(~azimut@gateway/tor-sasl/azimut) (Ping timeout: 268 seconds)
2022-08-23 20:34:06 +0200gmg(~user@user/gehmehgeh)
2022-08-23 20:37:23 +0200raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 248 seconds)
2022-08-23 20:38:46 +0200kmein(~weechat@user/kmein) (Quit: ciao kakao)
2022-08-23 20:39:07 +0200kmein(~weechat@user/kmein)
2022-08-23 20:40:15 +0200kannon(~NK@135-180-47-54.fiber.dynamic.sonic.net)
2022-08-23 20:40:21 +0200lyle(~lyle@104.246.145.85)
2022-08-23 20:41:03 +0200Hemmo(~IceChat95@2001:999:708:eb97:3d6e:5240:1496:7668) (Quit: Few women admit their age. Few men act theirs.)
2022-08-23 20:41:49 +0200raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
2022-08-23 20:44:18 +0200lortabac(~lortabac@2a01:e0a:541:b8f0:9182:8940:bd86:35ac)
2022-08-23 20:46:18 +0200fraznel(~fuag1@c-73-221-56-19.hsd1.wa.comcast.net)
2022-08-23 20:46:26 +0200 <mrianbloom> Is the Scrap Your Boilerplate with Class, style in wide use or is there a more modern approach?
2022-08-23 20:48:06 +0200 <Rembane_> mrianbloom: Is Generics the one you're thinking of?
2022-08-23 20:48:11 +0200ardell(~ardell@user/ardell) (Quit: Leaving)
2022-08-23 20:48:20 +0200 <Rembane_> mrianbloom: https://hackage.haskell.org/package/base-4.17.0.0/docs/GHC-Generics.html
2022-08-23 20:49:49 +0200 <mrianbloom> Rembane_: I'll give that a read through, thanks.
2022-08-23 20:50:05 +0200ardell(~ardell@user/ardell)
2022-08-23 20:50:27 +0200raym(~raym@user/raym) (Remote host closed the connection)
2022-08-23 20:51:15 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2022-08-23 20:52:19 +0200raym(~raym@user/raym)
2022-08-23 20:52:40 +0200 <Rembane_> mrianbloom: No worries.
2022-08-23 20:53:53 +0200 <mrianbloom> I think I'm looking more for the gmapQ type functionality described in the paper. Not sure if that's represented in the GHC.Generics framework.
2022-08-23 20:54:17 +0200SebastianM(~seba@user/sebastianm) (Quit: Bye)
2022-08-23 20:54:59 +0200kmein(~weechat@user/kmein) (Quit: ciao kakao)
2022-08-23 20:55:23 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2022-08-23 20:55:33 +0200kmein(~weechat@user/kmein)
2022-08-23 20:57:56 +0200 <lyle> Need help please with some code: https://paste.tomsmeding.com/aNgl5c8F
2022-08-23 20:58:15 +0200kmein(~weechat@user/kmein) (Client Quit)
2022-08-23 20:58:38 +0200 <lyle> The error is on the line "yield bs". Do I need to use unlift here or is my approach completely off the rails?
2022-08-23 20:59:10 +0200kmein(~weechat@user/kmein)
2022-08-23 20:59:47 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 248 seconds)
2022-08-23 21:00:50 +0200kmein(~weechat@user/kmein) (Client Quit)
2022-08-23 21:01:22 +0200Pickchea(~private@user/pickchea) (Quit: Leaving)
2022-08-23 21:01:49 +0200kmein(~weechat@user/kmein)
2022-08-23 21:03:03 +0200remedan(~remedan@octo.cafe) (Quit: Bye!)
2022-08-23 21:05:12 +0200nschoe(~quassel@2a01:e0a:8e:a190:c21d:44a3:63e2:38ba) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
2022-08-23 21:06:14 +0200 <geekosaur> lyle, I think that can't be made to work, because you can't unlift out of State (nothing knows to carry the state around)
2022-08-23 21:07:13 +0200 <lyle> Ok, maybe an IOVar is a better approach than State?
2022-08-23 21:07:13 +0200tomboy64(~tomboy64@user/tomboy64)
2022-08-23 21:08:19 +0200fserucas(~fserucas@89.214.149.93) (Ping timeout: 248 seconds)
2022-08-23 21:08:27 +0200 <lyle> Sorry, I should have said IORef.
2022-08-23 21:09:56 +0200kannon(~NK@135-180-47-54.fiber.dynamic.sonic.net) (Ping timeout: 255 seconds)
2022-08-23 21:11:45 +0200 <geekosaur> it's not great but it'd work
2022-08-23 21:11:46 +0200 <monochrom> I wonder if it changes nothing: you can't unlift out of IO either.
2022-08-23 21:11:55 +0200 <geekosaur> hm, point
2022-08-23 21:12:13 +0200 <geekosaur> although if it's already in IO it shouldn't matter?
2022-08-23 21:12:27 +0200 <monochrom> Oh heh OK.
2022-08-23 21:12:52 +0200 <geekosaur> given that it's reading from Handles
2022-08-23 21:12:56 +0200 <monochrom> I forgot the "MonadIO m" part.
2022-08-23 21:13:23 +0200kmein(~weechat@user/kmein) (Quit: ciao kakao)
2022-08-23 21:13:51 +0200 <lyle> I have tried IORef but couldn't make it work I think because you create the IORef first to initialize it to 0, then start a loop but the IORef's variable isn't in scope inside the loop.
2022-08-23 21:14:01 +0200kmein(~weechat@user/kmein)
2022-08-23 21:14:34 +0200matthewmosior(~matthewmo@173.170.253.91) (Remote host closed the connection)
2022-08-23 21:14:43 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-08-23 21:16:30 +0200Haskelytic(~Haskelyti@37.111.201.4)
2022-08-23 21:17:27 +0200 <lyle> What I'll do is try the IORef approach again--I'll likely run into the same problem again and come back for more help.
2022-08-23 21:17:44 +0200 <lyle> Many thanks for having a look at this!
2022-08-23 21:17:49 +0200aeka(~aeka@user/hiruji)
2022-08-23 21:27:43 +0200lortabac(~lortabac@2a01:e0a:541:b8f0:9182:8940:bd86:35ac) (Quit: WeeChat 2.8)
2022-08-23 21:28:18 +0200coot(~coot@213.134.176.158) (Quit: coot)
2022-08-23 21:38:46 +0200pavonia(~user@user/siracusa)
2022-08-23 21:40:56 +0200ardell(~ardell@user/ardell) (Read error: Connection reset by peer)
2022-08-23 21:41:13 +0200ardell(~ardell@user/ardell)
2022-08-23 21:42:09 +0200matthewmosior(~matthewmo@173.170.253.91) (Remote host closed the connection)
2022-08-23 21:48:24 +0200justachejustache_
2022-08-23 21:48:31 +0200justache_justache
2022-08-23 21:49:48 +0200pdroman(~pedro@141.red-81-43-1.staticip.rima-tde.net)
2022-08-23 21:50:04 +0200pdroman(~pedro@141.red-81-43-1.staticip.rima-tde.net) ()
2022-08-23 21:52:32 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-08-23 21:57:06 +0200matthewmosior(~matthewmo@173.170.253.91) (Ping timeout: 256 seconds)
2022-08-23 21:57:23 +0200Haskelytic(~Haskelyti@37.111.201.4) (Quit: Client closed)
2022-08-23 21:58:56 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-08-23 22:00:24 +0200matthewmosior(~matthewmo@173.170.253.91) (Remote host closed the connection)
2022-08-23 22:02:19 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-08-23 22:03:51 +0200matthewmosior(~matthewmo@173.170.253.91) (Remote host closed the connection)
2022-08-23 22:06:32 +0200wonko(~wjc@2a0e:1c80:2::130) (Ping timeout: 244 seconds)
2022-08-23 22:06:39 +0200lyle(~lyle@104.246.145.85) (Quit: WeeChat 3.6)
2022-08-23 22:06:40 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-08-23 22:06:47 +0200ec(~ec@gateway/tor-sasl/ec)
2022-08-23 22:21:35 +0200instantaphex(~jb@c-73-171-252-84.hsd1.fl.comcast.net)
2022-08-23 22:22:10 +0200thelounge8164(~thelounge@85.9.20.133)
2022-08-23 22:24:03 +0200ec(~ec@gateway/tor-sasl/ec) (Remote host closed the connection)
2022-08-23 22:25:51 +0200thelounge8164(~thelounge@85.9.20.133) (Quit: The Lounge - https://thelounge.chat)
2022-08-23 22:26:28 +0200ec(~ec@gateway/tor-sasl/ec)
2022-08-23 22:27:07 +0200aeka(~aeka@user/hiruji) (Ping timeout: 268 seconds)
2022-08-23 22:27:34 +0200aeka(~aeka@user/hiruji)
2022-08-23 22:30:41 +0200 <qrpnxz> lyle are you still in here
2022-08-23 22:31:24 +0200 <qrpnxz> it looks like they just needed to lift the yield into the StateT to me
2022-08-23 22:31:25 +0200wonko(~wjc@2a0e:1c80:2::130)
2022-08-23 22:33:22 +0200odnes(~odnes@5-203-171-254.pat.nym.cosmote.net) (Quit: Leaving)
2022-08-23 22:36:37 +0200CiaoSen(~Jura@p200300c95738a5002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
2022-08-23 22:43:09 +0200raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 268 seconds)
2022-08-23 22:47:32 +0200raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
2022-08-23 22:48:54 +0200wonko(~wjc@2a0e:1c80:2::130) (Ping timeout: 244 seconds)
2022-08-23 22:49:43 +0200fraznel(~fuag1@c-73-221-56-19.hsd1.wa.comcast.net) (Ping timeout: 252 seconds)
2022-08-23 22:51:38 +0200matthewmosior(~matthewmo@173.170.253.91) (Remote host closed the connection)
2022-08-23 22:53:12 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-08-23 22:53:22 +0200fraznel(~fuag1@c-73-221-56-19.hsd1.wa.comcast.net)
2022-08-23 22:55:36 +0200albet70(~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection)
2022-08-23 22:56:47 +0200Rumham347(~Rumham347@128-193-154-76.ptpg.oregonstate.edu)
2022-08-23 22:57:41 +0200matthewmosior(~matthewmo@173.170.253.91) (Ping timeout: 244 seconds)
2022-08-23 22:58:20 +0200remedan(~remedan@octo.cafe)
2022-08-23 23:01:43 +0200albet70(~xxx@2400:8902::f03c:92ff:fe60:98d8)
2022-08-23 23:02:13 +0200michalz(~michalz@185.246.204.72) (Remote host closed the connection)
2022-08-23 23:02:22 +0200__monty__(~toonn@user/toonn) (Quit: leaving)
2022-08-23 23:08:44 +0200remedan(~remedan@octo.cafe) (Read error: Connection reset by peer)
2022-08-23 23:09:37 +0200remedan(~remedan@octo.cafe)
2022-08-23 23:11:13 +0200chele(~chele@user/chele) (Remote host closed the connection)
2022-08-23 23:16:11 +0200remedan(~remedan@octo.cafe) (Read error: Connection reset by peer)
2022-08-23 23:16:36 +0200LambdaDu1k(~anka@ksit.fixme.fi) (Ping timeout: 268 seconds)
2022-08-23 23:16:42 +0200LambdaDuck(~anka@ksit.fixme.fi)
2022-08-23 23:17:04 +0200opqdonut(opqdonut@pseudo.fixme.fi) (Ping timeout: 268 seconds)
2022-08-23 23:17:12 +0200opqdonut(opqdonut@pseudo.fixme.fi)
2022-08-23 23:17:20 +0200remedan(~remedan@octo.cafe)
2022-08-23 23:17:35 +0200CiaoSen(~Jura@p200300c95738a5002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 256 seconds)
2022-08-23 23:18:49 +0200remedan(~remedan@octo.cafe) (Read error: Connection reset by peer)
2022-08-23 23:19:27 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-08-23 23:20:25 +0200acidjnk(~acidjnk@p200300d6e7137a36187ce24caf80a2df.dip0.t-ipconnect.de) (Ping timeout: 256 seconds)
2022-08-23 23:20:28 +0200remedan(~remedan@octo.cafe)
2022-08-23 23:21:40 +0200nate4(~nate@98.45.169.16)
2022-08-23 23:23:23 +0200segfaultfizzbuzz(~segfaultf@157-131-253-58.fiber.dynamic.sonic.net)
2022-08-23 23:26:39 +0200nate4(~nate@98.45.169.16) (Ping timeout: 256 seconds)
2022-08-23 23:35:36 +0200Natch(~natch@c-9e07225c.038-60-73746f7.bbcust.telenor.se) (Remote host closed the connection)
2022-08-23 23:52:00 +0200fserucas(~fserucas@89.214.149.93)