2023/04/29

2023-04-29 00:05:44 +0200 <hippoid> hello, i've got this haskell/turtle/stack script i'm running in a nix shell: https://termbin.com/vywk. i've don't `chmod u+x` on it, and every time i run it i get this warning: https://termbin.com/nkmw
2023-04-29 00:06:13 +0200 <hippoid> about a missed-extra-shared-lib. should this warning concern me?
2023-04-29 00:06:27 +0200 <hippoid> and how I can turn it off?
2023-04-29 00:10:45 +0200mei(~mei@user/mei) (Remote host closed the connection)
2023-04-29 00:13:07 +0200mei(~mei@user/mei)
2023-04-29 00:15:29 +0200nattiestnate(~nate@202.138.250.55)
2023-04-29 00:16:48 +0200nattiestnate(~nate@202.138.250.55) (Client Quit)
2023-04-29 00:17:10 +0200nattiestnate(~nate@202.138.250.62)
2023-04-29 00:17:40 +0200merijn(~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) (Ping timeout: 260 seconds)
2023-04-29 00:19:38 +0200rekahsoft(~rekahsoft@bras-base-orllon1122w-grc-04-174-88-193-177.dsl.bell.ca) (Ping timeout: 246 seconds)
2023-04-29 00:22:25 +0200talismanick(~user@campus-042-001.ucdavis.edu)
2023-04-29 00:23:08 +0200mei(~mei@user/mei) (Ping timeout: 246 seconds)
2023-04-29 00:26:33 +0200mc47(~mc47@xmonad/TheMC47) (Remote host closed the connection)
2023-04-29 00:31:32 +0200acidjnk_new(~acidjnk@p200300d6e715c468b4bf77e5a0595f20.dip0.t-ipconnect.de) (Ping timeout: 246 seconds)
2023-04-29 00:36:55 +0200justsomeguy(~justsomeg@user/justsomeguy)
2023-04-29 00:37:02 +0200vulpine(xfnw@tilde.team) (Quit: Connection reset by purr)
2023-04-29 00:38:55 +0200vulpine(xfnw@tilde.team)
2023-04-29 00:40:41 +0200mei(~mei@user/mei)
2023-04-29 00:40:45 +0200gurkenglas(~gurkengla@dynamic-046-114-180-206.46.114.pool.telefonica.de) (Ping timeout: 240 seconds)
2023-04-29 00:42:56 +0200gurkenglas(~gurkengla@dynamic-089-204-130-021.89.204.130.pool.telefonica.de)
2023-04-29 00:43:33 +0200 <sm> search the net for that message maybe
2023-04-29 00:44:42 +0200merijn(~merijn@86-86-29-250.fixed.kpn.net)
2023-04-29 00:52:44 +0200Me-me(~Me-me@user/me-me)
2023-04-29 00:58:37 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex)
2023-04-29 01:00:22 +0200merijn(~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 252 seconds)
2023-04-29 01:09:50 +0200vgtw(~vgtw@user/vgtw)
2023-04-29 01:19:32 +0200Guest4277(~Guest42@ip5f5be7a8.dynamic.kabel-deutschland.de) (Quit: Connection closed)
2023-04-29 01:25:59 +0200heraldo(~heraldo@user/heraldo) (Quit: heraldo)
2023-04-29 01:27:35 +0200merijn(~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl)
2023-04-29 01:27:40 +0200kritzefitz(~kritzefit@debian/kritzefitz) (Ping timeout: 260 seconds)
2023-04-29 01:29:40 +0200kritzefitz(~kritzefit@debian/kritzefitz)
2023-04-29 01:33:34 +0200dsrt^(~dsrt@c-76-105-96-13.hsd1.ga.comcast.net)
2023-04-29 01:39:09 +0200fun-safe-math(~fun-safe-@c-24-22-94-205.hsd1.or.comcast.net)
2023-04-29 01:40:15 +0200mauke_(~mauke@user/mauke)
2023-04-29 01:41:45 +0200mauke(~mauke@user/mauke) (Ping timeout: 240 seconds)
2023-04-29 01:41:45 +0200mauke_mauke
2023-04-29 01:42:59 +0200Tuplanolla(~Tuplanoll@91-159-68-236.elisa-laajakaista.fi) (Quit: Leaving.)
2023-04-29 01:52:29 +0200nate1(~nate@98.45.169.16)
2023-04-29 01:57:17 +0200nate1(~nate@98.45.169.16) (Ping timeout: 246 seconds)
2023-04-29 02:01:10 +0200merijn(~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) (Ping timeout: 276 seconds)
2023-04-29 02:03:25 +0200califax(~califax@user/califx) (Remote host closed the connection)
2023-04-29 02:04:40 +0200hamster(~ham@user/ham) (Read error: Connection reset by peer)
2023-04-29 02:04:44 +0200gemmaro(~user@240f:74:d1f0:1:ba1:e787:c9e:b1dc) (Remote host closed the connection)
2023-04-29 02:05:36 +0200trev(~trev@user/trev) (Quit: trev)
2023-04-29 02:09:04 +0200talismanick(~user@campus-042-001.ucdavis.edu) (Ping timeout: 253 seconds)
2023-04-29 02:10:31 +0200AlexNoo(~AlexNoo@178.34.150.15) (Read error: Connection reset by peer)
2023-04-29 02:10:54 +0200AlexNoo(~AlexNoo@178.34.150.15)
2023-04-29 02:11:54 +0200Lord_of_Life_(~Lord@user/lord-of-life/x-2819915)
2023-04-29 02:12:36 +0200Lord_of_Life(~Lord@user/lord-of-life/x-2819915) (Ping timeout: 265 seconds)
2023-04-29 02:13:13 +0200Lord_of_Life_Lord_of_Life
2023-04-29 02:15:00 +0200califax(~califax@user/califx)
2023-04-29 02:47:28 +0200justsomeguy(~justsomeg@user/justsomeguy) (Ping timeout: 248 seconds)
2023-04-29 02:52:44 +0200pie_(~pie_bnc@user/pie/x-2818909) ()
2023-04-29 02:53:14 +0200pie_(~pie_bnc@user/pie/x-2818909)
2023-04-29 02:53:40 +0200gurkenglas(~gurkengla@dynamic-089-204-130-021.89.204.130.pool.telefonica.de) (Ping timeout: 252 seconds)
2023-04-29 02:54:48 +0200wroathe(~wroathe@207-153-38-140.fttp.usinternet.com)
2023-04-29 02:54:48 +0200wroathe(~wroathe@207-153-38-140.fttp.usinternet.com) (Changing host)
2023-04-29 02:54:48 +0200wroathe(~wroathe@user/wroathe)
2023-04-29 03:03:23 +0200fun-safe-math(~fun-safe-@c-24-22-94-205.hsd1.or.comcast.net) (Quit: Leaving)
2023-04-29 03:11:07 +0200albet70(~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection)
2023-04-29 03:17:14 +0200albet70(~xxx@2400:8902::f03c:92ff:fe60:98d8)
2023-04-29 03:18:24 +0200merijn(~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl)
2023-04-29 03:28:15 +0200talismanick(~user@2601:204:ef80:6c80::a8e2)
2023-04-29 03:39:25 +0200mei(~mei@user/mei) (Ping timeout: 240 seconds)
2023-04-29 03:49:52 +0200zeenk(~zeenk@2a02:2f04:a20f:5200::7fe) (Quit: Konversation terminated!)
2023-04-29 03:51:44 +0200merijn(~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) (Ping timeout: 246 seconds)
2023-04-29 03:53:10 +0200[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470) (Ping timeout: 250 seconds)
2023-04-29 03:57:31 +0200[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470)
2023-04-29 04:18:39 +0200bratwurst(~dfadsva@2604:3d09:207f:f650::9c24)
2023-04-29 04:18:48 +0200tremon(~tremon@83.80.159.219) (Quit: getting boxed in)
2023-04-29 04:24:52 +0200mei(~mei@user/mei)
2023-04-29 04:28:27 +0200Digitteknohippie(~user@user/digit)
2023-04-29 04:28:43 +0200wroathe(~wroathe@user/wroathe) (Ping timeout: 276 seconds)
2023-04-29 04:29:54 +0200Digit(~user@user/digit) (Ping timeout: 249 seconds)
2023-04-29 04:32:45 +0200xff0x(~xff0x@ai098135.d.east.v6connect.net) (Ping timeout: 240 seconds)
2023-04-29 04:38:34 +0200shailangsa(~shailangs@host165-120-169-78.range165-120.btcentralplus.com) ()
2023-04-29 04:42:16 +0200DigitteknohippieDigit
2023-04-29 04:43:19 +0200bilegeek(~bilegeek@2600:1008:b013:d54f:9ec2:2bf5:4c41:2e9b)
2023-04-29 04:48:20 +0200jludwig(~justin@li657-110.members.linode.com)
2023-04-29 04:51:25 +0200finn_elija(~finn_elij@user/finn-elija/x-0085643)
2023-04-29 04:51:25 +0200FinnElija(~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija)))
2023-04-29 04:51:25 +0200finn_elijaFinnElija
2023-04-29 04:53:01 +0200bratwurst(~dfadsva@2604:3d09:207f:f650::9c24) (Ping timeout: 252 seconds)
2023-04-29 04:53:45 +0200td_(~td@i5387093d.versanet.de) (Ping timeout: 255 seconds)
2023-04-29 04:55:20 +0200td_(~td@i53870937.versanet.de)
2023-04-29 05:00:11 +0200[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470) (Read error: Connection reset by peer)
2023-04-29 05:02:04 +0200jero98772(~jero98772@2800:484:1d84:9000::2) (Remote host closed the connection)
2023-04-29 05:02:06 +0200merijn(~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl)
2023-04-29 05:26:13 +0200gemmaro(~user@240f:74:d1f0:1:ba1:e787:c9e:b1dc)
2023-04-29 05:29:27 +0200nate1(~nate@98.45.169.16)
2023-04-29 05:31:31 +0200merijn(~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) (Ping timeout: 252 seconds)
2023-04-29 05:32:45 +0200thegeekinside(~thegeekin@189.180.38.222) (Ping timeout: 240 seconds)
2023-04-29 05:34:15 +0200nate1(~nate@98.45.169.16) (Ping timeout: 253 seconds)
2023-04-29 06:15:57 +0200Guest|52(~Guest|52@pool-128-6-37-193.nat.rutgers.edu)
2023-04-29 06:24:10 +0200trev(~trev@user/trev)
2023-04-29 06:25:39 +0200bilegeek(~bilegeek@2600:1008:b013:d54f:9ec2:2bf5:4c41:2e9b) (Quit: Leaving)
2023-04-29 06:35:51 +0200Guest|52(~Guest|52@pool-128-6-37-193.nat.rutgers.edu) (Quit: Connection closed)
2023-04-29 06:46:36 +0200merijn(~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl)
2023-04-29 06:53:01 +0200merijn(~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) (Ping timeout: 276 seconds)
2023-04-29 07:12:38 +0200czy(~user@host-140-24.ilcub310.champaign.il.us.clients.pavlovmedia.net)
2023-04-29 07:27:30 +0200monochrom(trebla@216.138.220.146) (Quit: NO CARRIER)
2023-04-29 07:31:41 +0200harveypwca(~harveypwc@2601:246:c180:a570:3828:d8:e523:3f67)
2023-04-29 07:42:40 +0200takuan(~takuan@178-116-218-225.access.telenet.be)
2023-04-29 07:43:47 +0200takuan(~takuan@178-116-218-225.access.telenet.be) (Read error: Connection reset by peer)
2023-04-29 07:44:35 +0200monochrom(trebla@216.138.220.146)
2023-04-29 07:45:54 +0200takuan(~takuan@178-116-218-225.access.telenet.be)
2023-04-29 07:46:07 +0200takuan_dozo(~takuan@178-116-218-225.access.telenet.be)
2023-04-29 07:46:07 +0200hugo-(znc@verdigris.lysator.liu.se) (Ping timeout: 244 seconds)
2023-04-29 07:46:34 +0200takuan_dozo(~takuan@178-116-218-225.access.telenet.be) (Write error: Connection reset by peer)
2023-04-29 07:47:01 +0200nate1(~nate@98.45.169.16)
2023-04-29 07:47:14 +0200hugo(znc@verdigris.lysator.liu.se)
2023-04-29 07:52:10 +0200nate1(~nate@98.45.169.16) (Ping timeout: 276 seconds)
2023-04-29 07:53:53 +0200tibamita(~reidiens@2600:1700:fba0:abe0::22)
2023-04-29 07:53:59 +0200 <tibamita> hey gang
2023-04-29 07:54:09 +0200 <tibamita> i'm trying to learn haskell
2023-04-29 07:54:23 +0200 <tibamita> any tips or tricks for a newbie ?
2023-04-29 07:54:28 +0200 <tibamita> i hear haskell's weird
2023-04-29 07:54:56 +0200 <geekosaur> "weird" compared to what?
2023-04-29 07:55:32 +0200 <geekosaur> it is certainly not simly python or javascript with makeup 🙂
2023-04-29 07:55:41 +0200 <tibamita> to other languages ? idk
2023-04-29 07:55:48 +0200 <tibamita> i come from a C/C++ background
2023-04-29 07:57:17 +0200 <geekosaur> anyway the haskell wikibook is pretty good
2023-04-29 07:57:22 +0200 <geekosaur> @where wikibook
2023-04-29 07:57:23 +0200 <lambdabot> http://en.wikibooks.org/wiki/Haskell
2023-04-29 08:00:50 +0200 <tibamita> gee whiz that's neat!
2023-04-29 08:00:53 +0200 <tibamita> thank you
2023-04-29 08:05:09 +0200 <geekosaur> be prepared for your brain to explode 🙂 (in a good way)
2023-04-29 08:05:41 +0200 <geekosaur> haskell is indeed fairly different from other languages. the combination of IO and laziness will take you a while to get used to
2023-04-29 08:05:44 +0200 <tibamita> im So Ready
2023-04-29 08:07:19 +0200 <tibamita> is all haskell programming done in ghci ?
2023-04-29 08:08:30 +0200 <tibamita> bcuz if so ... what the deuce
2023-04-29 08:11:59 +0200 <geekosaur> ghci is somewhere between a debugger and an interactive desk calculator
2023-04-29 08:12:05 +0200 <geekosaur> mostly we program in editors
2023-04-29 08:12:31 +0200 <geekosaur> (in particular there's no way to save your work in ghci, at least not yet)
2023-04-29 08:13:14 +0200 <geekosaur> I personally use vscode with the haskell extension for editing
2023-04-29 08:13:33 +0200 <tibamita> ok thank goodness
2023-04-29 08:13:46 +0200 <tibamita> programming in that thing would've been a nightmare
2023-04-29 08:15:04 +0200 <geekosaur> yeh, nobody's asking you to do that
2023-04-29 08:15:45 +0200 <geekosaur> but haskell modes for editors can evaluate code snippets and such, it's much nicer than ghci
2023-04-29 08:16:05 +0200merijn(~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl)
2023-04-29 08:24:05 +0200jle`(~jle`@cpe-23-240-75-236.socal.res.rr.com) (Ping timeout: 240 seconds)
2023-04-29 08:27:15 +0200jle`(~jle`@cpe-23-240-75-236.socal.res.rr.com)
2023-04-29 08:29:17 +0200tibamita(~reidiens@2600:1700:fba0:abe0::22) (Quit: Leaving)
2023-04-29 08:45:32 +0200califax(~califax@user/califx) (Remote host closed the connection)
2023-04-29 08:46:39 +0200califax(~califax@user/califx)
2023-04-29 08:49:31 +0200merijn(~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) (Ping timeout: 252 seconds)
2023-04-29 08:53:47 +0200werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 246 seconds)
2023-04-29 08:55:38 +0200werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2023-04-29 09:08:12 +0200falafel(~falafel@2603-8000-d700-115c-03fc-7660-2ab5-66fe.res6.spectrum.com)
2023-04-29 09:24:21 +0200gurkenglas(~gurkengla@dynamic-089-204-130-021.89.204.130.pool.telefonica.de)
2023-04-29 09:25:46 +0200 <jade[m]> I program fairly much in ghci when developing, mainly testing out expressions before copying them into the editor
2023-04-29 09:27:21 +0200 <jade[m]> but im also a newbie, so what do I know 😆
2023-04-29 09:27:43 +0200 <fr33domlover> c_wraith: Why wouldn't you use use acid-state under any circumstances? What would you use instead? (whether it's a single database or many small ones; both are possible for me and I haven't yet determined what's better :p)
2023-04-29 09:30:31 +0200 <fr33domlover> somerandomnick[m: Replying to "from my experience in GHC 8, `readMVar` is already very efficient, although atomic": MVar doesn't have built-in disk persistence and version control/migration
2023-04-29 09:35:28 +0200 <geekosaur> the problem with acid-state is that it is not acid, and its migration is broken
2023-04-29 09:37:15 +0200mokee(~mokee@37.228.215.215)
2023-04-29 09:47:55 +0200_ht(~Thunderbi@28-52-174-82.ftth.glasoperator.nl)
2023-04-29 09:51:23 +0200acidjnk_new(~acidjnk@p200300d6e715c468b4bf77e5a0595f20.dip0.t-ipconnect.de)
2023-04-29 09:53:12 +0200merijn(~merijn@86-86-29-250.fixed.kpn.net)
2023-04-29 09:57:12 +0200harveypwca(~harveypwc@2601:246:c180:a570:3828:d8:e523:3f67) (Quit: Leaving)
2023-04-29 09:57:57 +0200 <[exa]> jade[m]: after like 25 years of coding I'm actually doing the same, it's the only thing that works kinda reliably over time :D
2023-04-29 09:58:24 +0200 <jade[m]> haha great
2023-04-29 10:00:27 +0200gnalzo(~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c)
2023-04-29 10:02:37 +0200 <[exa]> kinda wondering, is there any unixy tool that would pool 2 inputs into a single REPL? Like, have vim/emacs scripted to paste a line into a running interpreter, while also allowing the interpreter to take keyboard input
2023-04-29 10:03:05 +0200azimut(~azimut@gateway/tor-sasl/azimut)
2023-04-29 10:03:56 +0200Ou42(~Ou4242a@2600:1700:e930:41b0:274c:69e5:6061:cb5)
2023-04-29 10:03:57 +0200 <jade[m]> sounds like something tmux could do?
2023-04-29 10:04:29 +0200 <[exa]> yeah I wonder
2023-04-29 10:04:55 +0200 <[exa]> except it doesn't seem quite like a tmux thing, it should be _much_ easiler
2023-04-29 10:05:20 +0200 <Ou42> hello. I'm trying to do simple(?) profiling via ghci, but $ ghci -fexternal-interpreter -prof, returns w/ an error ...
2023-04-29 10:05:25 +0200 <Ou42> "Perhaps you haven't installed the profiling libraries for package ‘ghc-prim-0.5.3’?"
2023-04-29 10:05:50 +0200 <jade[m]> [exa]: I guess vim can do stuff like this itself using integrated terninals?
2023-04-29 10:05:58 +0200 <jade[m]> no idea about emacs
2023-04-29 10:06:18 +0200 <Ou42> and in case this is an X-Y prob: I'm trying to go thru, <https://wiki.haskell.org/Foldr_Foldl_Foldl'> but the very first example doesn't SO like it's supposed to.
2023-04-29 10:06:41 +0200 <[exa]> jade[m]: hm true
2023-04-29 10:07:05 +0200 <[exa]> lemme try then
2023-04-29 10:08:35 +0200 <jade[m]> https://stackoverflow.com/questions/4878980/vim-insert-selected-text-into-command-line
2023-04-29 10:08:48 +0200 <jade[m]> If I read this correctly it's already something that is built in
2023-04-29 10:09:26 +0200 <[exa]> oh lovely
2023-04-29 10:19:08 +0200 <Ou42> I tried, "$ cabal install --enable-library-profiling --force-reinstall --lib ghc-prim" w/ and w/o the -0.5.3 and it doesn't error out, but it doesn't work. same error when trying to launch ghci
2023-04-29 10:23:01 +0200mokee(~mokee@37.228.215.215) (Quit: Lost terminal)
2023-04-29 10:30:17 +0200zaquest(~notzaques@5.130.79.72) (Remote host closed the connection)
2023-04-29 10:30:19 +0200 <[exa]> jade[m]: ok that fixed it for me, thanks for pushing in the right direction :D
2023-04-29 10:30:22 +0200Tuplanolla(~Tuplanoll@91-159-68-236.elisa-laajakaista.fi)
2023-04-29 10:30:41 +0200 <Ou42> ":set +s" shows (0.01 secs, 29,904 bytes) for both "try1" and "try2" :thinking: ghci 8.8.4
2023-04-29 10:31:08 +0200eggplantade(~Eggplanta@2600:1700:38c5:d800:6cda:c72d:6503:1251) (Remote host closed the connection)
2023-04-29 10:31:25 +0200foul_owl(~kerry@94.140.8.139) (Ping timeout: 240 seconds)
2023-04-29 10:33:20 +0200zaquest(~notzaques@5.130.79.72)
2023-04-29 10:38:16 +0200jpds1(~jpds@gateway/tor-sasl/jpds)
2023-04-29 10:38:17 +0200L29Ah(~L29Ah@wikipedia/L29Ah) (Read error: Connection reset by peer)
2023-04-29 10:39:44 +0200jpds(~jpds@gateway/tor-sasl/jpds) (Ping timeout: 240 seconds)
2023-04-29 10:44:15 +0200L29Ah(~L29Ah@wikipedia/L29Ah)
2023-04-29 10:44:24 +0200 <probie> Ou42: by default, a program compiled by modern versions of GHC will dynamically grow a thread's stack until it takes up to 80% of physical memory
2023-04-29 10:45:38 +0200foul_owl(~kerry@45.143.82.151)
2023-04-29 10:46:07 +0200 <probie> Try running ghci with something like `ghci +RTS -K1M`
2023-04-29 10:46:12 +0200 <Ou42> probie: tyvm for the reply!
2023-04-29 10:47:00 +0200alexherbo2(~alexherbo@2a02-842a-8180-4601-85e1-23ae-ea70-6ae4.rev.sfr.net)
2023-04-29 10:47:52 +0200 <Ou42> :thinking: should the wiki page be updated to reflect this? if so, how?
2023-04-29 10:48:17 +0200falafel(~falafel@2603-8000-d700-115c-03fc-7660-2ab5-66fe.res6.spectrum.com) (Ping timeout: 250 seconds)
2023-04-29 10:49:39 +0200 <Ou42> before `ghci +RTS -K1M` (try1,try2,try3) == "((0.01 secs, 29,904 bytes),(0.01 secs, 29,904 bytes),(0.95 secs, 256,062,784 bytes))"
2023-04-29 10:50:33 +0200 <Ou42> after == (SO, SO, (0.95 secs, 256,062,784 bytes)) -- forgot, w/ `:set +s`
2023-04-29 10:51:19 +0200 <Ou42> probie: TYVM. appreciate it. now I can catch some sweet Z's. g'nite.
2023-04-29 10:52:26 +0200alexherbo2(~alexherbo@2a02-842a-8180-4601-85e1-23ae-ea70-6ae4.rev.sfr.net) (Remote host closed the connection)
2023-04-29 10:52:54 +0200alexherbo2(~alexherbo@2a02-842a-8180-4601-85e1-23ae-ea70-6ae4.rev.sfr.net)
2023-04-29 10:53:26 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection)
2023-04-29 10:53:51 +0200alexherbo2(~alexherbo@2a02-842a-8180-4601-85e1-23ae-ea70-6ae4.rev.sfr.net) (Remote host closed the connection)
2023-04-29 10:54:16 +0200alexherbo2(~alexherbo@2a02-842a-8180-4601-85e1-23ae-ea70-6ae4.rev.sfr.net)
2023-04-29 10:54:34 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex)
2023-04-29 10:56:59 +0200merijn(~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 246 seconds)
2023-04-29 10:57:13 +0200econo(uid147250@user/econo) (Quit: Connection closed for inactivity)
2023-04-29 10:58:39 +0200Inst_(~Inst@2601:6c4:4081:54f0:317f:532d:86fb:4a08)
2023-04-29 11:00:08 +0200JoseMariaLanda[m(~josemaria@2001:470:69fc:105::3:392b) (Quit: You have been kicked for being idle)
2023-04-29 11:06:09 +0200coot(~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba)
2023-04-29 11:08:40 +0200accord(uid568320@id-568320.hampstead.irccloud.com)
2023-04-29 11:09:32 +0200Ou42(~Ou4242a@2600:1700:e930:41b0:274c:69e5:6061:cb5) (Quit: Leaving)
2023-04-29 11:15:04 +0200merijn(~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl)
2023-04-29 11:18:20 +0200jinsl(~jinsl@123.120.170.97) (Ping timeout: 246 seconds)
2023-04-29 11:18:29 +0200jinsl-(~jinsl@2408:8207:2558:8870:211:32ff:fec8:6aea)
2023-04-29 11:19:44 +0200merijn(~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) (Ping timeout: 246 seconds)
2023-04-29 11:21:09 +0200tzh(~tzh@c-24-21-73-154.hsd1.wa.comcast.net) (Quit: zzz)
2023-04-29 11:29:24 +0200heraldo(~heraldo@user/heraldo)
2023-04-29 11:31:58 +0200eggplantade(~Eggplanta@2600:1700:38c5:d800:d4d0:8bd2:d805:7ab6)
2023-04-29 11:36:39 +0200eggplantade(~Eggplanta@2600:1700:38c5:d800:d4d0:8bd2:d805:7ab6) (Ping timeout: 265 seconds)
2023-04-29 11:45:59 +0200Sgeo(~Sgeo@user/sgeo) (Write error: Connection reset by peer)
2023-04-29 11:47:54 +0200 <fr33domlover> geekosaur: Can you say more? The docs and repo make a positive impression so I worry I missed something... and what do I use instead? Are there other Haskell-ish options? Or do I just use SQLite/PostgreSQL/etc.
2023-04-29 11:48:35 +0200nate1(~nate@98.45.169.16)
2023-04-29 11:50:53 +0200wootehfoot(~wootehfoo@user/wootehfoot)
2023-04-29 11:53:32 +0200nate1(~nate@98.45.169.16) (Ping timeout: 252 seconds)
2023-04-29 11:53:42 +0200L29Ah(~L29Ah@wikipedia/L29Ah) ()
2023-04-29 12:01:21 +0200Maeda(~Maeda@91-161-10-149.subs.proxad.net)
2023-04-29 12:08:11 +0200jpds2(~jpds@gateway/tor-sasl/jpds)
2023-04-29 12:09:20 +0200[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470)
2023-04-29 12:11:20 +0200jpds1(~jpds@gateway/tor-sasl/jpds) (Ping timeout: 240 seconds)
2023-04-29 12:13:21 +0200heraldo(~heraldo@user/heraldo) (Quit: heraldo)
2023-04-29 12:16:08 +0200zeenk(~zeenk@2a02:2f04:a20f:5200::7fe)
2023-04-29 12:19:08 +0200kuribas(~user@ptr-17d51enwg0abanf4ox8.18120a2.ip6.access.telenet.be)
2023-04-29 12:20:11 +0200 <kuribas> I am trying to prove some properties in idris, but I find it incredibly tedious having to search for trivial proofs. Are there language which have better tooling, to automatic trivial proofs, maybe do proofs search or use an smt solver?
2023-04-29 12:24:31 +0200shriekingnoise(~shrieking@186.137.175.87) (Ping timeout: 276 seconds)
2023-04-29 12:30:07 +0200gmg(~user@user/gehmehgeh) (Remote host closed the connection)
2023-04-29 12:30:52 +0200gmg(~user@user/gehmehgeh)
2023-04-29 12:32:08 +0200xff0x(~xff0x@fsa056e3ab.kytj202.ap.nuro.jp)
2023-04-29 12:33:49 +0200puke(~puke@user/puke) (Quit: puke)
2023-04-29 12:35:45 +0200pyook(~puke@user/puke) (Ping timeout: 240 seconds)
2023-04-29 12:40:01 +0200Guest7013(~Guest70@2604:4080:11a5:8050:3823:f4c5:f08a:7b71)
2023-04-29 12:44:42 +0200merijn(~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl)
2023-04-29 12:45:15 +0200pyook(~puke@user/puke)
2023-04-29 12:52:37 +0200 <Guest7013> hi all, i'm working through the nicta/system-f course and i'm a bit stuck on the very last part of Applicative
2023-04-29 12:52:50 +0200 <Guest7013> i'm supposed to implement "filtering", which i think is filterM?
2023-04-29 12:53:02 +0200 <Guest7013> i've tried to translate my attempt back into usual haskell: https://paste.tomsmeding.com/lOde3S5Z
2023-04-29 12:53:13 +0200 <Guest7013> i'm not exactly sure why the first attempt doesn't work
2023-04-29 12:54:01 +0200 <Guest7013> for simple applicatives it works, but e.g. for lists, it seems to be generating an extra layer of applicative effects?
2023-04-29 12:54:24 +0200coot(~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot)
2023-04-29 12:55:16 +0200JScript(~JScript@144.48.39.18)
2023-04-29 12:55:21 +0200JScript(~JScript@144.48.39.18) (Max SendQ exceeded)
2023-04-29 12:55:48 +0200JScript(~JScript@144.48.39.18)
2023-04-29 12:55:52 +0200JScript(~JScript@144.48.39.18) (Max SendQ exceeded)
2023-04-29 12:56:22 +0200 <Guest7013> my reasoning was: we need to use (f x) to determine whether to "keep" x or not. if x doesn't pass the filter, we just keep acc, otherwise we need to prepend x and fmap (x : ) acc does that
2023-04-29 12:56:25 +0200pyook(~puke@user/puke) (Ping timeout: 240 seconds)
2023-04-29 12:57:39 +0200 <ski> using `liftA3', you're effectively calling recursively twice
2023-04-29 12:58:06 +0200 <ski> (you could try inlining `foldr' to see what's happening, if you want to)
2023-04-29 12:59:03 +0200JScript(~JScript@144.48.39.18)
2023-04-29 12:59:11 +0200JScript(~JScript@144.48.39.18) (Max SendQ exceeded)
2023-04-29 13:00:37 +0200 <Guest7013> oh so if i write
2023-04-29 13:00:52 +0200 <ski> filterM f (x:xs) = liftA3 bool (filterM f xs) (fmap (x :) (filterM f xs)) (f x)
2023-04-29 13:00:56 +0200 <ski> vs.
2023-04-29 13:01:00 +0200 <ski> filterM f (x:xs) = liftA2 (bool id (x :)) (f x) (filterM f xs)
2023-04-29 13:01:24 +0200 <ski> (you'll also notice that the ordering of effects, apart from the duplication of effects), is different)
2023-04-29 13:01:37 +0200 <Guest7013> g x acc = liftA2 (bool id (x :)) (f x) acc then i'm using the "effects" in acc once, but my failed attempt uses it twice, once in the "true" argment, once in the "false" argument
2023-04-29 13:02:02 +0200 <ski> yes
2023-04-29 13:03:15 +0200 <ski> for lists, using the effects twice means effectively that you have two nested loops, looping through the list (coming from the recursive call), instead of one nested loop (in addition to one coming from `f x')
2023-04-29 13:05:38 +0200 <Guest7013> hmm
2023-04-29 13:05:46 +0200 <Guest7013> the counting effects bit makes sense but
2023-04-29 13:06:13 +0200 <Guest7013> i still find it unintuitive that the right thing to do is to pick the function i want to lift over the accumulator rather than just picking the end state of the accumulator
2023-04-29 13:06:45 +0200 <Guest7013> (i'm using "state" loosely here)
2023-04-29 13:07:01 +0200tremon(~tremon@83.80.159.219)
2023-04-29 13:08:39 +0200 <ski> point is that you're not just picking the end state of the accumulator, when using `liftA3' there, you're regenerating it, twice, and then throwing away one end result in favor of the other
2023-04-29 13:09:05 +0200totbwf(sid402332@id-402332.uxbridge.irccloud.com) (Quit: Connection closed for inactivity)
2023-04-29 13:09:11 +0200 <Guest7013> oh that's a good way of putting it
2023-04-29 13:09:16 +0200pyook(~puke@user/puke)
2023-04-29 13:09:28 +0200 <Guest7013> i guess i was vaguely thinking that laziness meant i wouldn't actually generate both
2023-04-29 13:09:29 +0200 <ski> (and since you're doing this recursively, you're doing this in a binary tree, so you actually have an exponential explosion of reexecuted effects)
2023-04-29 13:09:44 +0200 <ski> (s/binary tree/binary calling tree/)
2023-04-29 13:09:45 +0200 <Guest7013> but no, i'm lifting the applicative part so that happens regardless
2023-04-29 13:10:58 +0200 <Guest7013> i guess also for the non-applicative version of filter the two approaches are actually equivalent and i tried starting from that and then adding the applicative layer
2023-04-29 13:11:06 +0200 <Guest7013> but i needed to start with the other version
2023-04-29 13:11:17 +0200 <ski> yea, non-strictness is irrelevant here. list monad is strict in the sense that all the effects you specify happen at the place you specify them. (although, it is non-strict, in the sense that you can extract as many or as few results as you want, and the remaining ones won't be computed unless/until you ask for them)
2023-04-29 13:11:32 +0200coot(~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba)
2023-04-29 13:12:05 +0200 <ski> for "non-applicative version of filter", you mean the plain `filter :: (a -> Bool) -> [a] -> [a]' ?
2023-04-29 13:12:08 +0200 <Guest7013> yeah
2023-04-29 13:12:13 +0200 <ski> right
2023-04-29 13:12:47 +0200 <Guest7013> okay cool, i think this all makes a lot more sense now
2023-04-29 13:13:11 +0200 <Guest7013> i've mostly been able to stick to the mantra of "just follow the types" and i think this is the first case where it's failed me :(
2023-04-29 13:13:27 +0200 <ski> btw, in a monadic version, you could first run the test on the element, and then use the intermediate result of that to decide what to do next. .. but applicative effects can't do that, can't use intermediate results to decide which effects to perform next
2023-04-29 13:13:43 +0200 <ski> applicative effects are "static", and monadic effects are "dynamic", in this sense
2023-04-29 13:13:53 +0200 <Guest7013> right
2023-04-29 13:14:22 +0200coot(~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Client Quit)
2023-04-29 13:14:56 +0200 <ski> (in this particular case, it doesn't matter too much, since in both cases you still want to "continue with the same thing, on the remainder of the list", and then merely *maybe* add the element on top of that, but *not* decide to run some effect or not (which applicative can't do))
2023-04-29 13:15:54 +0200 <ski> one nice illustration of this is parsers. if you want to parse a number, and then want to parse that many items, then you must use a monadic parser
2023-04-29 13:16:14 +0200 <ski> another illustration :
2023-04-29 13:16:15 +0200 <ski> @where applicative-vs-monadic
2023-04-29 13:16:16 +0200 <lambdabot> "Applicative vs Monadic build systems" by ndm in 2014-07-23 at <https://neilmitchell.blogspot.se/2014/07/applicative-vs-monadic-build-systems.html>. (cf. "static sequencing" vs. "dynamic sequencing")
2023-04-29 13:17:42 +0200 <Guest7013> okay, back to these exercises
2023-04-29 13:17:48 +0200 <Guest7013> thanks for all your help, ski!
2023-04-29 13:17:56 +0200 <ski> (in an applicative build system, the build system makes a complete build plan first, and then executes it. some run-time build result can't influence what the build system will try building next. a monadic one can build part of the build plan at run-time, though)
2023-04-29 13:18:01 +0200shailangsa(~shailangs@host165-120-169-78.range165-120.btcentralplus.com)
2023-04-29 13:18:02 +0200 <ski> np
2023-04-29 13:18:08 +0200JScript(~JScript@144.48.39.18)
2023-04-29 13:18:10 +0200Guest7013(~Guest70@2604:4080:11a5:8050:3823:f4c5:f08a:7b71) (Quit: Client closed)
2023-04-29 13:18:11 +0200JScript(~JScript@144.48.39.18) (Max SendQ exceeded)
2023-04-29 13:18:45 +0200merijn(~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) (Ping timeout: 240 seconds)
2023-04-29 13:19:39 +0200JScript(~JScript@144.48.39.18)
2023-04-29 13:19:49 +0200JScript(~JScript@144.48.39.18) (Max SendQ exceeded)
2023-04-29 13:21:11 +0200Joao003(~Joao003@2804:840:8311:b700:e035:773e:85f2:c516)
2023-04-29 13:23:03 +0200JScript(~JScript@144.48.39.18)
2023-04-29 13:23:25 +0200JScript(~JScript@144.48.39.18) (Max SendQ exceeded)
2023-04-29 13:23:57 +0200JScript(~JScript@144.48.39.18)
2023-04-29 13:24:02 +0200JScript(~JScript@144.48.39.18) (Max SendQ exceeded)
2023-04-29 13:26:27 +0200JScript(~JScript@144.48.39.18)
2023-04-29 13:26:31 +0200JScript(~JScript@144.48.39.18) (Max SendQ exceeded)
2023-04-29 13:28:53 +0200 <Joao003> Nothing happening in the channel right now
2023-04-29 13:29:41 +0200 <ski> that's nothing unusual
2023-04-29 13:30:05 +0200JScript(~JScript@144.48.39.18)
2023-04-29 13:30:08 +0200JScript(~JScript@144.48.39.18) (Max SendQ exceeded)
2023-04-29 13:31:23 +0200 <Joao003> Why is this same guy joining and quitting over and over
2023-04-29 13:31:50 +0200 <ski> they accidentally pasted many lines, in some channel or in PM with someone
2023-04-29 13:32:01 +0200 <Joao003> oh
2023-04-29 13:32:52 +0200Maeda(~Maeda@91-161-10-149.subs.proxad.net) (Quit: leaving)
2023-04-29 13:33:00 +0200 <Joao003> ((->) r) is a monad, right?
2023-04-29 13:33:15 +0200JScript(~JScript@144.48.39.18)
2023-04-29 13:33:25 +0200 <probie> Yes. It is the reader monad (just without a newtype)
2023-04-29 13:33:44 +0200 <ski> environment/input/reader monad
2023-04-29 13:34:21 +0200alexherbo2(~alexherbo@2a02-842a-8180-4601-85e1-23ae-ea70-6ae4.rev.sfr.net) (Remote host closed the connection)
2023-04-29 13:34:45 +0200 <Joao003> So if the monad used in `ap` is ((->) r), then `ap`'s type signature is `(r -> a -> b) -> (r -> a) -> r -> b`, which is the same one of the S combinator
2023-04-29 13:35:24 +0200 <ski> yes
2023-04-29 13:35:30 +0200 <Joao003> And indeed,
2023-04-29 13:35:38 +0200 <Joao003> > ap (+) (*2) 3
2023-04-29 13:35:39 +0200 <lambdabot> 9
2023-04-29 13:35:43 +0200 <Joao003> It is.
2023-04-29 13:35:59 +0200 <ski> (and what about `ask',`return' and `(=<<)' ?)
2023-04-29 13:37:32 +0200 <yushyin> i have a dejavu ^^
2023-04-29 13:38:06 +0200 <Joao003> (=<<) also works?
2023-04-29 13:38:20 +0200 <Joao003> > ((+) =<< (*2)) 3
2023-04-29 13:38:22 +0200 <ski> "works" ?
2023-04-29 13:38:22 +0200 <lambdabot> 9
2023-04-29 13:38:47 +0200alexherbo2(~alexherbo@2a02-842a-8180-4601-85e1-23ae-ea70-6ae4.rev.sfr.net)
2023-04-29 13:42:22 +0200 <Joao003> > ap (-) (*2) 3 -- Should be -3
2023-04-29 13:42:23 +0200 <lambdabot> -3
2023-04-29 13:42:53 +0200 <Joao003> > ((-) =<< (*2)) 3 -- Wait...
2023-04-29 13:42:55 +0200 <lambdabot> 3
2023-04-29 13:43:16 +0200 <Joao003> > ((flip (-)) =<< (*2)) 3 -- I guess it works now
2023-04-29 13:43:18 +0200 <lambdabot> -3
2023-04-29 13:48:55 +0200 <ncf> the only difference between >>= and <*> is a -> f b vs. f (a -> b), and if f is ((->) r) then the difference is `flip`
2023-04-29 13:49:28 +0200 <Joao003> > ((*2) <*> (-)) 3
2023-04-29 13:49:29 +0200 <lambdabot> error:
2023-04-29 13:49:29 +0200 <lambdabot> • Occurs check: cannot construct the infinite type:
2023-04-29 13:49:29 +0200 <lambdabot> a0 ~ (a0 -> a0) -> t
2023-04-29 13:49:33 +0200 <Joao003> wut
2023-04-29 13:50:20 +0200 <probie> > ((-) <*> (*2)) 3
2023-04-29 13:50:21 +0200 <lambdabot> -3
2023-04-29 13:50:27 +0200titibandit(~titibandi@user/titibandit)
2023-04-29 13:51:14 +0200 <ncf> oh yeah, i should have said between =<< and <*>
2023-04-29 13:51:39 +0200 <ski> well .. the difference is `flip'
2023-04-29 13:51:47 +0200 <ncf> right, a different one :)
2023-04-29 13:52:32 +0200 <ski> reminds me of the old days of `flip :: Functor f => f (a -> b) -> (a -> f b)' in lambdabot
2023-04-29 13:52:36 +0200Inst__(~Inst@2601:6c4:4081:54f0:9027:6f4:a9a6:93a0)
2023-04-29 13:52:42 +0200 <Hecate> 31
2023-04-29 13:53:01 +0200 <ski> 127
2023-04-29 13:53:23 +0200 <Hecate> kuribas: I believe Isabelle has a repo of proofs
2023-04-29 13:53:32 +0200 <Hecate> ski: 👋
2023-04-29 13:54:00 +0200mc47(~mc47@xmonad/TheMC47)
2023-04-29 13:54:00 +0200 <Joao003> Just found out that liftM2 works exactly like APL's fork thingy (a.k.a. passing a value through two unary functions and then passing the result of that to a binary function)
2023-04-29 13:54:20 +0200 <Joao003> If the instance used is (->) r
2023-04-29 13:54:23 +0200yaxu(~yaxu@host-78-148-247-238.as13285.net)
2023-04-29 13:54:54 +0200 <ski> (or `liftA2')
2023-04-29 13:54:54 +0200 <yaxu> Hi all, I'm confused about something..
2023-04-29 13:54:59 +0200 <gry> ?
2023-04-29 13:55:18 +0200 <yaxu> Say I have a function like this: withShortest f a b | length a > length b = (f a, b)
2023-04-29 13:55:18 +0200 <yaxu> | length a < length b = (a, f b)
2023-04-29 13:55:19 +0200 <yaxu> | otherwise = (a, b)
2023-04-29 13:55:27 +0200skilooks quizzically at Hecate
2023-04-29 13:55:49 +0200 <yaxu> it has a type: withShortest :: Foldable t => (t a -> t a) -> t a -> t a -> (t a, t a)
2023-04-29 13:55:56 +0200Inst_(~Inst@2601:6c4:4081:54f0:317f:532d:86fb:4a08) (Ping timeout: 250 seconds)
2023-04-29 13:56:54 +0200 <Joao003> What's your problem?
2023-04-29 13:57:01 +0200 <yaxu> I don't see why the lists can't contain different types.
2023-04-29 13:57:21 +0200bjobjo(~bjobjo@user/bjobjo) (Quit: leaving)
2023-04-29 13:57:31 +0200 <yaxu> like, why can't I have: withShortest reverse [1, 2, 3] ["a", "b"]
2023-04-29 13:57:33 +0200 <ski> because `f' is not polymorphic
2023-04-29 13:57:34 +0200 <Joao003> Because your pair can contain unapplied lists or applied lists, so both need to be of the same type
2023-04-29 13:57:39 +0200 <ski> you could say
2023-04-29 13:57:59 +0200 <ski> withShortest :: Foldable t => (forall x. t x -> t x) -> t a -> t b -> (t a,t b)
2023-04-29 13:58:19 +0200 <ski> (you'll need to enable `Rank2Types' (or `RankNTypes') language extension)
2023-04-29 13:59:40 +0200 <ski> however, higher-rank types can't be inferred, so you must give an explicit type signature
2023-04-29 13:59:58 +0200 <ski> (well, rank-2 types could technically be inferred. but GHC doesn't try)
2023-04-29 14:00:02 +0200 <yaxu> aha thanks! yes I see the (more general?) type isn't inferred still
2023-04-29 14:00:11 +0200 <ski> see ^
2023-04-29 14:01:42 +0200gawen(~gawen@user/gawen) (Quit: cya)
2023-04-29 14:02:01 +0200 <ncf> note that your function might evaluate length a and length b twice needlessly
2023-04-29 14:02:15 +0200 <ncf> :t comparing length
2023-04-29 14:02:16 +0200 <lambdabot> Foldable t => t a -> t a -> Ordering
2023-04-29 14:02:58 +0200 <ski> you could even determine the comparision without forcing the longer one of the lists fully
2023-04-29 14:06:47 +0200gnalzo(~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c) (Quit: WeeChat 3.8)
2023-04-29 14:07:59 +0200 <yaxu> fair point, the actual data structure I am working with is more complex so worth optimising that comparison..
2023-04-29 14:08:23 +0200 <yaxu> also I have the < and > the wrong way around ;)
2023-04-29 14:08:32 +0200 <ski> even for lists it can be worth it
2023-04-29 14:09:16 +0200 <ski> oh, it wasn't short for `withShortestUnchanged' ? ;)
2023-04-29 14:09:56 +0200 <yaxu> heh
2023-04-29 14:10:02 +0200gawen(~gawen@user/gawen)
2023-04-29 14:10:42 +0200 <Joao003> What about `applyShortest`?
2023-04-29 14:13:29 +0200 <yaxu> you prefer that? I quite like 'with'
2023-04-29 14:13:43 +0200gurkenglas(~gurkengla@dynamic-089-204-130-021.89.204.130.pool.telefonica.de) (Ping timeout: 276 seconds)
2023-04-29 14:13:48 +0200mc47(~mc47@xmonad/TheMC47) (Remote host closed the connection)
2023-04-29 14:16:17 +0200ski. o O ( `withoutLongest' )
2023-04-29 14:16:45 +0200 <ncf> make it shortest :: Lens' (t a, t a) (t a) and be done with the bikeshedding
2023-04-29 14:16:57 +0200 <ncf> (ok, that's not a lawful lens...)
2023-04-29 14:17:33 +0200 <yaxu> I've not been able to get my head around lenses..
2023-04-29 14:18:12 +0200 <jade[m]> me neither :c
2023-04-29 14:20:10 +0200Vq_(~vq@90-227-195-9-no77.tbcn.telia.com)
2023-04-29 14:20:16 +0200hpc_(~juzz@ip98-169-35-163.dc.dc.cox.net)
2023-04-29 14:20:22 +0200barrucad1(~barrucadu@carcosa.barrucadu.co.uk)
2023-04-29 14:23:18 +0200xff0x_(~xff0x@fsa056e3ab.kytj202.ap.nuro.jp)
2023-04-29 14:23:22 +0200drlkf_(~drlkf@192.184.163.34.bc.googleusercontent.com)
2023-04-29 14:23:23 +0200ridcully_(~ridcully@p57b52f2c.dip0.t-ipconnect.de)
2023-04-29 14:24:20 +0200dfordivam1(~dfordivam@tk2-219-19469.vs.sakura.ne.jp)
2023-04-29 14:26:02 +0200cyphase_eviltwin(~cyphase@user/cyphase)
2023-04-29 14:27:46 +0200 <Joao003> What is a Lens? Never seen one
2023-04-29 14:28:03 +0200 <geekosaur> it's a way to focus on part of a structure
2023-04-29 14:28:17 +0200 <Joao003> Example?
2023-04-29 14:29:01 +0200 <geekosaur> I don't really use complex enough data structures to be that familiar with it; I just know it's there if I ever do need it 🙂
2023-04-29 14:29:09 +0200puke(~puke@user/puke)
2023-04-29 14:29:12 +0200 <ncf> _0 :: Lens' (a, b) a
2023-04-29 14:29:30 +0200 <Joao003> ncf: How will you use that?
2023-04-29 14:29:39 +0200 <ncf> lets you get the a out of (a, b) (this is just fst) and *update* the a with a new value to get a new (a, b)
2023-04-29 14:30:05 +0200 <ski> it gives a name for the path from some arbitrary data structure (of a given type) into a particular sub data structure if it (of a particular type)
2023-04-29 14:30:45 +0200masterbu1lder(~masterbui@user/masterbuilder)
2023-04-29 14:30:49 +0200 <ski> you can also give names to "multiple locations" at the same time. but then you have a traversal or something like that, rather than a plain lens
2023-04-29 14:30:56 +0200 <ncf> Joao003: depends on the library, if we're talking about kmett's lens then you'd use (^.) / view to get the value and (%~) / over to modify it
2023-04-29 14:31:10 +0200nitrix_(~nitrix@user/nitrix)
2023-04-29 14:31:46 +0200 <ncf> > (1, 2) & _0 %~ (+ 10)
2023-04-29 14:31:50 +0200 <lambdabot> error:
2023-04-29 14:31:50 +0200 <lambdabot> • Found hole: _0 :: ASetter (Integer, Integer) b Integer Integer
2023-04-29 14:31:50 +0200 <lambdabot> Where: ‘b’ is a rigid type variable bound by
2023-04-29 14:31:56 +0200bravespear|2(~Ranhir@157.97.53.139)
2023-04-29 14:32:11 +0200 <ncf> > (1, 2) & _1 %~ (+ 10)
2023-04-29 14:32:13 +0200 <lambdabot> (11,2)
2023-04-29 14:32:16 +0200pie__(~pie_bnc@user/pie/x-2818909)
2023-04-29 14:32:18 +0200 <ncf> right, it's 1-indexed
2023-04-29 14:32:21 +0200tremon_(~tremon@83.80.159.219)
2023-04-29 14:32:22 +0200kawen_(~quassel@static.208.191.216.95.clients.your-server.de)
2023-04-29 14:32:25 +0200wagle_(~wagle@quassel.wagle.io)
2023-04-29 14:32:27 +0200turlando_(~turlando@user/turlando)
2023-04-29 14:32:28 +0200CAT_S_(apic@brezn3.muc.ccc.de)
2023-04-29 14:32:29 +0200 <ncf> > ((1, 2) & _1 %~ (+ 10)) ^. _1
2023-04-29 14:32:31 +0200 <lambdabot> 11
2023-04-29 14:32:44 +0200 <Joao003> > (1, 2) & _2 %~ (+ 10)
2023-04-29 14:32:46 +0200 <lambdabot> (1,12)
2023-04-29 14:33:02 +0200tv1(~tv@user/tv)
2023-04-29 14:34:10 +0200 <ski> > [Just (0,1),Just (2,3),Nothing,Just (6,7)] & mapped . mapped . _1 %~ (^ 2)
2023-04-29 14:34:11 +0200 <lambdabot> [Just (0,1),Just (4,3),Nothing,Just (36,7)]
2023-04-29 14:34:13 +0200canta1(~canta@cvm0.d5k.one)
2023-04-29 14:34:53 +0200 <Joao003> What does mapped do then?
2023-04-29 14:34:58 +0200 <ncf> :t mapped
2023-04-29 14:35:00 +0200 <lambdabot> (Settable f1, Functor f2) => (a -> f1 b) -> f2 a -> f1 (f2 b)
2023-04-29 14:35:07 +0200 <ncf> ok that's confusing
2023-04-29 14:35:10 +0200 <ski> accesses each element of a functor container
2023-04-29 14:35:18 +0200 <ncf> mapped :: Functor f => Lens' (f a) a
2023-04-29 14:35:28 +0200 <ncf> well, Traversal'
2023-04-29 14:35:54 +0200 <ski> the first `mapped' corresponds to the list, the second corresponds to the `Maybe' (accessing the `Just' parts), the `_1' accesses the first components of the pairs
2023-04-29 14:36:56 +0200 <Joao003> > [1..4] & mapped
2023-04-29 14:36:58 +0200 <lambdabot> error:
2023-04-29 14:36:58 +0200 <lambdabot> • Couldn't match type ‘[a0]’ with ‘a -> f1 b’
2023-04-29 14:36:58 +0200 <lambdabot> Expected type: [a0] -> f a -> f1 (f b)
2023-04-29 14:37:09 +0200 <Joao003> ...
2023-04-29 14:37:19 +0200Teacup_(~teacup@user/teacup)
2023-04-29 14:37:24 +0200 <ski> you need to say what to do with the accessed components
2023-04-29 14:37:39 +0200 <Joao003> > [1..4] & mapped . (+1)
2023-04-29 14:37:41 +0200 <lambdabot> error:
2023-04-29 14:37:41 +0200 <lambdabot> • Couldn't match type ‘[a0]’ with ‘a -> f1 b’
2023-04-29 14:37:41 +0200 <lambdabot> Expected type: [a0] -> f a -> f1 (f b)
2023-04-29 14:37:45 +0200 <Joao003> uh.
2023-04-29 14:38:01 +0200 <Joao003> Trying to replicate earlier code never works.
2023-04-29 14:38:04 +0200cyphase(~cyphase@user/cyphase) (Excess Flood)
2023-04-29 14:39:00 +0200Vq(~vq@90-227-195-9-no77.tbcn.telia.com) (Ping timeout: 320 seconds)
2023-04-29 14:39:01 +0200hpc(~juzz@ip98-169-35-163.dc.dc.cox.net) (Ping timeout: 320 seconds)
2023-04-29 14:39:01 +0200barrucadu(~barrucadu@carcosa.barrucadu.co.uk) (Ping timeout: 320 seconds)
2023-04-29 14:39:07 +0200hpc_hpc
2023-04-29 14:39:12 +0200 <Joao003> Ok, it's too confusing
2023-04-29 14:39:24 +0200 <eldritchcookie[m> mapped [1..4] (+1)
2023-04-29 14:39:41 +0200 <eldritchcookie[m> > mapped [1..4] (+1)
2023-04-29 14:39:42 +0200 <lambdabot> error:
2023-04-29 14:39:42 +0200 <lambdabot> • Couldn't match expected type ‘a -> f b’ with actual type ‘[a0]’
2023-04-29 14:39:42 +0200 <lambdabot> • In the first argument of ‘mapped’, namely ‘[1 .. 4]’
2023-04-29 14:40:03 +0200 <Joao003> > mapped [1..4] $ (+1)
2023-04-29 14:40:05 +0200 <lambdabot> error:
2023-04-29 14:40:06 +0200 <lambdabot> • Couldn't match expected type ‘a -> f b’ with actual type ‘[a0]’
2023-04-29 14:40:06 +0200 <lambdabot> • In the first argument of ‘mapped’, namely ‘[1 .. 4]’
2023-04-29 14:40:11 +0200tremon(~tremon@83.80.159.219) (Ping timeout: 305 seconds)
2023-04-29 14:40:11 +0200xff0x(~xff0x@fsa056e3ab.kytj202.ap.nuro.jp) (Ping timeout: 305 seconds)
2023-04-29 14:40:11 +0200pie_(~pie_bnc@user/pie/x-2818909) (Ping timeout: 305 seconds)
2023-04-29 14:40:11 +0200vgtw(~vgtw@user/vgtw) (Ping timeout: 305 seconds)
2023-04-29 14:40:11 +0200nitrix(~nitrix@user/nitrix) (Ping timeout: 305 seconds)
2023-04-29 14:40:11 +0200Teacup(~teacup@user/teacup) (Ping timeout: 305 seconds)
2023-04-29 14:40:11 +0200drlkf(~drlkf@192.184.163.34.bc.googleusercontent.com) (Ping timeout: 305 seconds)
2023-04-29 14:40:11 +0200Ranhir(~Ranhir@157.97.53.139) (Ping timeout: 305 seconds)
2023-04-29 14:40:11 +0200bliminse(~bliminse@user/bliminse) (Ping timeout: 305 seconds)
2023-04-29 14:40:11 +0200masterbuilder(~masterbui@user/masterbuilder) (Ping timeout: 305 seconds)
2023-04-29 14:40:11 +0200ridcully(~ridcully@p57b52f2c.dip0.t-ipconnect.de) (Ping timeout: 305 seconds)
2023-04-29 14:40:11 +0200turlando(~turlando@user/turlando) (Ping timeout: 305 seconds)
2023-04-29 14:40:11 +0200dfordvm(~dfordivam@tk2-219-19469.vs.sakura.ne.jp) (Ping timeout: 305 seconds)
2023-04-29 14:40:11 +0200micro(~micro@user/micro) (Ping timeout: 305 seconds)
2023-04-29 14:40:11 +0200wagle(~wagle@quassel.wagle.io) (Ping timeout: 305 seconds)
2023-04-29 14:40:11 +0200CAT_S(apic@brezn3.muc.ccc.de) (Ping timeout: 305 seconds)
2023-04-29 14:40:11 +0200canta(~canta@user/canta) (Ping timeout: 305 seconds)
2023-04-29 14:40:11 +0200tv(~tv@user/tv) (Ping timeout: 305 seconds)
2023-04-29 14:40:11 +0200kawen(~quassel@static.208.191.216.95.clients.your-server.de) (Ping timeout: 305 seconds)
2023-04-29 14:40:13 +0200nitrix_nitrix
2023-04-29 14:40:14 +0200 <eldritchcookie[m> > mapped (+1) [1..4]
2023-04-29 14:40:16 +0200 <lambdabot> error:
2023-04-29 14:40:16 +0200 <lambdabot> • Ambiguous type variables ‘f0’,
2023-04-29 14:40:16 +0200 <lambdabot> ‘b0’ arising from a use of ‘show_M26522238195...
2023-04-29 14:40:24 +0200 <Joao003> WTH HAPPENED ABOVE US
2023-04-29 14:40:34 +0200bliminse(~bliminse@user/bliminse)
2023-04-29 14:40:35 +0200 <Joao003> Too many simultaneous quits
2023-04-29 14:41:00 +0200 <eldritchcookie[m> \> mapped (+1) [1..4]
2023-04-29 14:41:05 +0200gawen(~gawen@user/gawen) (Quit: cya)
2023-04-29 14:41:31 +0200 <eldritchcookie[m> > mapped (+1) [1..5]
2023-04-29 14:41:33 +0200 <lambdabot> error:
2023-04-29 14:41:33 +0200 <lambdabot> • Ambiguous type variables ‘f0’,
2023-04-29 14:41:33 +0200 <lambdabot> ‘b0’ arising from a use of ‘show_M78316969100...
2023-04-29 14:41:58 +0200 <Joao003> Why is it not working
2023-04-29 14:42:29 +0200 <eldritchcookie[m> your case wrong order
2023-04-29 14:42:48 +0200 <eldritchcookie[m> in mine i haven't chosen the f so it is ambigous
2023-04-29 14:42:54 +0200 <eldritchcookie[m> :t mapped
2023-04-29 14:42:55 +0200 <lambdabot> (Settable f1, Functor f2) => (a -> f1 b) -> f2 a -> f1 (f2 b)
2023-04-29 14:43:40 +0200vgtw(~vgtw@user/vgtw)
2023-04-29 14:43:49 +0200 <ski> > over mapped (^ 2) [0 .. 3]
2023-04-29 14:43:50 +0200 <lambdabot> [0,1,4,9]
2023-04-29 14:44:18 +0200 <ski> Joao003 : some relay or other malfunctioning, i'd gather
2023-04-29 14:44:57 +0200 <geekosaur> :t mapped (+1) [1..4]
2023-04-29 14:44:58 +0200 <lambdabot> (Settable f, Num (f b), Enum (f b)) => f [b]
2023-04-29 14:45:04 +0200 <Joao003> over mapped (+ 1) (1, 2)
2023-04-29 14:45:09 +0200 <Joao003> >over mapped (+ 1) (1, 2)
2023-04-29 14:45:13 +0200 <ski> `mapped (+1)' makes little sense
2023-04-29 14:45:14 +0200 <Joao003> > over mapped (+ 1) (1, 2)
2023-04-29 14:45:16 +0200 <lambdabot> (1,3)
2023-04-29 14:45:29 +0200micro(~micro@user/micro)
2023-04-29 14:45:50 +0200 <eldritchcookie[m> how is IO code tested?
2023-04-29 14:45:52 +0200 <ski> > over both (^ 2) (6,28)
2023-04-29 14:45:53 +0200 <lambdabot> (36,784)
2023-04-29 14:45:58 +0200 <ski> eldritchcookie[m : very carefully
2023-04-29 14:46:35 +0200 <eldritchcookie[m> could you be more specific?
2023-04-29 14:46:36 +0200 <Joao003> Ever heard of `bimap`
2023-04-29 14:46:46 +0200 <Joao003> > bimap (^ 2) (6, 28)
2023-04-29 14:46:48 +0200 <lambdabot> error:
2023-04-29 14:46:48 +0200 <lambdabot> • Couldn't match expected type ‘c -> d’ with actual type ‘(a0, b1)’
2023-04-29 14:46:48 +0200 <lambdabot> • In the second argument of ‘bimap’, namely ‘(6, 28)’
2023-04-29 14:46:50 +0200 <Joao003> uh
2023-04-29 14:47:02 +0200 <eldritchcookie[m> you need to provide 2 functions
2023-04-29 14:47:15 +0200 <Joao003> > join bimap (^2) (6, 28)
2023-04-29 14:47:17 +0200 <lambdabot> (36,784)
2023-04-29 14:47:38 +0200merijn(~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl)
2023-04-29 14:48:23 +0200 <Joao003> @src both
2023-04-29 14:48:23 +0200 <lambdabot> Source not found. Your mind just hasn't been the same since the electro-shock, has it?
2023-04-29 14:48:25 +0200 <ski> eldritchcookie[m : one approach is to mock it, generating a data structure which you can interpret in a sandbox kind of thing
2023-04-29 14:48:41 +0200 <ski> @botsmack
2023-04-29 14:48:41 +0200 <lambdabot> :)
2023-04-29 14:49:10 +0200 <Joao003> > map (join bimap (^2)) [Left 6, Right 28]
2023-04-29 14:49:12 +0200 <lambdabot> [Left 36,Right 784]
2023-04-29 14:49:30 +0200 <ncf> @let shortest f (a, b) = case comparing length a b of LT -> (,b) <$> f a; _ -> (a,) <$> f b
2023-04-29 14:49:32 +0200 <lambdabot> Defined.
2023-04-29 14:49:44 +0200 <eldritchcookie[m> i am asking because i could rewrite my code to use a dynamic effect instead of IO so then when testing i can use a pure interpreter
2023-04-29 14:49:50 +0200 <ski> (`f' is still monomorphic)
2023-04-29 14:49:56 +0200 <ncf> > over shortest (map (^ 2)) ([1..3], [4..7])
2023-04-29 14:49:58 +0200 <lambdabot> ([1,4,9],[4,5,6,7])
2023-04-29 14:50:31 +0200 <Joao003> :t shortest
2023-04-29 14:50:32 +0200 <lambdabot> (Foldable t, Functor f) => (t a -> f (t a)) -> (t a, t a) -> f (t a, t a)
2023-04-29 14:50:39 +0200 <ski> "dynamic effect" ?
2023-04-29 14:51:11 +0200 <eldritchcookie[m> i am using a effectful an effect library they allow you to define effects
2023-04-29 14:51:19 +0200 <ski> mhm
2023-04-29 14:51:44 +0200merijn(~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) (Ping timeout: 248 seconds)
2023-04-29 14:54:12 +0200Lycurgus(~juan@user/Lycurgus)
2023-04-29 14:55:19 +0200ryantrinkle(~ryantrink@140.174.240.199) (Ping timeout: 276 seconds)
2023-04-29 14:56:15 +0200gawen(~gawen@user/gawen)
2023-04-29 14:58:23 +0200Lycurgus(~juan@user/Lycurgus) (Client Quit)
2023-04-29 15:01:50 +0200 <somerandomnick[m> so in effect
2023-04-29 15:03:36 +0200 <somerandomnick[m> nvm
2023-04-29 15:09:23 +0200ryantrinkle(~ryantrink@204.2.88.230)
2023-04-29 15:10:04 +0200anpad(~pandeyan@user/anpad) (Ping timeout: 252 seconds)
2023-04-29 15:18:17 +0200anpad(~pandeyan@user/anpad)
2023-04-29 15:22:35 +0200shriekingnoise(~shrieking@186.137.175.87)
2023-04-29 15:27:52 +0200zeenk(~zeenk@2a02:2f04:a20f:5200::7fe) (Quit: Konversation terminated!)
2023-04-29 15:28:48 +0200alexherbo2(~alexherbo@2a02-842a-8180-4601-85e1-23ae-ea70-6ae4.rev.sfr.net) (Remote host closed the connection)
2023-04-29 15:32:00 +0200anpad(~pandeyan@user/anpad) (Read error: Connection reset by peer)
2023-04-29 15:33:03 +0200justsomeguy(~justsomeg@user/justsomeguy)
2023-04-29 15:33:04 +0200o-90(~o-90@gateway/tor-sasl/o-90)
2023-04-29 15:35:19 +0200eggplantade(~Eggplanta@2600:1700:38c5:d800:d4d0:8bd2:d805:7ab6)
2023-04-29 15:36:26 +0200coot(~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba)
2023-04-29 15:36:38 +0200VernorVintage(~maxsu@wsip-24-120-138-106.lv.lv.cox.net)
2023-04-29 15:39:07 +0200 <VernorVintage> hey all, has anyone built any monads to capture patterns for recursive LLM prompt generation?
2023-04-29 15:39:31 +0200 <Joao003> ghci isn't recognizing the cabal package I just installed
2023-04-29 15:39:55 +0200eggplantade(~Eggplanta@2600:1700:38c5:d800:d4d0:8bd2:d805:7ab6) (Ping timeout: 250 seconds)
2023-04-29 15:40:00 +0200 <geekosaur> cabal repl --build-depends=that-package
2023-04-29 15:40:31 +0200 <geekosaur> cabal does not install packages where ghc/ghci can see them directly because that invites ghc/ghci to create its own diamond dependency errors
2023-04-29 15:41:12 +0200 <geekosaur> (unless you used cabal install --lib in which case you're doing that inviting)
2023-04-29 15:41:40 +0200 <Joao003> I did cabal install package
2023-04-29 15:42:16 +0200 <Joao003> Your method didn't work
2023-04-29 15:43:57 +0200 <geekosaur> "didn't work" how? it's working here
2023-04-29 15:44:20 +0200o-90(~o-90@gateway/tor-sasl/o-90) (Remote host closed the connection)
2023-04-29 15:45:13 +0200coot(~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot)
2023-04-29 15:45:46 +0200Me-me(~Me-me@user/me-me) (Quit: Something has gone terribly, terribly wrong, that being that I'm not here any more.)
2023-04-29 15:45:58 +0200 <Joao003> It says "Could not find module <module name here>"
2023-04-29 15:46:11 +0200 <Joao003> When I try to import the module
2023-04-29 15:50:05 +0200nate1(~nate@98.45.169.16)
2023-04-29 15:51:56 +0200 <jade[m]> `foo a $ bar b c $ baz d e f
2023-04-29 15:52:06 +0200 <Joao003> jade[m]: what
2023-04-29 15:52:39 +0200 <jade[m]> * `foo a $ bar b c $ baz d e f` vs
2023-04-29 15:52:39 +0200 <jade[m]> `foo a . bar b c $ baz d e f`
2023-04-29 15:52:45 +0200 <jade[m]> which one do you prefer
2023-04-29 15:53:48 +0200 <geekosaur> https://paste.tomsmeding.com/5sbOzTVo
2023-04-29 15:54:47 +0200justsomeguy(~justsomeg@user/justsomeguy) (Ping timeout: 264 seconds)
2023-04-29 15:55:07 +0200nate1(~nate@98.45.169.16) (Ping timeout: 276 seconds)
2023-04-29 15:56:03 +0200wootehfoot(~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer)
2023-04-29 15:56:15 +0200anpad(~pandeyan@user/anpad)
2023-04-29 15:58:23 +0200 <ski> jade[m] : `(foo a . bar b c . baz d e) f' or `(foo a . bar b c) (baz d e f)'
2023-04-29 15:58:43 +0200 <ski> (or just `foo a (bar b c (baz d e f))')
2023-04-29 15:59:01 +0200 <jade[m]> hm yeah
2023-04-29 15:59:16 +0200 <Joao003> I prefer `baz d e f & bar b c & foo a`
2023-04-29 15:59:17 +0200 <jade[m]> I usually do f . g . h $ x
2023-04-29 15:59:43 +0200skimostly doesn't like to use `$'
2023-04-29 16:00:05 +0200 <Joao003> I forgot how to send these asterisk messages
2023-04-29 16:00:15 +0200 <ski> /me looks at Joao003
2023-04-29 16:00:18 +0200skilooks at Joao003
2023-04-29 16:00:51 +0200 <ski> advantage of `.' over `$' (and `&') is that `.' is associative, so you can factor out any subcomposition of the composition chain
2023-04-29 16:00:54 +0200Joao003now knows how to send these asterisk messages
2023-04-29 16:01:17 +0200 <ski> (fwiw, they're known as ACTIONs)
2023-04-29 16:10:51 +0200alexherbo2(~alexherbo@2a02-842a-8180-4601-85e1-23ae-ea70-6ae4.rev.sfr.net)
2023-04-29 16:13:15 +0200L29Ah(~L29Ah@wikipedia/L29Ah)
2023-04-29 16:14:57 +0200merijn(~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl)
2023-04-29 16:22:21 +0200ryantrinkle(~ryantrink@204.2.88.230) (Ping timeout: 259 seconds)
2023-04-29 16:23:24 +0200 <jade[m]> I don't know how to format this... (full message at <https://libera.ems.host/_matrix/media/v3/download/libera.chat/ebea9da76705976f0476cb0195a9ff23b82a…>)
2023-04-29 16:23:51 +0200 <jade[m]> let (no pun intended) me remove the redundant let
2023-04-29 16:27:05 +0200justsomeguy(~justsomeg@user/justsomeguy)
2023-04-29 16:29:18 +0200 <justsomeguy> n/c
2023-04-29 16:29:56 +0200justsomeguyreminds himself to bind the clear command to some key sequence that doesn't require pressing enter.
2023-04-29 16:32:43 +0200 <ski> you know you can use `let' in list comprehensions
2023-04-29 16:32:56 +0200 <ski> > [x | let x = 2 + 3]
2023-04-29 16:32:57 +0200 <lambdabot> [5]
2023-04-29 16:33:50 +0200sus0(zero@user/zeromomentum)
2023-04-29 16:34:25 +0200xff0x_(~xff0x@fsa056e3ab.kytj202.ap.nuro.jp) (Ping timeout: 240 seconds)
2023-04-29 16:35:06 +0200 <jade[m]> I usually know these things but am just too stupid to remind myself of them when I need them
2023-04-29 16:35:26 +0200 <jade[m]> I'm usually more pragmatic and just do, only adjusting stuff like that afterwards
2023-04-29 16:35:30 +0200jade[m]uploaded an image: (310KiB) < https://libera.ems.host/_matrix/media/v3/download/matrix.org/DjTMcCdCMuYkeEskwqrrEUVj/image.png >
2023-04-29 16:35:30 +0200 <jade[m]> anyways
2023-04-29 16:35:51 +0200 <[Leary]> jade[m]: I would write `draw = for_ iv \x -> for_ iv \y -> do { mkColor (x :+ y); GL.vertex ... } where { step = ...; size = ...; iv = ... }`, but with layout.
2023-04-29 16:37:31 +0200 <ski> yea, what [Leary] said
2023-04-29 16:40:27 +0200biberu(~biberu@user/biberu) (Read error: Connection reset by peer)
2023-04-29 16:44:48 +0200CAT_S_(apic@brezn3.muc.ccc.de) (Quit: Reconnecting)
2023-04-29 16:45:03 +0200CAT_S(apic@brezn3.muc.ccc.de)
2023-04-29 16:45:14 +0200jade[m]sent a code block: https://libera.ems.host/_matrix/media/v3/download/libera.chat/79f51cf12a7edf048f185f219f9bc471984f…
2023-04-29 16:45:21 +0200ryantrinkle(~ryantrink@204.2.88.230)
2023-04-29 16:46:13 +0200 <jade[m]> I could maybe just do forEach = for_ iv . (for_ iv .)
2023-04-29 16:46:27 +0200biberu(~biberu@user/biberu)
2023-04-29 16:46:36 +0200 <jade[m]> or is there a better idiom for a cartesian product traversal?
2023-04-29 16:49:15 +0200merijn(~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) (Ping timeout: 255 seconds)
2023-04-29 16:55:31 +0200totbwf(uid402332@id-402332.uxbridge.irccloud.com)
2023-04-29 16:58:55 +0200simendsjo(~user@84.211.91.241)
2023-04-29 17:02:44 +0200 <Joao003> (&) looks way more intuitive than ($) does, do you agree?
2023-04-29 17:03:30 +0200 <ski> either is usually unnecessary ..
2023-04-29 17:03:42 +0200 <ski> (except `&' for lensy stuff)
2023-04-29 17:05:11 +0200harveypwca(~harveypwc@2601:246:c180:a570:3828:d8:e523:3f67)
2023-04-29 17:06:01 +0200 <jade[m]> ski: nice in terms of partial application like with `zipWith ($)`
2023-04-29 17:06:51 +0200skiinvokes Mictlantecuthli
2023-04-29 17:06:53 +0200 <probie> jade[m]: Sure, but if you didn't have `($)`, you could just go `zipWith id`
2023-04-29 17:07:23 +0200 <jade[m]> yeah, but that's less intuitive imo
2023-04-29 17:07:29 +0200 <Joao003> But if your function is a sequence of functions you can indent it, put some &s and it looks really intuitive, almost like a step-by-step recipe
2023-04-29 17:07:48 +0200 <ski> @quote aztec.god
2023-04-29 17:07:48 +0200 <lambdabot> quicksilver says: zip`ap`tail the aztec god of consecutive numbers
2023-04-29 17:08:47 +0200 <ski> "intuitive" is in the eye of the beholder
2023-04-29 17:09:12 +0200 <Joao003> The only disadvantage of & though is you have to import it from Data.Function
2023-04-29 17:09:12 +0200 <probie> jade[m]: I don't think `zipWith ($)` isn't particularly intuitive. It's just a well known idiom
2023-04-29 17:09:25 +0200 <Joao003> probie: true
2023-04-29 17:09:28 +0200 <jade[m]> fair enough
2023-04-29 17:10:09 +0200 <Joao003> `zipWith id` is shorter so why not use the latter?
2023-04-29 17:10:31 +0200 <Joao003> It also saves your precious Shift key
2023-04-29 17:10:51 +0200 <ski> do you often have a list of functions ?
2023-04-29 17:11:06 +0200 <jade[m]> occasionally
2023-04-29 17:12:10 +0200 <Joao003> > take 20 [1..]
2023-04-29 17:12:12 +0200 <lambdabot> [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]
2023-04-29 17:12:28 +0200 <Joao003> ...
2023-04-29 17:12:44 +0200 <Joao003> > enumFromTo 1 20
2023-04-29 17:12:46 +0200 <lambdabot> [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]
2023-04-29 17:13:26 +0200 <jade[m]> I really hate the naming of that function
2023-04-29 17:13:30 +0200 <jade[m]> just call it range ffs
2023-04-29 17:13:42 +0200 <Joao003> jade[m]: lol
2023-04-29 17:13:56 +0200 <ski> there's also `enumFrom',`enumFromThen',`enumFromThenTo' .. what ought those be called, in that case ?
2023-04-29 17:14:06 +0200 <probie> Joao003: you can /msg lambdabot directly if you want to
2023-04-29 17:14:15 +0200 <darkling> `rangeffs 1 20` ? :)
2023-04-29 17:14:22 +0200 <Joao003> XD
2023-04-29 17:15:59 +0200 <jade[m]> rangeFrom, rangeStep, rangeStepFrom or something, idk
2023-04-29 17:16:09 +0200 <jade[m]> darkling: yes
2023-04-29 17:16:50 +0200 <[Leary]> Those functions exist to desugar range/enum syntax, not to be used directly. Why would it matter what they're called?
2023-04-29 17:17:05 +0200titibandit(~titibandi@user/titibandit) (Ping timeout: 240 seconds)
2023-04-29 17:17:14 +0200 <jade[m]> ¯\_(ツ)_/¯
2023-04-29 17:17:52 +0200 <Joao003> four-eyed shrug .-.
2023-04-29 17:18:18 +0200 <ski> i guess sometimes people partially apply them
2023-04-29 17:19:42 +0200 <Joao003> Anyone uses `take <insert number here> [<insert number here>..]`?
2023-04-29 17:20:55 +0200justsomeguy(~justsomeg@user/justsomeguy) (Ping timeout: 276 seconds)
2023-04-29 17:31:26 +0200VernorVintage(~maxsu@wsip-24-120-138-106.lv.lv.cox.net) (Ping timeout: 246 seconds)
2023-04-29 17:34:56 +0200azimut(~azimut@gateway/tor-sasl/azimut) (Ping timeout: 240 seconds)
2023-04-29 17:35:44 +0200Joao003(~Joao003@2804:840:8311:b700:e035:773e:85f2:c516) (Quit: Leaving)
2023-04-29 17:43:46 +0200eggplantade(~Eggplanta@2600:1700:38c5:d800:d4d0:8bd2:d805:7ab6)
2023-04-29 17:44:00 +0200bratwurst(~dfadsva@2604:3d09:207f:f650::9c24)
2023-04-29 17:44:46 +0200alexherbo2(~alexherbo@2a02-842a-8180-4601-85e1-23ae-ea70-6ae4.rev.sfr.net) (Remote host closed the connection)
2023-04-29 17:45:00 +0200alexherbo2(~alexherbo@2a02-842a-8180-4601-85e1-23ae-ea70-6ae4.rev.sfr.net)
2023-04-29 17:47:02 +0200GerryH(~Brgaammin@p57bd3b04.dip0.t-ipconnect.de)
2023-04-29 17:47:02 +0200GerryH(~Brgaammin@p57bd3b04.dip0.t-ipconnect.de) (Remote host closed the connection)
2023-04-29 17:47:40 +0200GerryH(~Brgaammin@p57bd3b04.dip0.t-ipconnect.de)
2023-04-29 17:50:09 +0200 <monochrom> ($) has theoretical importance in the law (<*>) = liftA2 ($). This covers zipWith ($) actually.
2023-04-29 17:51:21 +0200 <monochrom> But when you hear monochrom say that something has theoretical importance, the subtext is that he also says that it has no practical importance. >:)
2023-04-29 17:51:31 +0200VernorVintage(~maxsu@24.120.138.106)
2023-04-29 17:51:44 +0200gemmaro(~user@240f:74:d1f0:1:ba1:e787:c9e:b1dc) (Remote host closed the connection)
2023-04-29 17:54:42 +0200 <probie> monochrom: sure, but that law is the same if it's (<*>) = liftA2 id
2023-04-29 17:54:42 +0200skifigured there had to be a fable about this
2023-04-29 17:55:29 +0200 <monochrom> id is less direct than ($)
2023-04-29 17:56:11 +0200 <monochrom> In this sense: In a code obfuscation contest, replacing ($) by id would be one of my first steps.
2023-04-29 17:56:38 +0200 <hpc> replace it with unsafeCoerce instead
2023-04-29 17:56:47 +0200 <monochrom> haha
2023-04-29 17:56:53 +0200 <probie> I also would like the type of `($)` to change to `a -> a`, but I doubt that will happen
2023-04-29 17:56:55 +0200Vq_Vq
2023-04-29 17:57:05 +0200 <ski> `($) @a @b' may be considered simpler than `id @(a -> b)'
2023-04-29 17:57:39 +0200 <monochrom> You also missed the ship of changing (.) to (a -> b) -> f a -> f b >:)
2023-04-29 17:57:52 +0200 <monochrom> err with Functor f =>
2023-04-29 17:57:58 +0200 <ski> well, the problem is that that ship returned to port
2023-04-29 17:58:21 +0200 <monochrom> haha
2023-04-29 17:58:40 +0200 <probie> I'd like the RHS of my `$` to be allowed to be unlifted
2023-04-29 17:58:45 +0200 <monochrom> This is what you get for a recursive languages. They keep coming back. >:)
2023-04-29 17:59:07 +0200 <probie> and to be able to use it with LinearTypes
2023-04-29 17:59:53 +0200gurkenglas(~gurkengla@dynamic-046-114-176-011.46.114.pool.telefonica.de)
2023-04-29 18:00:05 +0200 <ski> now i'm wondering whether OCaml has any dinatural support with their subtyping ..
2023-04-29 18:00:14 +0200 <ski> .. probably not, if i had to wager a guess
2023-04-29 18:00:27 +0200 <monochrom> @type id id id id id id
2023-04-29 18:00:28 +0200 <lambdabot> a -> a
2023-04-29 18:00:37 +0200 <monochrom> @quote monochrom 17-ary
2023-04-29 18:00:37 +0200 <lambdabot> monochrom says: I am 17-ary, going on 18-ary, I can take curry of you
2023-04-29 18:01:03 +0200 <ski> @quote please.talk
2023-04-29 18:01:03 +0200 <lambdabot> Dave_Benjamin says: please talk to your son or daughter about parametric polymorphism
2023-04-29 18:03:49 +0200GerryH(~Brgaammin@p57bd3b04.dip0.t-ipconnect.de) (Ping timeout: 276 seconds)
2023-04-29 18:04:56 +0200tzh(~tzh@24.21.73.154)
2023-04-29 18:12:45 +0200pavonia(~user@user/siracusa) (Quit: Bye!)
2023-04-29 18:16:56 +0200ddellacosta(~ddellacos@146.70.165.230) (Ping timeout: 246 seconds)
2023-04-29 18:18:07 +0200merijn(~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl)
2023-04-29 18:18:26 +0200accord(uid568320@id-568320.hampstead.irccloud.com) (Quit: Connection closed for inactivity)
2023-04-29 18:18:34 +0200puke(~puke@user/puke) (Quit: puke)
2023-04-29 18:19:25 +0200puke(~puke@user/puke)
2023-04-29 18:24:12 +0200merijn(~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) (Ping timeout: 255 seconds)
2023-04-29 18:24:43 +0200kuribas(~user@ptr-17d51enwg0abanf4ox8.18120a2.ip6.access.telenet.be) (Quit: ERC (IRC client for Emacs 27.1))
2023-04-29 18:34:43 +0200simendsjo(~user@84.211.91.241) (Ping timeout: 252 seconds)
2023-04-29 18:41:37 +0200bontaq(~user@ool-45779b84.dyn.optonline.net)
2023-04-29 18:42:47 +0200Maeda(~Maeda@91-161-10-149.subs.proxad.net)
2023-04-29 18:43:15 +0200dsrt^(~dsrt@c-76-105-96-13.hsd1.ga.comcast.net) (Remote host closed the connection)
2023-04-29 18:44:32 +0200Maeda(~Maeda@91-161-10-149.subs.proxad.net) (Client Quit)
2023-04-29 18:44:53 +0200econo(uid147250@user/econo)
2023-04-29 18:44:54 +0200Maeda(~Maeda@91-161-10-149.subs.proxad.net)
2023-04-29 18:58:29 +0200azimut(~azimut@gateway/tor-sasl/azimut)
2023-04-29 19:12:43 +0200Maeda(~Maeda@91-161-10-149.subs.proxad.net) (Quit: leaving)
2023-04-29 19:32:26 +0200Joao003(~Joao003@2804:840:8311:b700:e035:773e:85f2:c516)
2023-04-29 19:32:34 +0200 <Joao003> Hello again
2023-04-29 19:38:23 +0200 <juri_> hello!
2023-04-29 19:40:39 +0200 <[exa]> good afternon ladies and gentlemen how's your zygosistomorphic prepromorphisms today
2023-04-29 19:40:39 +0200Helle(~helle@user/Helle)
2023-04-29 19:41:59 +0200coot(~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba)
2023-04-29 19:42:02 +0200 <Helle> so if I want to GENERATE XML (yes, I made some bad decisions, like picking up this project), is there a more reasonable package then xml-conduit's Text.XML (I don't need streaming per se)
2023-04-29 19:42:17 +0200 <Helle> it works for my prototype, but the syntax is neither the best nor the worst
2023-04-29 19:43:09 +0200 <[exa]> Helle: if you're annoyed by the syntax, make a tiny syntaxy wrapper?
2023-04-29 19:43:46 +0200 <Helle> [exa]: well, more curious if I should be looking at other libraries or if it is a known good
2023-04-29 19:43:56 +0200 <Helle> it was basically the first and only one my own searches where giving
2023-04-29 19:44:52 +0200 <[exa]> ah yeah Text.XML is crude
2023-04-29 19:45:01 +0200merijn(~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl)
2023-04-29 19:45:24 +0200 <Helle> [exa]: anything nicer to consider ?
2023-04-29 19:46:07 +0200 <[exa]> I wonder if there's anything aeson-like for xml
2023-04-29 19:48:10 +0200 <[exa]> there's this slight inconvenience with encoding normal data structures to XML, you always have to decide if stuff should be attributes or dom and there's AFAIK no generically right™ way
2023-04-29 19:48:27 +0200 <[exa]> you might like this https://github.com/finnsson/Text.XML.Generic
2023-04-29 19:48:38 +0200 <Joao003> How to do a pointless S combinator without `ap`?
2023-04-29 19:48:52 +0200 <Helle> [exa]: I mean I need to output to a specific XML format
2023-04-29 19:49:01 +0200 <[exa]> Helle: yeah, that's the usual problem :D
2023-04-29 19:49:09 +0200 <Helle> [exa]: so just serialisation is not a great solution
2023-04-29 19:49:15 +0200 <Helle> I did find xml-hamlet which is also sure a thing (inline XML in my Haskell)
2023-04-29 19:49:34 +0200 <[exa]> Joao003: y tho? S _is_ ap by definition.
2023-04-29 19:49:53 +0200 <Joao003> Code golf, importing `ap` would waste bytes
2023-04-29 19:50:07 +0200 <[exa]> Joao003: (<*>) would do the same then
2023-04-29 19:51:07 +0200 <monochrom> If you rule out enough libraries, you can't do anything pointfree.
2023-04-29 19:51:37 +0200 <[exa]> Helle: maybe even this https://hackage.haskell.org/package/tofromxml-0.1.0.2/docs/Text-XML-ToFromXML.html
2023-04-29 19:51:39 +0200nate1(~nate@98.45.169.16)
2023-04-29 19:52:29 +0200 <[exa]> Helle: honestly if you want to make the code _nice_ I'd really suggest to quickly play with Aeson to see how folks do with JSON and then try to reapply to XML; the above library might be a good starting point
2023-04-29 19:53:10 +0200 <[exa]> Helle: the wurst part there is that you need good parsing, Aeson has tremendously useful combinators for that
2023-04-29 19:55:33 +0200 <Joao003> [exa]: Needed a flip for <*>, used =<<
2023-04-29 19:56:13 +0200 <monochrom> flip exists.
2023-04-29 19:56:13 +0200ddellacosta(~ddellacos@143.244.47.73)
2023-04-29 19:56:19 +0200 <monochrom> @type flip (<*>)
2023-04-29 19:56:21 +0200 <lambdabot> Applicative f => f a -> f (a -> b) -> f b
2023-04-29 19:56:28 +0200nate1(~nate@98.45.169.16) (Ping timeout: 254 seconds)
2023-04-29 19:56:35 +0200 <[exa]> =<< does something different no?
2023-04-29 19:56:58 +0200 <monochrom> Although I don't understand avoiding ap while embracing =<< under the reason "fewer imports".
2023-04-29 19:58:28 +0200 <Joao003> No, I needed ((flip f)<*>g), so I used f=<<g instead
2023-04-29 19:58:43 +0200 <Joao003> monochrom: Again, code golf
2023-04-29 19:58:54 +0200 <[exa]> ...also <**>
2023-04-29 19:59:17 +0200 <monochrom> Very different. But I think we went over that last time over deaf ears.
2023-04-29 20:00:04 +0200 <Helle> [exa]: right, I've got a bunch of options to consider, ty
2023-04-29 20:00:14 +0200 <[exa]> we should include a tiny APL interpreter into the Prelude so that this codegolf thing finally stops making sense :D
2023-04-29 20:00:51 +0200 <[exa]> Helle: well, as always with xml.... good luck. :D
2023-04-29 20:12:14 +0200 <fbytez> Am I able to define more than one module per file?
2023-04-29 20:13:36 +0200 <monochrom> No.
2023-04-29 20:13:53 +0200 <fbytez> OK, thanks.
2023-04-29 20:14:23 +0200 <[exa]> fbytez: it is kinda implied by the requirement that module names and file names correspond
2023-04-29 20:15:50 +0200 <fbytez> Right.
2023-04-29 20:19:10 +0200merijn(~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) (Ping timeout: 252 seconds)
2023-04-29 20:31:59 +0200user363627(~user36362@146.70.198.100)
2023-04-29 20:38:22 +0200kuttenbrunzer(~kuttenbru@2a02:8108:8b80:1d48:4e8:8ad4:7012:2253)
2023-04-29 20:41:50 +0200yaxu(~yaxu@host-78-148-247-238.as13285.net) (Quit: Leaving)
2023-04-29 20:45:14 +0200totbwf(uid402332@id-402332.uxbridge.irccloud.com) (Quit: Connection closed for inactivity)
2023-04-29 20:45:22 +0200jade[m]uploaded an image: (9KiB) < https://libera.ems.host/_matrix/media/v3/download/matrix.org/GPdPaxCveewhuGwhCCeiAhuV/image.png >
2023-04-29 20:45:23 +0200 <jade[m]> this is kind of a bummer ...
2023-04-29 20:45:41 +0200 <jade[m]> It feels like this is some pretty basic stuff that probably should work
2023-04-29 20:46:52 +0200harveypwca(~harveypwc@2601:246:c180:a570:3828:d8:e523:3f67) (Quit: Leaving)
2023-04-29 20:50:16 +0200 <yushyin> that's what I often think when I stumble upon hls
2023-04-29 20:53:19 +0200heraldo(~heraldo@user/heraldo)
2023-04-29 20:57:20 +0200robertm(robertm@lattice.rojoma.com) (Quit: ...)
2023-04-29 20:59:05 +0200Sgeo(~Sgeo@user/sgeo)
2023-04-29 20:59:10 +0200robertm(robertm@lattice.rojoma.com)
2023-04-29 21:02:39 +0200mud(~mud@user/kadoban)
2023-04-29 21:05:07 +0200 <jade[m]> wow, I just 1:1 rebuild a function from Data.List
2023-04-29 21:05:19 +0200 <Joao003> What function?
2023-04-29 21:05:32 +0200jade[m]uploaded an image: (20KiB) < https://libera.ems.host/_matrix/media/v3/download/matrix.org/VfPBEuACTzpflNIPRiGelNxe/image.png >
2023-04-29 21:05:36 +0200jade[m]uploaded an image: (26KiB) < https://libera.ems.host/_matrix/media/v3/download/matrix.org/PHObKMUrPgoYIYamNBVgJwsU/image.png >
2023-04-29 21:05:56 +0200 <jade[m]> jade[m]: this could probably be a fold
2023-04-29 21:06:16 +0200 <Joao003> Yes it could
2023-04-29 21:07:00 +0200 <c_wraith> but more to the point, it already has a name.
2023-04-29 21:07:58 +0200 <jade[m]> c_wraith: yeah, I didn't notice it existed until a second ago
2023-04-29 21:08:04 +0200 <jade[m]> now I'll use it ofc
2023-04-29 21:08:17 +0200 <Hecate> 👍
2023-04-29 21:11:20 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 240 seconds)
2023-04-29 21:11:46 +0200Sgeo(~Sgeo@user/sgeo) (Read error: Connection reset by peer)
2023-04-29 21:14:02 +0200Sgeo(~Sgeo@user/sgeo)
2023-04-29 21:14:11 +0200VernorVintage(~maxsu@24.120.138.106) (Read error: Connection reset by peer)
2023-04-29 21:14:21 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex)
2023-04-29 21:15:45 +0200Guest7455(~Guest74@95-24-68-157.broadband.corbina.ru)
2023-04-29 21:22:52 +0200zer0bitz_zer0bitz
2023-04-29 21:23:42 +0200Guest7455(~Guest74@95-24-68-157.broadband.corbina.ru) (Quit: Client closed)
2023-04-29 21:24:48 +0200heraldo(~heraldo@user/heraldo) (Ping timeout: 252 seconds)
2023-04-29 21:25:46 +0200mncheck(~mncheck@193.224.205.254)
2023-04-29 21:26:35 +0200heraldo(~heraldo@user/heraldo)
2023-04-29 21:31:33 +0200pavonia(~user@user/siracusa)
2023-04-29 21:35:00 +0200 <Joao003> Why aren't packages like extra, random and others already in base?
2023-04-29 21:36:10 +0200 <[exa]> because of the cost of maintaining a larger base
2023-04-29 21:38:30 +0200 <hpc> base and ghc are mutually dependent, neither can be updated without the other
2023-04-29 21:38:39 +0200 <hpc> so anything added to base gets similarly stuck
2023-04-29 21:40:14 +0200johnjaye(~pi@072-181-052-090.res.spectrum.com)
2023-04-29 21:42:16 +0200 <mauke> jade[m]: I feel uneasy about `n` being lazy in your function
2023-04-29 21:44:53 +0200 <jade[m]> mh
2023-04-29 21:45:02 +0200jade[m]uploaded an image: (509KiB) < https://libera.ems.host/_matrix/media/v3/download/matrix.org/VCDxlFDdEeFYOGCJBpTTaQNO/image.png >
2023-04-29 21:45:03 +0200 <jade[m]> (on a sidenote)
2023-04-29 21:46:28 +0200merijn(~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl)
2023-04-29 21:49:41 +0200mncheck(~mncheck@193.224.205.254) (Remote host closed the connection)
2023-04-29 21:50:06 +0200mncheck(~mncheck@193.224.205.254)
2023-04-29 21:51:00 +0200 <somerandomnick[m> yeah, go does not need to evaluate n to call itself
2023-04-29 21:51:28 +0200 <jade[m]> why would that be a problem?
2023-04-29 21:51:31 +0200 <somerandomnick[m> so I expect a huge thunk at the end
2023-04-29 21:51:33 +0200 <jade[m]> Thunk buildup?
2023-04-29 21:51:40 +0200 <jade[m]> mhm
2023-04-29 21:52:11 +0200 <monochrom> consider "go a (x:xs) = g (a+x) xs"
2023-04-29 21:53:11 +0200 <mauke> Just ((((((((0 + 1) + 1) + 1) + 1) + ...
2023-04-29 21:53:48 +0200michalz(~michalz@185.246.207.203)
2023-04-29 21:53:56 +0200 <jade[m]> yeah
2023-04-29 21:54:01 +0200 <jade[m]> can I just ! it?
2023-04-29 21:54:36 +0200 <mauke> yes
2023-04-29 21:54:37 +0200 <jade[m]> not that it matters, as I have replaced it with findIndex - but would it have been possible?
2023-04-29 21:55:06 +0200 <jade[m]> mauke: thanks!
2023-04-29 21:55:07 +0200 <jade[m]> I know the theoretical stuff about laziness but haven't had much practical experience
2023-04-29 21:55:25 +0200 <somerandomnick[m> catching the go 0 _ case would also work
2023-04-29 21:56:06 +0200 <mauke> heh, base cheats and just uses unboxed integers to begin with
2023-04-29 21:56:27 +0200 <somerandomnick[m> XD
2023-04-29 21:56:37 +0200 <mauke> somerandomnick[m: what do you mean?
2023-04-29 21:56:40 +0200 <somerandomnick[m> yeah bro just used an unboxed data type
2023-04-29 21:56:47 +0200hueso_(~root@user/hueso)
2023-04-29 21:57:06 +0200hueso(~root@user/hueso) (Read error: Connection reset by peer)
2023-04-29 21:57:16 +0200 <somerandomnick[m> mauke: you would catch go 0 _ _ first
2023-04-29 21:57:33 +0200 <mauke> define catch
2023-04-29 21:57:46 +0200 <somerandomnick[m> then everytime go gets called with n, n needs to be evaluated
2023-04-29 21:57:51 +0200 <somerandomnick[m> to make sure its not 0
2023-04-29 21:58:05 +0200 <mauke> ah, the oleg trick
2023-04-29 21:58:11 +0200 <somerandomnick[m> catch as in pattern guards
2023-04-29 21:58:23 +0200 <mauke> but n is definitely 0 in the first call
2023-04-29 21:58:26 +0200 <somerandomnick[m> there is already pattern guards used here
2023-04-29 21:58:46 +0200 <somerandomnick[m> it needs to be -1 then ig
2023-04-29 21:58:52 +0200hippoid(~My_user_n@user/hippoid) (Quit: WeeChat 3.8)
2023-04-29 21:58:53 +0200 <ski> go 0 _ _ | False = undefined -- or
2023-04-29 21:58:56 +0200 <mauke> go n _ _ | n `seq` False = undefined
2023-04-29 21:59:21 +0200 <mauke> majestic stereo
2023-04-29 21:59:34 +0200 <ski> like in the old days
2023-04-29 21:59:47 +0200 <mauke> https://okmij.org/ftp/Haskell/#making-function-strict
2023-04-29 22:01:01 +0200 <ski> @quote cornered
2023-04-29 22:01:01 +0200 <lambdabot> edwinb says: where does 'Oleg cornered me in a pub and explained delimited continuations to me' fit in?
2023-04-29 22:03:06 +0200 <mauke> delimited continuations are weird
2023-04-29 22:03:29 +0200 <mauke> I know what they are, but when I see them in code, it still breaks my brain
2023-04-29 22:04:54 +0200alexherbo2(~alexherbo@2a02-842a-8180-4601-85e1-23ae-ea70-6ae4.rev.sfr.net) (Remote host closed the connection)
2023-04-29 22:05:09 +0200alexherbo2(~alexherbo@2a02-842a-8180-4601-85e1-23ae-ea70-6ae4.rev.sfr.net)
2023-04-29 22:08:55 +0200alexherbo2(~alexherbo@2a02-842a-8180-4601-85e1-23ae-ea70-6ae4.rev.sfr.net) (Remote host closed the connection)
2023-04-29 22:09:09 +0200alexherbo2(~alexherbo@2a02-842a-8180-4601-85e1-23ae-ea70-6ae4.rev.sfr.net)
2023-04-29 22:16:01 +0200kuttenbrunzer(~kuttenbru@2a02:8108:8b80:1d48:4e8:8ad4:7012:2253) (Quit: Leaving)
2023-04-29 22:19:39 +0200wroathe(~wroathe@50.205.197.50)
2023-04-29 22:19:39 +0200wroathe(~wroathe@50.205.197.50) (Changing host)
2023-04-29 22:19:39 +0200wroathe(~wroathe@user/wroathe)
2023-04-29 22:20:55 +0200merijn(~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) (Ping timeout: 255 seconds)
2023-04-29 22:22:30 +0200tremon_tremon
2023-04-29 22:23:20 +0200Ristovsk-[Ristovski]
2023-04-29 22:26:16 +0200zeenk(~zeenk@2a02:2f04:a20f:5200::7fe)
2023-04-29 22:28:42 +0200heraldo(~heraldo@user/heraldo) (Quit: heraldo)
2023-04-29 22:30:50 +0200 <mauke> speaking of pretty images, https://imgur.com/a/VzpSe76
2023-04-29 22:31:28 +0200 <mauke> they're blurry because imgur resized them; the originals are smaller (but less blurry)
2023-04-29 22:32:09 +0200 <monochrom> Is that cosmic microwave background on TV? (butterfly man meme) >:)
2023-04-29 22:32:52 +0200 <mauke> all of these were generated by the same 30-lines C program
2023-04-29 22:35:06 +0200 <mauke> https://paste.tomsmeding.com/2roeQYem
2023-04-29 22:35:20 +0200 <mauke> porting it to Haskell and making it interactive is left as an exercise for the reader :-)
2023-04-29 22:35:58 +0200 <jade[m]> might actually do that in the context of my graphics thingy
2023-04-29 22:36:02 +0200 <jade[m]> seems cool
2023-04-29 22:38:34 +0200mncheck-m(~mncheck@193.224.205.254)
2023-04-29 22:40:17 +0200hueso(~root@user/hueso)
2023-04-29 22:40:36 +0200hueso_(~root@user/hueso) (Read error: Connection reset by peer)
2023-04-29 22:41:08 +0200michalz(~michalz@185.246.207.203) (*.net *.split)
2023-04-29 22:41:08 +0200mncheck(~mncheck@193.224.205.254) (*.net *.split)
2023-04-29 22:41:08 +0200Sgeo(~Sgeo@user/sgeo) (*.net *.split)
2023-04-29 22:41:08 +0200CAT_S(apic@brezn3.muc.ccc.de) (*.net *.split)
2023-04-29 22:41:08 +0200shriekingnoise(~shrieking@186.137.175.87) (*.net *.split)
2023-04-29 22:41:08 +0200micro(~micro@user/micro) (*.net *.split)
2023-04-29 22:41:08 +0200vgtw(~vgtw@user/vgtw) (*.net *.split)
2023-04-29 22:41:08 +0200Alex_test(~al_test@178.34.150.15) (*.net *.split)
2023-04-29 22:41:08 +0200AlexZenon(~alzenon@178.34.150.15) (*.net *.split)
2023-04-29 22:41:08 +0200B-J(~BenziJuni@dsl-149-64-86.hive.is) (*.net *.split)
2023-04-29 22:41:08 +0200marienz(~marienz@libera/staff/marienz) (*.net *.split)
2023-04-29 22:41:08 +0200eL_Bart0-(eL_Bart0@dietunichtguten.org) (*.net *.split)
2023-04-29 22:41:08 +0200niko(niko@libera/staff/niko) (*.net *.split)
2023-04-29 22:41:19 +0200micro(~micro@user/micro)
2023-04-29 22:41:22 +0200marienz(~marienz@libera/staff/marienz)
2023-04-29 22:41:25 +0200CAT_S(apic@brezn3.muc.ccc.de)
2023-04-29 22:41:28 +0200niko(niko@libera/staff/niko)
2023-04-29 22:41:29 +0200eL_Bart0(eL_Bart0@dietunichtguten.org)
2023-04-29 22:41:31 +0200Sgeo(~Sgeo@user/sgeo)
2023-04-29 22:42:03 +0200shriekingnoise(~shrieking@186.137.175.87)
2023-04-29 22:43:26 +0200vgtw(~vgtw@user/vgtw)
2023-04-29 22:44:03 +0200Benzi-Junior(~BenziJuni@dsl-149-64-86.hive.is)
2023-04-29 22:44:54 +0200_ht(~Thunderbi@28-52-174-82.ftth.glasoperator.nl) (Remote host closed the connection)
2023-04-29 22:45:56 +0200michalz(~michalz@185.246.207.221)
2023-04-29 22:46:33 +0200AlexZenon(~alzenon@178.34.150.15)
2023-04-29 22:46:55 +0200Alex_test(~al_test@178.34.150.15)
2023-04-29 22:58:46 +0200alexherbo2(~alexherbo@2a02-842a-8180-4601-85e1-23ae-ea70-6ae4.rev.sfr.net) (Remote host closed the connection)
2023-04-29 23:01:21 +0200alexherbo2(~alexherbo@2a02-842a-8180-4601-85e1-23ae-ea70-6ae4.rev.sfr.net)
2023-04-29 23:02:28 +0200 <Joao003> Does anyone use ($!)
2023-04-29 23:04:06 +0200 <jade[m]> might be useful to avoid a distracting seq
2023-04-29 23:05:28 +0200ec(~ec@gateway/tor-sasl/ec)
2023-04-29 23:06:07 +0200ec(~ec@gateway/tor-sasl/ec) (Client Quit)
2023-04-29 23:06:20 +0200ec(~ec@gateway/tor-sasl/ec)
2023-04-29 23:06:29 +0200 <Joao003> jade[m]: How do you say?
2023-04-29 23:10:13 +0200 <int-e> Joao003: why did you ask?
2023-04-29 23:10:26 +0200 <Joao003> Examples
2023-04-29 23:10:57 +0200kaskal(~kaskal@2001:4bb8:2cc:efb3:2d42:311d:d744:4a5) (Quit: ZNC - https://znc.in)
2023-04-29 23:11:38 +0200 <Rembane> :t ($!)
2023-04-29 23:11:39 +0200 <lambdabot> (a -> b) -> a -> b
2023-04-29 23:11:57 +0200kaskal(~kaskal@213-147-167-152.nat.highway.webapn.at)
2023-04-29 23:11:59 +0200 <Rembane> Looks pretty, gives a certain oompf to function calls.
2023-04-29 23:12:57 +0200 <int-e> @src ($!)
2023-04-29 23:12:57 +0200 <lambdabot> f $! x = x `seq` f x
2023-04-29 23:13:16 +0200 <Joao003> > (+1) $! 2
2023-04-29 23:13:18 +0200 <lambdabot> 3
2023-04-29 23:14:18 +0200 <Joao003> @src seq
2023-04-29 23:14:18 +0200 <lambdabot> Source not found. That's something I cannot allow to happen.
2023-04-29 23:14:27 +0200 <int-e> Meh, it's a bit of a special use function... especially ever since bang patterns were added to the language.
2023-04-29 23:15:17 +0200 <Joao003> > (\x -> print x >> print x) "Hi"
2023-04-29 23:15:18 +0200 <lambdabot> <IO ()>
2023-04-29 23:15:22 +0200 <Joao003> Wut
2023-04-29 23:15:29 +0200 <Joao003> % (\x -> print x >> print x) "Hi"
2023-04-29 23:15:29 +0200 <yahb2> "Hi" ; "Hi"
2023-04-29 23:15:37 +0200 <int-e> As usual with adding strictness, you do that to avoid building huge thunks. The standard example of that is probably foldl, let's take the special case of list length: length xs = go xs 0 where go [] n = n; go (x:xs) n = go xs (n+1)
2023-04-29 23:16:01 +0200 <int-e> > let length xs = go xs 0 where go [] n = n; go (x:xs) n = go xs (n+1) in length [1..1000000]
2023-04-29 23:16:04 +0200 <lambdabot> 1000000
2023-04-29 23:17:14 +0200 <Joao003> > let length = foldl (+1) 0 in length [1..1000000]
2023-04-29 23:17:15 +0200 <lambdabot> error:
2023-04-29 23:17:16 +0200 <lambdabot> • Occurs check: cannot construct the infinite type: b1 ~ a -> b1
2023-04-29 23:17:16 +0200 <lambdabot> Expected type: b1 -> a -> b1
2023-04-29 23:17:17 +0200 <int-e> looks harmless, but it turns out to use a lot of heap space and stack, because it builds a huge (...((1+1)+1)+1...)+1 expression
2023-04-29 23:17:31 +0200 <Joao003> > let length = foldr (+1) 0 in length [1..1000000]
2023-04-29 23:17:32 +0200 <lambdabot> error:
2023-04-29 23:17:33 +0200 <lambdabot> • No instance for (Num (Integer -> Integer))
2023-04-29 23:17:33 +0200 <lambdabot> arising from a use of ‘e_11011000000’
2023-04-29 23:17:39 +0200 <Joao003> > let length = foldr (1+) 0 in length [1..1000000]
2023-04-29 23:17:41 +0200 <lambdabot> error:
2023-04-29 23:17:41 +0200 <lambdabot> • No instance for (Num (Integer -> Integer))
2023-04-29 23:17:41 +0200 <lambdabot> arising from a use of ‘e_11011000000’
2023-04-29 23:17:46 +0200trev(~trev@user/trev) (Quit: trev)
2023-04-29 23:17:48 +0200 <int-e> > let length xs = go xs 0 where go [] n = n; go (x:xs) n = go xs $! (n+1) in length [1..1000000] -- this version forces the accumulator so it doesn't have that problem.
2023-04-29 23:17:50 +0200 <lambdabot> 1000000
2023-04-29 23:18:29 +0200 <int-e> Joao003: (1+) takes only one argument; it gets two, the current accumulator, and the list element. you'd have to ignore the list element.
2023-04-29 23:19:14 +0200 <Joao003> > let length = foldr (const (1+)) in length [1..1000000]
2023-04-29 23:19:17 +0200 <lambdabot> error:
2023-04-29 23:19:17 +0200 <lambdabot> • No instance for (Typeable b0)
2023-04-29 23:19:17 +0200 <lambdabot> arising from a use of ‘show_M13079378390562866788’
2023-04-29 23:19:27 +0200 <Joao003> Too huge to handle
2023-04-29 23:19:51 +0200 <Joao003> > length [1..1000000] -- Prelude
2023-04-29 23:19:51 +0200 <int-e> > foldl (flip (const (1+))) 0 [1..1000000]
2023-04-29 23:19:53 +0200 <lambdabot> 1000000
2023-04-29 23:19:54 +0200 <lambdabot> 1000000
2023-04-29 23:20:00 +0200 <int-e> > foldr (const (1+)) 0 [1..1000000]
2023-04-29 23:20:02 +0200 <lambdabot> 1000000
2023-04-29 23:20:07 +0200int-eshrugs
2023-04-29 23:21:02 +0200 <Joao003> > let length = go 0 where go n (x:xs) = go (n+1) xs; go n [] = n in length [1..1000000]
2023-04-29 23:21:04 +0200 <lambdabot> 1000000
2023-04-29 23:21:52 +0200 <int-e> The reason why $! is more of special use function is that often the argument that needs to be strict is not the final argument of the function, or you want to force several arguments.
2023-04-29 23:22:36 +0200 <int-e> So you'll notice that your version of `go` doesn't allow a natural use of $!... you'd have to write `(go $! n+1) xs` which is awkward.
2023-04-29 23:23:05 +0200 <int-e> I deliberately had the arguments swapped in my example.
2023-04-29 23:24:00 +0200 <Joao003> > let reverse = go [] where go res (x:xs) = go (x:res) xs; go res [] = res in reverse [1..10^6]
2023-04-29 23:24:02 +0200 <lambdabot> [1000000,999999,999998,999997,999996,999995,999994,999993,999992,999991,9999...
2023-04-29 23:24:11 +0200alexherbo2(~alexherbo@2a02-842a-8180-4601-85e1-23ae-ea70-6ae4.rev.sfr.net) (Remote host closed the connection)
2023-04-29 23:24:26 +0200 <int-e> > let length = go 0 where go !n (x:xs) = go (n+1) xs; go n [] = n in length "abc" -- and BangPatterns are easier in this case anyway
2023-04-29 23:24:28 +0200 <lambdabot> 3
2023-04-29 23:27:19 +0200 <Joao003> > let foldl f s = go s where go r (x:xs) = go (f r x) xs; go r [] = r in foldl (+) [1..10]
2023-04-29 23:27:21 +0200 <lambdabot> error:
2023-04-29 23:27:21 +0200 <lambdabot> • No instance for (Num [Integer]) arising from a use of ‘e_1110’
2023-04-29 23:27:21 +0200 <lambdabot> • In the expression: e_1110
2023-04-29 23:27:27 +0200 <Joao003> > let foldl f s = go s where go r (x:xs) = go (f r x) xs; go r [] = r in foldl (+) 0 [1..10]
2023-04-29 23:27:29 +0200 <lambdabot> 55
2023-04-29 23:27:59 +0200 <jean-paul[m]> If I want to write Haskell that works on large data structures in memory (specifically this - not so large structures that they can't all fit into memory) are there things I should be considering in my design that are particular to Haskell (or maybe even to GHC) _up front_ so the result will perform well? Or do I just make it right first and make it fast later? Or is it just another one of those inconvenient "it depends" questions?
2023-04-29 23:29:36 +0200michalz(~michalz@185.246.207.221) (Remote host closed the connection)
2023-04-29 23:30:44 +0200 <Rembane> jean-paul[m]: will the datastructures be retained in memory for the whole program execution or will they be replaced?
2023-04-29 23:32:57 +0200 <int-e> jean-paul[m]: I don't know. Avoid lists (except when they're really short or you benefit from laziness or you can share tails a lot... ultimately "it depends"); you can avoid quite a few excessive laziness pitfalls if you make the appropriate fields in your data structures strict.
2023-04-29 23:33:13 +0200 <Joao003> Fun fact: in the Hackage page for Prelude, there is only one occurrence of the character `%`
2023-04-29 23:35:13 +0200Batzy_Batzy
2023-04-29 23:38:38 +0200lottaquestions(~nick@2607:fa49:503f:6d00:5c2:d038:28d6:c518) (Remote host closed the connection)
2023-04-29 23:39:04 +0200alexherbo2(~alexherbo@2a02-842a-8180-4601-85e1-23ae-ea70-6ae4.rev.sfr.net)
2023-04-29 23:39:05 +0200lottaquestions(~nick@2607:fa49:503f:6d00:b69d:225e:2844:c837)
2023-04-29 23:45:52 +0200 <jade[m]> has anyone used liquid haskell and can share their experience with it?
2023-04-29 23:46:38 +0200Joao003(~Joao003@2804:840:8311:b700:e035:773e:85f2:c516) (Quit: Leaving)
2023-04-29 23:50:42 +0200dy(sid3438@user/dy) (Quit: Updating details, brb)
2023-04-29 23:50:51 +0200dy(sid3438@user/dy)
2023-04-29 23:51:53 +0200jero98772(~jero98772@2800:484:1d84:9000::2)
2023-04-29 23:53:13 +0200nate1(~nate@98.45.169.16)
2023-04-29 23:58:04 +0200nate1(~nate@98.45.169.16) (Ping timeout: 252 seconds)