Logs on 2023-01-02 (liberachat/#haskell)
| 00:00:01 | <Profpatsch> | package databases |
| 00:00:29 | <geekosaur> | yes. cabal and stack also use the same package databases, and mark as hidden the packages not exposed via build-depeds |
| 00:00:33 | <Profpatsch> | when I run ghc-pkg list, I get one version of each package |
| 00:00:50 | <Profpatsch> | So how would I every make stack break by adding a package from the package database |
| 00:01:17 | <Profpatsch> | (temporarily, in my ghci repl) |
| 00:01:23 | <geekosaur> | otherwise you could not have used -package inside ghci in a context where adding to build-depends was also a possibility |
| 00:01:47 | <geekosaur> | if that works inside ghci then it also works with ghc-options in cabal/stack |
| 00:01:58 | × | ChaiTRex quits (~ChaiTRex@user/chaitrex) (Remote host closed the connection) |
| 00:02:10 | <Profpatsch> | yes of course, but that’s just an abstraction leak |
| 00:02:58 | <Profpatsch> | now, I could see it being a problem if we had something like rust, where you can have different versions of the same package in the closure |
| 00:03:29 | <Profpatsch> | z-attoparsec-z-attoparsec-internal-0.14.4 hm |
| 00:03:34 | <geekosaur> | you can cause cabal/stack to misconpute the closure if you sneak packages in with -package instead of using build-depends |
| 00:03:52 | <geekosaur> | *miscompute |
| 00:03:57 | <Profpatsch> | why … would the compute the closure from a running ghci |
| 00:04:02 | → | ChaiTRex joins (~ChaiTRex@user/chaitrex) |
| 00:04:12 | <Profpatsch> | *they |
| 00:04:16 | <geekosaur> | we still have not communicated |
| 00:04:21 | <geekosaur> | forget I said anything |
| 00:04:33 | × | Typedfern quits (~Typedfern@60.red-83-37-32.dynamicip.rima-tde.net) (Remote host closed the connection) |
| 00:04:53 | <Profpatsch> | I said “it would be good if the message contained a hint that you can use ‘:set -package filepath’ in ghci” |
| 00:05:24 | <geekosaur> | what you said was "should be in the error message" |
| 00:05:29 | <Profpatsch> | yes |
| 00:05:37 | <Profpatsch> | It already says that you can add it to your .cabal |
| 00:05:38 | <geekosaur> | it used to be a hint that using -package was a possible solution |
| 00:05:47 | <Profpatsch> | so why shouldn’t it say that you can manually add it in ghci |
| 00:06:08 | <Profpatsch> | funnily enough, you wouldn’t see that message outside of ghci, because cabal would stop you |
| 00:06:15 | <geekosaur> | it didn't say "only in ghci", and blindly doing that in stack or cabal can break things, so they removed it |
| 00:06:25 | <Profpatsch> | well then |
| 00:07:38 | <geekosaur> | for that matter, doing it in ghci already controlled by stack ghci/cabal repl can cause ghci to pick an incompatible version, because ghci doesn't check that all dependencies are met like stack and cabal do |
| 00:07:45 | <monochrom> | Normally, if you use ghci directly, you don't need -package; if you use cabal/stack, you should let cabal/stack take over. |
| 00:08:19 | <monochrom> | You are now talking about an edge case of using cabal/stack and then going on to circumvent cabal/stack. This should not be encouraged by an "improvement" of error messages. |
| 00:08:19 | × | leah2 quits (~leah@vuxu.org) (Read error: Connection reset by peer) |
| 00:08:27 | <geekosaur> | (ghc is very stupid about this, which is a large part of the reason that cabal and stack exist) |
| 00:08:57 | <Profpatsch> | monochrom: I’m talking about the *specific* use case that happens *a lot* in day-to-day production Haskell |
| 00:09:26 | <Profpatsch> | where you have a repl open, potentially with a bunch of interpreted modules (potentially hundreds) loaded, and you just want to experiment |
| 00:09:30 | <monochrom> | Well rust is also a "dumb" plain vanilla compiler that leaves packages to cargo... |
| 00:09:37 | <Profpatsch> | but you can’t import a module because cabal stops you |
| 00:09:47 | <Profpatsch> | So |
| 00:09:56 | <Profpatsch> | - As a haskell cabal ghci user |
| 00:09:57 | → | Typedfern joins (~Typedfern@60.red-83-37-32.dynamicip.rima-tde.net) |
| 00:10:05 | <Profpatsch> | - I want to temporarily import a module to try something |
| 00:10:17 | <Profpatsch> | - without closing and repoening the repl or adjusting my .cabal file |
| 00:10:29 | <Profpatsch> | This is not an edge case |
| 00:10:34 | <Profpatsch> | it’s something that happens all the time |
| 00:10:55 | <Profpatsch> | Maybe in the nice technical implementation-detail view of things it’s an edge case |
| 00:11:18 | <monochrom> | No, you began by refusing to add a dependency in *.cabal. There is no conflict between "I'm experiementing" and "I add a dependency in *.cabal". |
| 00:11:41 | <Profpatsch> | monochrom: yes, there is a difference of a few minutes |
| 00:11:55 | <Profpatsch> | reloading a `cabal repl` can take minutes on big repos |
| 00:12:18 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:bccb:1151:f053:cd4c) |
| 00:13:41 | <geekosaur> | again, trusting -package is unsafe because ghci will happily pick an incompatible version |
| 00:13:58 | <geekosaur> | cabal and stack *exist* to force ghc to do the right thing |
| 00:15:15 | <Profpatsch> | It’s so silly that Haskellers argue on the level of “noooo, you have to add this line to the file and wait for a minute do do $simpleThing because that’s how things areee”, while Visual Studio is over there and allows hot-reload of C++ code while the executable is running https://www.youtube.com/watch?v=x_gr6DNrJuM |
| 00:15:43 | <c_wraith> | I've written Haskell that allows hot-reload of C++ while the executable is running |
| 00:15:48 | <c_wraith> | It's no big deal |
| 00:15:57 | <c_wraith> | As long as you give it a sane environment to work in |
| 00:16:13 | <c_wraith> | Which is what Visual Studio spends a lot of time doing. |
| 00:16:27 | <Profpatsch> | yep, sane environment, so the opposite of cabal :) |
| 00:16:36 | <dminuoso> | Profpatsch: It's not really silly, it's merely a matter of industry funding. Meta has hot code reload for Haskell. |
| 00:17:05 | <geekosaur> | you try going back to pre-cabal days and then tell me about sane environments |
| 00:17:26 | <dminuoso> | But it's relatively adhoc and special purposed, and they happen to have Simon Marlow on payroll. |
| 00:17:41 | <geekosaur> | hell, even cabal v1 days which were roughly like what you appear to want (and are why stack exists, not to say cabal v2) |
| 00:18:18 | <Profpatsch> | geekosaur: nobody is talking about randomly installing things mutably into a ghc package database |
| 00:18:22 | <c_wraith> | Have you ever tried to run msvc *without* Visual Studio? sane environment? It's never heard of one. |
| 00:18:56 | <dminuoso> | It's not really fair to compare especially something like visual studio to Haskell, when the former is the commercial product of a billion dollar tech giant that has dozens of engineers working full time on the product.. *shrugs* |
| 00:19:47 | <Profpatsch> | well, I guess #haskell is not the place to talk about the future of things then |
| 00:20:45 | <Profpatsch> | I happen to have a nice setup here, but that happen by being “adhoc”, i.e. making decisions on environment and use-cases |
| 00:21:33 | × | Typedfern quits (~Typedfern@60.red-83-37-32.dynamicip.rima-tde.net) (Remote host closed the connection) |
| 00:21:37 | <c_wraith> | so your point is no one has sunk hundreds of programmer-years into a Haskell IDE that just decides those things for you? |
| 00:22:57 | <c_wraith> | heck, I wouldn't be surprised if Visual Studio was at tens of thousands of programmer years. |
| 00:22:59 | <Profpatsch> | c_wraith: I spent about 50–100 hours on it, and I’m at a point where I can support a sub 50k LoC project. I’m pretty sure we are gonna hit a wall at 50–100k, but hls & vscode *is* that IDE |
| 00:23:37 | <Profpatsch> | Putting everything into one cabal package, because the cross-package workflow breaks down most of the UX |
| 00:25:04 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 00:25:10 | <Profpatsch> | We tried splitting some things into cabal packages, but the resulting overhead & breakage is not worth the friction |
| 00:25:11 | <dminuoso> | And to be fair, comparing the long replanning and rebuild process with MSVC that doesnt even have a notion of build plans is a strange thing to do. |
| 00:25:46 | <dminuoso> | There's a certain degree of orthogonality here |
| 00:25:50 | <Profpatsch> | In particular, one “adhoc” decision is to use stackage as the base |
| 00:26:18 | <c_wraith> | as opposed to VS, which just tells you "find it somewhere"? |
| 00:27:00 | <sclv> | i’m not sure what the actual proposal here is |
| 00:27:05 | → | leah2 joins (~leah@vuxu.org) |
| 00:28:12 | <dminuoso> | But yes, if you are in a situation where you have lots of packages in a sort of mono-repo, there is a bunch of UX problems. Are they solvable in principle? Sure, donate money or engineering time to cabal. |
| 00:29:11 | <Profpatsch> | sclv: I triggered a bunch of people by saying “it should probably be mentioned that you can un-hide a package in ghci by running a command” |
| 00:29:31 | <Profpatsch> | There was no proposal, just the assertion that it’s absolutely impossible to improve the status quo |
| 00:29:40 | <sclv> | is the proposal just that one change the ghci message? |
| 00:29:43 | <Profpatsch> | yes |
| 00:29:52 | <Profpatsch> | I don’t even care what produces the message |
| 00:30:12 | <Profpatsch> | If ghci parses the message & adds its own line, I’d be fine with that |
| 00:30:20 | × | acidjnk quits (~acidjnk@p200300d6e7137a577d241e14a75b8650.dip0.t-ipconnect.de) (Ping timeout: 246 seconds) |
| 00:30:44 | <sclv> | that seems reasonable. i don't think that solves the bigger issue you're gesturing at, which does seem _very_ hard |
| 00:31:12 | <Profpatsch> | I feel like many problems can be solved by agreeing that they don’t need solving :) |
| 00:32:13 | × | mizlan quits (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 260 seconds) |
| 00:34:02 | ← | nft_slut parts (~user@50-110-204-205.mrbg.wv.frontiernet.net) (ERC 5.4 (IRC client for GNU Emacs 28.2)) |
| 00:34:12 | → | mizlan joins (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) |
| 00:35:34 | <dminuoso> | Whats the right way to expose a C macro from a C standard library header into a Haskell binding? |
| 00:36:22 | × | talismanick quits (~talismani@76.133.152.122) (Ping timeout: 272 seconds) |
| 00:37:36 | <monochrom> | foreign import capi ... |
| 00:37:47 | <monochrom> | so, capi instead of ccall |
| 00:38:58 | <dminuoso> | monochrom: Ah, that looks spot on. Thanks, I did not know about this extension. |
| 00:39:08 | <monochrom> | Ah you have to add {-# language CApiFFI #-} too. |
| 00:39:25 | <monochrom> | https://downloads.haskell.org/~ghc/9.2.5/docs/html/users_guide/exts/ffi.html?highlight=capi#extension-CApiFFI has an example |
| 00:39:33 | <dminuoso> | Got it, cheers |
| 00:40:22 | <geekosaur> | https://downloads.haskell.org/ghc/9.4.1/docs/users_guide/exts/ffi.html#the-capi-calling-convention |
| 00:40:31 | <geekosaur> | oh, I'm slow, sorry |
| 00:49:43 | × | freeside quits (~mengwong@103.252.202.159) (Ping timeout: 260 seconds) |
| 01:03:11 | → | freeside joins (~mengwong@103.252.202.159) |
| 01:03:56 | × | ChaiTRex quits (~ChaiTRex@user/chaitrex) (Ping timeout: 255 seconds) |
| 01:05:31 | → | v0id_ptr joins (~adrift@user/ptr-frac7al/x-0038398) |
| 01:07:00 | → | meinside joins (uid24933@id-24933.helmsley.irccloud.com) |
| 01:07:24 | × | beteigeuze quits (~Thunderbi@bl14-81-220.dsl.telepac.pt) (Ping timeout: 268 seconds) |
| 01:09:54 | × | freeside quits (~mengwong@103.252.202.159) (Ping timeout: 260 seconds) |
| 01:10:12 | × | albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection) |
| 01:16:19 | → | albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8) |
| 01:16:51 | → | ChaiTRex joins (~ChaiTRex@user/chaitrex) |
| 01:23:51 | → | freeside joins (~mengwong@103.252.202.159) |
| 01:26:25 | → | razetime joins (~Thunderbi@49.207.194.134) |
| 01:28:45 | → | bgs joins (~bgs@212-85-160-171.dynamic.telemach.net) |
| 01:41:19 | × | mizlan quits (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 268 seconds) |
| 01:41:36 | × | freeside quits (~mengwong@103.252.202.159) (Ping timeout: 272 seconds) |
| 01:43:09 | × | gurkenglas quits (~gurkengla@p548ac72e.dip0.t-ipconnect.de) (Ping timeout: 260 seconds) |
| 01:47:26 | → | Everything joins (~Everythin@46.185.124.170) |
| 01:51:53 | → | mizlan joins (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) |
| 01:54:28 | → | freeside joins (~mengwong@103.252.202.159) |
| 02:04:43 | × | hyperbolic-dg quits (~quassel@i577AA562.versanet.de) (Remote host closed the connection) |
| 02:19:06 | → | ddellacosta joins (~ddellacos@143.244.47.68) |
| 02:36:02 | → | Guest4496 joins (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) |
| 02:36:21 | → | arguapacha joins (~arguapach@bras-base-mtrlpq02hsy-grc-10-76-68-190-46.dsl.bell.ca) |
| 02:39:19 | × | tremon quits (~tremon@83-85-213-108.cable.dynamic.v4.ziggo.nl) (Quit: getting boxed in) |
| 02:41:46 | × | Guest4496 quits (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 272 seconds) |
| 02:43:20 | × | arguapacha quits (~arguapach@bras-base-mtrlpq02hsy-grc-10-76-68-190-46.dsl.bell.ca) (Quit: Client closed) |
| 02:43:30 | → | haris_ joins (~haris@45.32.196.242) |
| 02:44:17 | × | thongpv87 quits (~thongpv87@2402:9d80:3e6:e30e:d1ec:9bf2:ae21:f5c4) (Read error: Connection reset by peer) |
| 02:45:51 | → | thongpv87 joins (~thongpv87@14.246.240.163) |
| 02:47:59 | × | emmanuelux quits (~emmanuelu@user/emmanuelux) (Quit: au revoir) |
| 02:49:26 | × | hgolden quits (~hgolden@cpe-172-251-233-141.socal.res.rr.com) (Remote host closed the connection) |
| 02:50:35 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds) |
| 02:51:10 | × | freeside quits (~mengwong@103.252.202.159) (Ping timeout: 260 seconds) |
| 02:51:19 | × | justsomeguy quits (~justsomeg@user/justsomeguy) (Ping timeout: 265 seconds) |
| 02:53:59 | → | hgolden joins (~hgolden@cpe-172-251-233-141.socal.res.rr.com) |
| 03:01:21 | × | waleee quits (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Ping timeout: 256 seconds) |
| 03:05:54 | → | finn_elija joins (~finn_elij@user/finn-elija/x-0085643) |
| 03:05:54 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija))) |
| 03:05:54 | finn_elija | is now known as FinnElija |
| 03:06:51 | × | xff0x quits (~xff0x@2405:6580:b080:900:18f:39b6:7457:a86b) (Ping timeout: 248 seconds) |
| 03:11:12 | → | nasrudin__ joins (~nasrudin_@ip68-101-166-83.sd.sd.cox.net) |
| 03:12:01 | × | nasrudin__ quits (~nasrudin_@ip68-101-166-83.sd.sd.cox.net) (Client Quit) |
| 03:12:16 | → | nasrudin__ joins (~nasrudin_@ip68-101-166-83.sd.sd.cox.net) |
| 03:14:51 | × | nasrudin__ quits (~nasrudin_@ip68-101-166-83.sd.sd.cox.net) (Client Quit) |
| 03:15:36 | → | nasrudin__ joins (~nasrudin_@ip68-101-166-83.sd.sd.cox.net) |
| 03:15:40 | × | td_ quits (~td@83.135.9.35) (Ping timeout: 260 seconds) |
| 03:16:21 | → | freeside joins (~mengwong@103.252.202.159) |
| 03:17:03 | <nasrudin__> | asdii |
| 03:17:08 | → | td_ joins (~td@83.135.9.63) |
| 03:23:15 | × | Kaiepi quits (~Kaiepi@nwcsnbsc03w-47-55-159-86.dhcp-dynamic.fibreop.nb.bellaliant.net) (Ping timeout: 260 seconds) |
| 03:37:15 | × | freeside quits (~mengwong@103.252.202.159) (Ping timeout: 268 seconds) |
| 03:48:58 | × | mzan quits (~quassel@mail.asterisell.com) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
| 03:49:57 | → | mzan joins (~quassel@mail.asterisell.com) |
| 03:55:28 | → | Kaiepi joins (~Kaiepi@nwcsnbsc03w-47-55-159-86.dhcp-dynamic.fibreop.nb.bellaliant.net) |
| 04:04:40 | × | mizlan quits (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 260 seconds) |
| 04:06:57 | × | werneta quits (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Quit: Lost terminal) |
| 04:08:05 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Quit: = "") |
| 04:10:33 | × | ddellacosta quits (~ddellacos@143.244.47.68) (Ping timeout: 268 seconds) |
| 04:10:48 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 04:15:07 | → | werneta joins (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) |
| 04:21:51 | → | igghibu joins (~igghibu@37.120.201.86) |
| 04:23:19 | → | morb joins (~morb@pool-72-80-94-112.nycmny.fios.verizon.net) |
| 04:52:21 | → | alexiscott joins (~user@97.red-83-36-47.dynamicip.rima-tde.net) |
| 04:55:04 | × | cheater quits (~Username@user/cheater) (Read error: Connection reset by peer) |
| 04:55:50 | → | cheater joins (~Username@user/cheater) |
| 05:00:54 | × | razetime quits (~Thunderbi@49.207.194.134) (Read error: Connection reset by peer) |
| 05:02:41 | × | thongpv87 quits (~thongpv87@14.246.240.163) (Ping timeout: 246 seconds) |
| 05:03:36 | → | razetime joins (~Thunderbi@49.207.194.134) |
| 05:04:05 | → | mizlan joins (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) |
| 05:06:03 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 268 seconds) |
| 05:09:47 | → | sympt9 joins (~sympt@user/sympt) |
| 05:10:18 | → | beefbambi joins (~beefbambi@183.82.25.141) |
| 05:10:28 | × | sympt quits (~sympt@user/sympt) (Ping timeout: 260 seconds) |
| 05:10:29 | sympt9 | is now known as sympt |
| 05:11:19 | × | morb quits (~morb@pool-72-80-94-112.nycmny.fios.verizon.net) (Remote host closed the connection) |
| 05:14:05 | → | sympt5 joins (~sympt@user/sympt) |
| 05:15:19 | × | sympt quits (~sympt@user/sympt) (Ping timeout: 268 seconds) |
| 05:15:19 | sympt5 | is now known as sympt |
| 05:15:39 | → | mbuf joins (~Shakthi@49.205.86.73) |
| 05:22:08 | × | beefbambi quits (~beefbambi@183.82.25.141) (Read error: Connection reset by peer) |
| 05:22:46 | → | beefbambi joins (~beefbambi@2401:4900:230d:f57c:538c:d7cc:50c0:e377) |
| 05:23:16 | × | beefbambi quits (~beefbambi@2401:4900:230d:f57c:538c:d7cc:50c0:e377) (Read error: Connection reset by peer) |
| 05:23:33 | → | beefbambi joins (~beefbambi@183.82.25.141) |
| 05:26:35 | × | beefbambi quits (~beefbambi@183.82.25.141) (Read error: Connection reset by peer) |
| 05:27:18 | → | beefbambi joins (~beefbambi@183.82.25.141) |
| 05:29:21 | → | Blightmain joins (~Blightmai@203.29.154.219) |
| 05:34:35 | × | alexiscott quits (~user@97.red-83-36-47.dynamicip.rima-tde.net) (Ping timeout: 248 seconds) |
| 05:36:14 | → | cameron_ joins (~quassel@050-089-109-059.res.spectrum.com) |
| 05:40:35 | × | beefbambi quits (~beefbambi@183.82.25.141) (Ping timeout: 256 seconds) |
| 05:42:24 | → | beefbambi joins (~beefbambi@2401:4900:230d:f57c:538c:d7cc:50c0:e377) |
| 05:43:30 | <cameron_> | i just wrote my first line of haskell and reading into this i have to say its blowing my mind |
| 05:44:13 | <Blightmain> | Enjoy the journey :) |
| 05:45:24 | × | ix quits (~ix@2a02:8010:674f:0:d65d:64ff:fe52:5efe) (Quit: WeeChat 3.7.1) |
| 05:47:32 | → | ix joins (~ix@2a02:8010:674f:0:d65d:64ff:fe52:5efe) |
| 05:47:55 | <razetime> | cameron_: it only gets more fun from here :) |
| 05:48:32 | <cameron_> | i feel like this is how i speak english to my computer |
| 05:48:47 | <zzz> | "fun" |
| 05:49:03 | <zzz> | https://dwarffortresswiki.org/index.php?title=DF2014:Fun&redirect=no |
| 05:49:23 | → | qy joins (~ix@2a02:8010:674f:0:d65d:64ff:fe52:5efe) |
| 05:49:24 | <cameron_> | dont worry i am very familiar with the concept of fun |
| 05:49:59 | × | v0id_ptr quits (~adrift@user/ptr-frac7al/x-0038398) (Ping timeout: 264 seconds) |
| 05:50:08 | <Blightmain> | In other languages like java/c# you are able to load a file once at app startup and reference the contents of that file for the lifetime of the app. For example, reading configuration from a file. Is there something similar in haskell? What im trying to do is read db connection string from my config file. |
| 05:50:23 | <cameron_> | the immediate dwarf fortress reference tells me im in the right place |
| 05:51:32 | <zzz> | cameron_: you'll enjoy this then :) https://github.com/swarm-game/swarm |
| 05:52:35 | × | ix quits (~ix@2a02:8010:674f:0:d65d:64ff:fe52:5efe) (Ping timeout: 260 seconds) |
| 05:52:45 | → | alexiscott joins (~user@97.red-83-36-47.dynamicip.rima-tde.net) |
| 05:53:01 | <zzz> | Blightmain: https://hackage.haskell.org/package/base-4.17.0.0/docs/Prelude.html#v:readFile ? |
| 05:54:54 | <cameron_> | zzz thank you ive always enjoyed games where you get to script stuff |
| 05:55:22 | × | razetime quits (~Thunderbi@49.207.194.134) (Quit: razetime) |
| 05:55:23 | → | titibandit joins (~titibandi@xdsl-89-0-163-79.nc.de) |
| 05:55:39 | <Blightmain> | Are you able to bind the contents of a file using readFile to some object and reference that instead of doing an IO operation to the disk everytime I need the contents? |
| 05:55:53 | → | razetime joins (~Thunderbi@49.207.194.134) |
| 05:56:12 | <zzz> | Blightmain: what do you mean "doing an IO operation to the disk everytime"? |
| 05:56:36 | <razetime> | i assume they want stream I/O? |
| 05:58:00 | <Blightmain> | For example, in other languages I can have some object called MyConfig and at application startup I would bind the file contents to that object and add that MyConfig object as a singleton which can be referenced instead of reading the file everytime I need to access its contents. |
| 05:58:26 | <monochrom> | If you call readFile only once, the file is read at most once. |
| 05:58:46 | <EvanR> | Blightmain, the most straightforward way to do this is read the file once at the beginning, then provide the results to whatever needs it (perhaps after processing it into a sane format) |
| 05:59:13 | <EvanR> | like, passing it in as a function argument |
| 06:00:20 | <EvanR> | there are other shenanigans to achieve the same thing but try this method first to compare against |
| 06:00:24 | <zzz> | maybe some examplke code would help |
| 06:01:41 | <razetime> | worth looking at https://wiki.haskell.org/Global_variables, maybe. |
| 06:02:43 | <Blightmain> | Ill give you my exact scenario. I have an API I made with servant that connects to postgres and I have my connecionstring stored in a config file. I assume that everytime I call my endpoint I will read the contents of the file to get the connectionstring. Is there some way to have that config bound to some type that persists across requests so I don't have to constantly read the file for every request? |
| 06:02:44 | <zzz> | that first sentence in the Answer :p |
| 06:04:26 | <Blightmain> | This is my code: https://github.com/PhilG112/ToDoApp/blob/master/ToDoApp.Api/src/Config/ConfigUtil.hs |
| 06:04:30 | <zzz> | Blightmain: are you familiar with passing state around? |
| 06:04:47 | <Blightmain> | In haskell not really still very new to it |
| 06:06:42 | × | haris_ quits (~haris@45.32.196.242) (Remote host closed the connection) |
| 06:07:33 | → | talismanick joins (~talismani@76.133.152.122) |
| 06:08:19 | <talismanick> | Is there a modern alternative to the "auto" library? (arrowized automata for wiring state machines together) |
| 06:09:33 | <zzz> | Blightmain: so the idea is to get the contents of the file once, and then pass it around to any functions that will need it |
| 06:12:21 | <Blightmain> | Exactly! Get the contents once at app startup then pass it around for the lifetime of my application. Sorry if its confusing I come from a c# background so im probbably making some assumptions I shouldn't |
| 06:12:54 | <zzz> | Blightmain: i would advise you to study on the State monad, which can be useful |
| 06:13:18 | <zzz> | but in principle, what you want is this: |
| 06:14:29 | <zzz> | imagine you have some function `someFunction :: a -> b` and you want it to perform some action that depends on something in the config file |
| 06:14:47 | <zzz> | you can turn it into `someFunction :: Config -> a -> b` |
| 06:14:53 | <zzz> | and pass it the config |
| 06:14:53 | <talismanick> | Arrows in generally seem underused |
| 06:15:11 | <talismanick> | Any reasons beside unfamiliarity? |
| 06:16:59 | <razetime> | what are arrowized automata? |
| 06:17:06 | × | nasrudin__ quits (~nasrudin_@ip68-101-166-83.sd.sd.cox.net) (Ping timeout: 272 seconds) |
| 06:17:30 | <EvanR> | wait wait... this is not "state" because you aren't changing the state |
| 06:17:59 | <EvanR> | you *read* the file once, and use the contents over and over (without updating it, in this case usually requiring a restart) |
| 06:18:50 | <EvanR> | Arrows exploded onto the scene and then the good parts were extracted into profunctors and related classes |
| 06:20:14 | <talismanick> | EvanR: ...what were the bad parts? |
| 06:20:17 | × | ChaiTRex quits (~ChaiTRex@user/chaitrex) (Ping timeout: 255 seconds) |
| 06:20:44 | <EvanR> | there is 1 method which makes it "a symmetric monoid category plus something" |
| 06:20:51 | <EvanR> | monoidal* |
| 06:22:17 | <EvanR> | arr :: Arrow a => (b -> c) -> a b c |
| 06:22:28 | → | ChaiTRex joins (~ChaiTRex@user/chaitrex) |
| 06:22:32 | <talismanick> | EvanR: Symmetric monoidal category? |
| 06:22:39 | <EvanR> | yeah |
| 06:23:05 | <talismanick> | That makes sense, since each produces a unique output which must be consumed once\ |
| 06:23:07 | × | alexiscott quits (~user@97.red-83-36-47.dynamicip.rima-tde.net) (Ping timeout: 252 seconds) |
| 06:23:22 | <talismanick> | (hence dataflow diagram interpretation) |
| 06:23:44 | <EvanR> | if you want a symmetric monoidal category, then you might not be able to implement arr. If you want the rest of Arrow, you might just want profunctor |
| 06:23:45 | × | foul_owl quits (~kerry@157.97.134.156) (Ping timeout: 268 seconds) |
| 06:24:09 | <EvanR> | er, if you have arr, you might want profunctor |
| 06:24:35 | <talismanick> | Lenses have something to do with profunctors, right? |
| 06:24:55 | <EvanR> | profunctor optics is a thing, which includes lenses |
| 06:26:26 | <talismanick> | Are profunctors related to prosets? (preordered sets) |
| 06:26:44 | <talismanick> | (posets where isomorphism = identity) |
| 06:27:19 | → | haris joins (~haris@201.141.112.122) |
| 06:27:21 | → | foul_owl joins (~kerry@157.97.134.156) |
| 06:27:23 | <talismanick> | err, isomorphism is equality |
| 06:27:56 | <EvanR> | I don't know. I skipped straight to profunctor = a type which is a covariant functor in one parameter and contravariant in the other |
| 06:28:14 | <talismanick> | Okay, that makes sense |
| 06:28:15 | <EvanR> | e.g. (->) |
| 06:30:22 | → | thongpv87 joins (~thongpv87@14.246.240.163) |
| 06:33:59 | → | johnw joins (~johnw@2600:1700:cf00:db0:bccc:cdbd:ef47:1293) |
| 06:47:52 | × | razetime quits (~Thunderbi@49.207.194.134) (Remote host closed the connection) |
| 06:52:33 | × | mizlan quits (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 260 seconds) |
| 06:56:58 | → | v0id_ptr joins (~adrift@user/ptr-frac7al/x-0038398) |
| 06:58:21 | × | Unicorn_Princess quits (~Unicorn_P@user/Unicorn-Princess/x-3540542) (Quit: Leaving) |
| 07:01:29 | → | mizlan joins (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) |
| 07:02:04 | × | cheater quits (~Username@user/cheater) (Ping timeout: 272 seconds) |
| 07:02:05 | → | cheater_ joins (~Username@user/cheater) |
| 07:02:05 | cheater_ | is now known as cheater |
| 07:06:09 | × | mizlan quits (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 256 seconds) |
| 07:06:09 | <talismanick> | EvanR: So, is there an equivalent of the auto library, but with profunctors instead of arrows? |
| 07:11:10 | → | mizlan joins (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) |
| 07:11:14 | × | Everything quits (~Everythin@46.185.124.170) (Ping timeout: 268 seconds) |
| 07:13:48 | × | Blightmain quits (~Blightmai@203.29.154.219) (Remote host closed the connection) |
| 07:16:11 | × | Kaiepi quits (~Kaiepi@nwcsnbsc03w-47-55-159-86.dhcp-dynamic.fibreop.nb.bellaliant.net) (Ping timeout: 265 seconds) |
| 07:22:17 | → | kenran joins (~user@user/kenran) |
| 07:22:41 | × | kenran quits (~user@user/kenran) (Remote host closed the connection) |
| 07:26:36 | × | werneta quits (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Remote host closed the connection) |
| 07:35:38 | × | kritzefitz quits (~kritzefit@debian/kritzefitz) (Ping timeout: 272 seconds) |
| 07:36:54 | → | kritzefitz joins (~kritzefit@debian/kritzefitz) |
| 07:37:27 | → | werneta joins (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) |
| 07:40:18 | → | lortabac joins (~lortabac@2a01:e0a:541:b8f0:83e4:99f0:e8cd:3cd7) |
| 07:42:17 | → | thongpv joins (~thongpv87@2001:ee0:54ae:c1f0:424b:c9a9:5031:b9c4) |
| 07:43:59 | × | thongpv87 quits (~thongpv87@14.246.240.163) (Ping timeout: 264 seconds) |
| 07:52:39 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 07:55:01 | × | mizlan quits (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 268 seconds) |
| 08:01:38 | × | cameron_ quits (~quassel@050-089-109-059.res.spectrum.com) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
| 08:08:29 | → | mizlan joins (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) |
| 08:09:44 | → | freeside joins (~mengwong@122.11.214.90) |
| 08:15:53 | × | freeside quits (~mengwong@122.11.214.90) (Ping timeout: 246 seconds) |
| 08:19:26 | × | perrierjouet quits (~perrier-j@modemcable048.127-56-74.mc.videotron.ca) (Quit: WeeChat 3.7.1) |
| 08:21:20 | × | v0id_ptr quits (~adrift@user/ptr-frac7al/x-0038398) (Ping timeout: 260 seconds) |
| 08:21:58 | → | coot joins (~coot@213.134.171.3) |
| 08:22:41 | × | coot quits (~coot@213.134.171.3) (Remote host closed the connection) |
| 08:23:07 | → | avicenzi joins (~avicenzi@2a00:ca8:a1f:b004::c32) |
| 08:25:16 | → | coot joins (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) |
| 08:32:28 | → | perrierjouet joins (~perrier-j@modemcable048.127-56-74.mc.videotron.ca) |
| 08:32:54 | → | Guest4496 joins (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) |
| 08:36:50 | × | thongpv quits (~thongpv87@2001:ee0:54ae:c1f0:424b:c9a9:5031:b9c4) (Ping timeout: 246 seconds) |
| 08:38:01 | × | coot quits (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot) |
| 08:39:39 | → | takuan joins (~takuan@178-116-218-225.access.telenet.be) |
| 08:46:31 | → | acidjnk joins (~acidjnk@p200300d6e7137a57e4469cf2ea7b5c7c.dip0.t-ipconnect.de) |
| 08:51:34 | → | fserucas joins (~fserucas@2001:818:e376:a400:fb92:70c1:dd88:c7d7) |
| 08:56:04 | × | Guest4496 quits (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 272 seconds) |
| 08:58:00 | → | coot joins (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) |
| 08:59:42 | × | chiselfuse quits (~chiselfus@user/chiselfuse) (Remote host closed the connection) |
| 09:00:15 | → | chiselfuse joins (~chiselfus@user/chiselfuse) |
| 09:02:08 | → | fserucas_ joins (~fserucas@2001:818:e376:a400:fb92:70c1:dd88:c7d7) |
| 09:06:19 | → | cheater_ joins (~Username@user/cheater) |
| 09:06:39 | × | mei quits (~mei@user/mei) (Ping timeout: 252 seconds) |
| 09:09:30 | → | nschoe joins (~q@141.101.51.197) |
| 09:09:41 | × | cheater quits (~Username@user/cheater) (Ping timeout: 256 seconds) |
| 09:09:45 | cheater_ | is now known as cheater |
| 09:10:21 | × | titibandit quits (~titibandi@xdsl-89-0-163-79.nc.de) (Remote host closed the connection) |
| 09:10:48 | × | mizlan quits (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 260 seconds) |
| 09:11:54 | × | foul_owl quits (~kerry@157.97.134.156) (Ping timeout: 272 seconds) |
| 09:16:28 | × | werneta quits (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 252 seconds) |
| 09:16:49 | → | razetime joins (~Thunderbi@49.207.194.134) |
| 09:18:19 | → | werneta joins (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) |
| 09:19:19 | → | freeside joins (~mengwong@103.252.202.159) |
| 09:25:38 | → | foul_owl joins (~kerry@157.97.134.61) |
| 09:27:44 | → | gnalzo joins (~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c) |
| 09:31:40 | × | econo quits (uid147250@user/econo) (Quit: Connection closed for inactivity) |
| 09:33:21 | → | mizlan joins (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) |
| 09:35:41 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:bccb:1151:f053:cd4c) (Remote host closed the connection) |
| 09:37:38 | × | mizlan quits (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 260 seconds) |
| 09:38:04 | × | igghibu quits (~igghibu@37.120.201.86) (Quit: igghibu) |
| 09:42:33 | × | haris quits (~haris@201.141.112.122) (Remote host closed the connection) |
| 09:50:03 | × | Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer) |
| 09:51:28 | → | mizlan joins (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) |
| 10:01:58 | → | thongpv joins (~thongpv87@2001:ee0:54ae:c1f0:c80b:7720:68f2:6f18) |
| 10:04:27 | → | CiaoSen joins (~Jura@p200300c9571bac002a3a4dfffe84dbd5.dip0.t-ipconnect.de) |
| 10:08:08 | → | boxscape_ joins (~boxscape_@213.52.37.155) |
| 10:08:46 | <boxscape_> | what is the github repo with ghc+other tools' error numbers/codes again? I can't find it |
| 10:09:20 | <boxscape_> | ...I say, as I find it |
| 10:09:28 | <boxscape_> | https://github.com/haskellfoundation/error-message-index |
| 10:10:58 | <boxscape_> | or, better, https://errors.haskell.org/ |
| 10:13:21 | → | kuribas joins (~user@ptr-17d51ema74fu5i8lm5c.18120a2.ip6.access.telenet.be) |
| 10:14:43 | <[exa]> | [rubber duck voice:] you're welcome boxscape_! |
| 10:14:51 | <boxscape_> | :D thanks |
| 10:15:18 | → | VY2 joins (~user@213.24.126.94) |
| 10:18:27 | × | cheater quits (~Username@user/cheater) (Quit: Going offline, see ya! (www.adiirc.com)) |
| 10:21:09 | × | thongpv quits (~thongpv87@2001:ee0:54ae:c1f0:c80b:7720:68f2:6f18) (Remote host closed the connection) |
| 10:22:06 | → | thongpv joins (~thongpv87@14.246.240.163) |
| 10:22:24 | → | cheater joins (~Username@user/cheater) |
| 10:28:14 | → | mechap joins (~mechap@148.163.20.109.rev.sfr.net) |
| 10:32:44 | × | tzh quits (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) (Quit: zzz) |
| 10:33:47 | × | Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 264 seconds) |
| 10:33:49 | → | Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915) |
| 10:35:05 | Lord_of_Life_ | is now known as Lord_of_Life |
| 10:36:10 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:bccb:1151:f053:cd4c) |
| 10:40:45 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:bccb:1151:f053:cd4c) (Ping timeout: 260 seconds) |
| 10:44:32 | → | Lycurgus joins (~juan@user/Lycurgus) |
| 10:47:22 | → | xff0x joins (~xff0x@p3326132-ipngn2103sapodori.hokkaido.ocn.ne.jp) |
| 10:48:21 | × | noteness quits (~noteness@user/noteness) (Quit: bye) |
| 10:53:35 | × | mizlan quits (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 264 seconds) |
| 10:55:05 | × | Lycurgus quits (~juan@user/Lycurgus) (Quit: Exeunt: personae.ai-integration.biz) |
| 10:56:24 | × | mbuf quits (~Shakthi@49.205.86.73) (Ping timeout: 272 seconds) |
| 10:57:26 | <eldritchcookie[4> | is there any useful way to work with parameterized monadic continuations which return monadic continuations? |
| 10:58:24 | <eldritchcookie[4> | basically i have a (a -> r1) -> ContMT m o r2 b |
| 10:58:33 | <mauke> | that's too oleg for me |
| 10:58:46 | <eldritchcookie[4> | what does that mean? |
| 10:58:49 | <mauke> | @where oleg |
| 10:58:49 | <lambdabot> | http://okmij.org/ftp/ |
| 10:59:54 | <eldritchcookie[4> | cool |
| 11:01:11 | <eldritchcookie[4> | but i already saw some of that site |
| 11:02:23 | <eldritchcookie[4> | i will look into delimited continuations so that will be useful but for now i am just trying to invert control |
| 11:03:06 | × | xff0x quits (~xff0x@p3326132-ipngn2103sapodori.hokkaido.ocn.ne.jp) (Ping timeout: 268 seconds) |
| 11:03:49 | × | mechap quits (~mechap@148.163.20.109.rev.sfr.net) (Changing host) |
| 11:03:49 | → | mechap joins (~mechap@user/mechap) |
| 11:04:53 | <eldritchcookie[4> | basically i want to turn a function like bracket into two ContT IO a |
| 11:06:31 | × | boxscape_ quits (~boxscape_@213.52.37.155) (Ping timeout: 252 seconds) |
| 11:06:49 | → | noteness joins (~noteness@user/noteness) |
| 11:08:02 | × | jmdaemon quits (~jmdaemon@user/jmdaemon) (Ping timeout: 246 seconds) |
| 11:10:30 | × | systemfault quits (sid267009@uxbridge.irccloud.com) (Ping timeout: 268 seconds) |
| 11:14:26 | × | mechap quits (~mechap@user/mechap) (Quit: WeeChat 3.7.1) |
| 11:14:45 | → | mechap joins (~mechap@user/mechap) |
| 11:14:50 | → | systemfault joins (sid267009@id-267009.uxbridge.irccloud.com) |
| 11:15:58 | → | Kaiepi joins (~Kaiepi@nwcsnbsc03w-47-55-159-86.dhcp-dynamic.fibreop.nb.bellaliant.net) |
| 11:17:19 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 11:17:27 | → | thongpv87 joins (~thongpv87@2001:ee0:54ae:c1f0:b9cc:872a:62dd:efd6) |
| 11:18:14 | <cheater> | @protontorpedo |
| 11:18:14 | <lambdabot> | why haskell over lisp? |
| 11:20:16 | × | thongpv quits (~thongpv87@14.246.240.163) (Ping timeout: 252 seconds) |
| 11:21:29 | → | mizlan joins (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) |
| 11:26:10 | × | mizlan quits (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 272 seconds) |
| 11:29:17 | × | freeside quits (~mengwong@103.252.202.159) (Ping timeout: 252 seconds) |
| 11:29:20 | × | CiaoSen quits (~Jura@p200300c9571bac002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 255 seconds) |
| 11:32:31 | × | kuribas quits (~user@ptr-17d51ema74fu5i8lm5c.18120a2.ip6.access.telenet.be) (Quit: ERC (IRC client for Emacs 27.1)) |
| 11:34:35 | × | thongpv87 quits (~thongpv87@2001:ee0:54ae:c1f0:b9cc:872a:62dd:efd6) (Ping timeout: 248 seconds) |
| 11:43:47 | → | thyriaen joins (~thyriaen@2a01:aea0:dd4:4bae:6245:cbff:fe9f:48b1) |
| 11:57:16 | → | mizlan joins (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) |
| 11:58:16 | × | fserucas quits (~fserucas@2001:818:e376:a400:fb92:70c1:dd88:c7d7) (Quit: Leaving) |
| 12:01:28 | × | mizlan quits (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 252 seconds) |
| 12:07:48 | → | Blightmain joins (~Blightmai@203.29.154.219) |
| 12:16:15 | → | VY2_ joins (~user@213.24.133.13) |
| 12:18:57 | × | VY2 quits (~user@213.24.126.94) (Ping timeout: 268 seconds) |
| 12:30:25 | → | mizlan joins (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) |
| 12:30:57 | → | fserucas joins (~fserucas@2001:818:e376:a400:fb92:70c1:dd88:c7d7) |
| 12:33:41 | × | fserucas_ quits (~fserucas@2001:818:e376:a400:fb92:70c1:dd88:c7d7) (Ping timeout: 256 seconds) |
| 12:42:26 | × | anpad quits (~pandeyan@user/anpad) (Quit: ZNC 1.8.2 - https://znc.in) |
| 12:44:50 | → | anpad joins (~pandeyan@user/anpad) |
| 12:46:15 | × | Blightmain quits (~Blightmai@203.29.154.219) (Quit: Leaving) |
| 12:46:24 | × | img quits (~img@user/img) (Quit: ZNC 1.8.2 - https://znc.in) |
| 12:46:41 | → | img joins (~img@user/img) |
| 12:52:10 | → | CiaoSen joins (~Jura@p200300c9571bac002a3a4dfffe84dbd5.dip0.t-ipconnect.de) |
| 12:54:07 | → | hyperbolic-dg joins (~quassel@i577AA562.versanet.de) |
| 12:57:02 | → | iik joins (~iik@5.46.250.195) |
| 12:59:34 | × | iik quits (~iik@5.46.250.195) (Client Quit) |
| 13:00:39 | → | dextaa0 joins (~DV@user/dextaa) |
| 13:02:35 | × | dextaa quits (~DV@user/dextaa) (Ping timeout: 256 seconds) |
| 13:02:35 | dextaa0 | is now known as dextaa |
| 13:07:02 | <dminuoso> | newtype Params a = Params (Params.Params a) |
| 13:07:06 | <dminuoso> | Things are so clear now. |
| 13:08:22 | <dminuoso> | I have a feeling this is all some bizarre artifact of avoiding circular imports. |
| 13:09:15 | <int-e> | what's this parametric polymorphism |
| 13:11:19 | → | boxscape_ joins (~boxscape_@213.52.37.155) |
| 13:11:19 | × | razetime quits (~Thunderbi@49.207.194.134) (Read error: Connection reset by peer) |
| 13:11:35 | → | razetime joins (~Thunderbi@49.207.194.134) |
| 13:12:03 | <maerwald> | what time format is "Thu, 15 Dec 2022 08:43:15 PST" |
| 13:12:59 | × | Kaiepi quits (~Kaiepi@nwcsnbsc03w-47-55-159-86.dhcp-dynamic.fibreop.nb.bellaliant.net) (Ping timeout: 260 seconds) |
| 13:15:05 | <ncf> | RFC 5322 but what does this have to do with haskell |
| 13:15:08 | → | Kaiepi joins (~Kaiepi@nwcsnbsc03w-47-55-159-86.dhcp-dynamic.fibreop.nb.bellaliant.net) |
| 13:15:26 | <maerwald> | https://github.com/brendanhay/amazonka/issues/866 |
| 13:16:04 | <merijn> | dminuoso: All I want for Christmas...is automatic handling of circular imports >.> |
| 13:16:20 | <merijn> | (bit late with that, but I didn't open my work laptop over the vacation :p) |
| 13:16:26 | <dminuoso> | ncf: Not quite. Mmm |
| 13:16:32 | <dminuoso> | This is RFC1123 |
| 13:17:45 | <ncf> | ah yes the keys are right next to each other |
| 13:18:02 | <mechap> | Has anyone had this issue with stack https://discourse.haskell.org/t/stack-connection-failure/5517 ? |
| 13:18:25 | <dminuoso> | ncf: The formats look very similar to be fair. |
| 13:18:36 | <ncf> | what's the difference? |
| 13:19:12 | <dminuoso> | RFC5322 is based on 822, which uses 2-digits years (but introduces a comma after the day. also uses 4-letter days) |
| 13:19:40 | <dminuoso> | "Thur, 16 Dec 22 08:43:15 PST" |
| 13:19:49 | <dminuoso> | "Thu, 16 Dec 2022 08:43:15 PST" |
| 13:20:06 | <dminuoso> | The former is 5322 and the latter is 1123 |
| 13:20:12 | → | kuribas joins (~user@ip-188-118-57-242.reverse.destiny.be) |
| 13:20:29 | <dminuoso> | Or maybe uh. I dont know |
| 13:20:41 | <dminuoso> | https://xkcd.com/927/ |
| 13:21:15 | <maerwald> | dminuoso: RFC822 |
| 13:21:23 | <maerwald> | this parser seems to handle it |
| 13:21:28 | <maerwald> | it just fails on PST |
| 13:21:33 | → | xff0x joins (~xff0x@p3326132-ipngn2103sapodori.hokkaido.ocn.ne.jp) |
| 13:21:46 | <ncf> | i'm going by date(1), which says > output date and time in RFC 5322 format. Example: Mon, 14 Aug 2006 02:34:56 -0600 |
| 13:21:47 | <maerwald> | "%a, %d %b %Y %H:%M:%S GMT" |
| 13:21:51 | × | fizbin quits (~fizbin@user/fizbin) (Ping timeout: 268 seconds) |
| 13:21:59 | <maerwald> | GMT is hardcoded |
| 13:22:15 | <merijn> | ncf: That has a numerical UTC offset and not a timezone, though |
| 13:22:27 | <merijn> | PST is not a numerical UTC offset |
| 13:22:51 | <merijn> | Also, reminds me I should avoid any shit involving dates |
| 13:22:57 | × | troydm quits (~troydm@host-176-37-124-197.b025.la.net.ua) (Ping timeout: 252 seconds) |
| 13:23:01 | → | beteigeuze joins (~Thunderbi@bl14-81-220.dsl.telepac.pt) |
| 13:23:06 | <dminuoso> | ncf: Mmm, it seems it is at least RFC5322 compatible, anyway |
| 13:23:20 | <dminuoso> | That is, an RFC5322 compliant parser should be able to deal with it (@maerwald also) |
| 13:23:31 | <dminuoso> | zone = (FWS ( "+" / "-" ) 4DIGIT) / obs-zone |
| 13:23:36 | <ncf> | apparently section 4.3 of RFC5322 describes an "obsolete" format which allows 2-digit years *and* alphabetic timezones like PST (equivalent to -0800) |
| 13:23:44 | × | chiselfuse quits (~chiselfus@user/chiselfuse) (Ping timeout: 255 seconds) |
| 13:24:12 | <dminuoso> | Yeah. |
| 13:24:27 | <dminuoso> | I mean its impossible to say which RFC is followed from a sample sizse of 1 |
| 13:24:29 | <merijn> | alphabetical timezones are very much not equivalent to UTC offsets, because the timezone to UTC mapping is not static :p |
| 13:24:31 | → | chiselfuse joins (~chiselfus@user/chiselfuse) |
| 13:24:43 | <int-e> | is this applied steganography ;) |
| 13:24:44 | <merijn> | This is also why you cannot store future times in UTC |
| 13:24:46 | <dminuoso> | RFC1123 and RFC5322 have production rules allowing for this particular example that maerwald provided. |
| 13:25:32 | <dminuoso> | merijn: Heh indeed, I didnt consider it until North Korea decided, for a short while, to change their timezone offset. |
| 13:26:05 | <dminuoso> | They switched from UTC+09:00 to UTC+08:30 for a few years |
| 13:26:21 | <maerwald> | time warfare |
| 13:26:59 | <dminuoso> | maerwald: Honestly if you want to correctly parse the time stamp, you will have to consult documentation or the implementation. |
| 13:27:17 | <dminuoso> | Judging from a singular sample can be tricky because you dont know under what conditions it might explore other production rules of whatever standard it is using |
| 13:27:19 | × | CiaoSen quits (~Jura@p200300c9571bac002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 252 seconds) |
| 13:27:41 | × | coot quits (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot) |
| 13:27:42 | × | razetime quits (~Thunderbi@49.207.194.134) (Quit: razetime) |
| 13:28:04 | <maerwald> | is there a RFC5322 compliant parser? |
| 13:29:36 | → | fizbin joins (~fizbin@user/fizbin) |
| 13:30:24 | <maerwald> | I don't feel masochistic enough to write one |
| 13:30:49 | <maerwald> | don't think my opioid lasts for that long |
| 13:30:56 | <dminuoso> | Just interface with ChatGPT and ask it to convert into an ISO 8601 string. |
| 13:31:15 | <dminuoso> | Given that you're using amazonka, you clearly have an internet connection. |
| 13:31:28 | <maerwald> | I refuse to utilize ChatGPT |
| 13:31:41 | <dminuoso> | No I didnt mean to generate code, I meant it as part of your library! |
| 13:31:44 | <dminuoso> | :p |
| 13:31:49 | <maerwald> | that too |
| 13:32:30 | <maerwald> | they're taking our jobs... I wanna build an AI firewall |
| 13:32:46 | <dminuoso> | Why not use ChatGPT to build an AI firewall for you! |
| 13:33:15 | × | chiselfuse quits (~chiselfus@user/chiselfuse) (Remote host closed the connection) |
| 13:33:27 | <maerwald> | why S3 is such a clusterf**k I still don't know |
| 13:33:53 | × | mizlan quits (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 260 seconds) |
| 13:35:02 | <merijn> | dminuoso: EU is still working on ditching summer time, no? |
| 13:35:12 | <merijn> | dminuoso: That'll turn into a mess of changing timezones too |
| 13:35:33 | <dminuoso> | merijn: "working on" is one way of phrasing it. |
| 13:35:56 | <merijn> | I mean, every year there's a bunch of countries changing UTC offsets, so the North Korea is hardly unique |
| 13:36:11 | <merijn> | dminuoso: It was ratified and now mired indefinitely in bureaucracy? ;) |
| 13:36:19 | <dminuoso> | No |
| 13:36:31 | <dminuoso> | The decision hasnt been confirmed yet, and is de-facto blocked currently. |
| 13:36:39 | <maerwald> | ah, democracy |
| 13:37:07 | <maerwald> | just a bunch of groups trolling each other |
| 13:37:32 | <dminuoso> | Yup, the european commission is effectively delaying it, by just *waiting* for the member states to just randomly come together and come up with a shared position. |
| 13:37:43 | <dminuoso> | Which of course is never going to happen on its own magically |
| 13:38:49 | → | chiselfuse joins (~chiselfus@user/chiselfuse) |
| 13:40:05 | <dminuoso> | By the way, turns out ChatGPT accurately figured out this format to be RFC822 or one of its successors. |
| 13:40:13 | <dminuoso> | Scary piece of software |
| 13:40:30 | <dminuoso> | (Its still inaccurate in that its *not* actually RFC822, but oh-well) |
| 13:41:07 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Quit: ZNC - https://znc.in) |
| 13:42:10 | <merijn> | dminuoso: I mean, I do agree that ChatGPT is scary software, just not because of it's supposed intelligence :p |
| 13:42:35 | <merijn> | maerwald: Also, going back 15 minutes: s/S3/any AWS service/ |
| 13:42:54 | <dminuoso> | Sure, I just see so much potential for degradation in the quality of learning, science and engineering. |
| 13:43:10 | <dminuoso> | It is just good enough to be really impressive, but subtly wrong all the time |
| 13:43:12 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 13:43:37 | <maerwald> | merijn: I'm not using AWS even |
| 13:44:47 | <maerwald> | some other services that started throwing 503 errors, then support told me that's the rate limiting for 750 requests per second... then I asked them how a single CI job with 4 threads can send that many requests |
| 13:44:53 | <maerwald> | I did not get a useful answer |
| 13:45:28 | <dminuoso> | maerwald: that being said, you can probably get awway by using parseTimeM with "%a, %d %b %Y %T %z" as the format string. Its not strictly RFC5322 compliant, but will at least work if the singular example is fully representative for all possible output formats. |
| 13:45:41 | <dminuoso> | Ah but hold on, $z is wrong |
| 13:45:55 | <maerwald> | yeah, it uses PTSD string |
| 13:46:01 | <maerwald> | or somesuch |
| 13:46:17 | <dminuoso> | Oh gosh |
| 13:48:41 | <maerwald> | hm, this error only happens on FreeBSD |
| 13:48:51 | <maerwald> | maybe the local time is funny? |
| 13:49:41 | <maerwald> | not surprising... FreeBSD goes to great lengths to annoy anyone who wants to support that platform |
| 13:50:01 | <maerwald> | Windows is more sane than that |
| 13:50:48 | <dminuoso> | So this is going to be tricky |
| 13:50:58 | <dminuoso> | I think you may need tzdata for full correctness |
| 13:52:13 | <dminuoso> | Unless they strictly adhere to RFC5322, in which case you only need to support UT, GMT, EST, EDT, CST, CDT, MST, MDT, PST and PDT |
| 13:52:19 | → | coot joins (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) |
| 13:52:20 | <dminuoso> | This is absurd. |
| 13:52:41 | <dminuoso> | But yeah, you absolutely need tzdata here |
| 13:53:32 | → | freeside joins (~mengwong@103.252.202.159) |
| 13:53:47 | <dminuoso> | And some library that uses tzdata to calculate the correct UTC offsets |
| 13:54:40 | <dminuoso> | It never occured to me how dumb using a timezone *name* in a timestamp is until today |
| 13:59:26 | → | thongpv87 joins (~thongpv87@2402:9d80:347:404f:51d:aa77:e86f:6146) |
| 13:59:49 | × | xff0x quits (~xff0x@p3326132-ipngn2103sapodori.hokkaido.ocn.ne.jp) (Ping timeout: 256 seconds) |
| 14:03:10 | → | mizlan joins (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) |
| 14:03:26 | <eldritchcookie[4> | how can i define a injective type family any attempt i made was rejected |
| 14:03:36 | <eldritchcookie[4> | like besides Id? |
| 14:03:54 | <dminuoso> | eldritchcookie[4: Can you show some of your attempts, perhaps? |
| 14:04:08 | <eldritchcookie[4> | like why is this rejected ? |
| 14:04:08 | <eldritchcookie[4> | type family ListToFunctionWithArgs r as = f | f ->r as where |
| 14:04:08 | <eldritchcookie[4> | ListToFunctionWithArgs r (a ': as) = a -> ListToFunctionWithArgs r as |
| 14:04:08 | <eldritchcookie[4> | ListToFunctionWithArgs r '[] = r |
| 14:04:20 | × | dka quits (~code-is-a@ns3059207.ip-193-70-33.eu) (Ping timeout: 260 seconds) |
| 14:04:42 | <eldritchcookie[4> | at first glance it seems like i can find both r and as from f |
| 14:05:39 | <eldritchcookie[4> | but i genuinely couldn't just define a injective type family with more than one equation |
| 14:06:07 | → | igghibu joins (~igghibu@37.120.201.86) |
| 14:07:29 | × | mizlan quits (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 260 seconds) |
| 14:07:40 | <eldritchcookie[4> | actually how can i constraint r ? if i forbid any Type with a function arrow it obviously works |
| 14:09:23 | <eldritchcookie[4> | ListToFunctionWithArgs (a -> b) '[] = a -> b |
| 14:09:23 | <eldritchcookie[4> | and ListToFunctionWithArgs b '[a] = a -> b? |
| 14:09:53 | <eldritchcookie[4> | like if i know f and r i can find out as |
| 14:10:25 | <dminuoso> | eldritchcookie[4: Judging from just a skim of the type family equation requirements from both the GHC manual and the original PDF, I immediately notice the first problem: |
| 14:10:30 | <dminuoso> | `If a RHS of a type family equation is a type family application GHC reports that the type family is not injective.` |
| 14:10:49 | <dminuoso> | That's from the GHC manual, which is a slight relaxation from the original paper which requires: |
| 14:11:08 | <dminuoso> | A type family F is n-injective iff 1. For every equation F σ = τ : (a) τ is not a type family application, and [...] |
| 14:12:05 | <dminuoso> | And presumably this is becausee of the halting undecidability |
| 14:12:58 | <eldritchcookie[4> | ok how can i make a useful injective type family? please give any non trivial example |
| 14:13:32 | <eldritchcookie[4> | do i use it in constraint from a type class? and then define instances recursively? |
| 14:13:50 | <dminuoso> | Im not exactly sure what you are trying to do. |
| 14:14:20 | <dminuoso> | But it sounds like you have already settled that injective type families are needed for your problem, and are asking how to write them instead. A kind of XY problem |
| 14:15:27 | <eldritchcookie[4> | i have 2 things a problem and interst in injective type families if i could solve it with injective type families it would be amazing but i question more to learn about them |
| 14:15:36 | <dminuoso> | Injectivity is usually used if you either need to guide inference, or if you want to guarantee absence of wrong instances. |
| 14:20:52 | → | mizlan joins (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) |
| 14:22:09 | <eldritchcookie[4> | how can i turn a type list into a tuple type ? |
| 14:23:30 | <dminuoso> | Since tuple types are wired in, you have to write them out one at a time |
| 14:23:42 | <dminuoso> | There's no underlying recursive construction |
| 14:24:40 | ← | jakalx parts (~jakalx@base.jakalx.net) (Error from remote client) |
| 14:24:49 | <c_wraith> | being wired in is sort of irrelevant. the important part is that the types have no relation to each other |
| 14:26:23 | → | titibandit joins (~titibandi@xdsl-89-0-163-79.nc.de) |
| 14:27:04 | <eldritchcookie[4> | is there a default GADT heterogeneous list? i really do not want to just define a HList GADT but i also do not want to depend on a library made by people that think OOHaskel is a good idea |
| 14:27:07 | <dminuoso> | type family ToTuple (c :: [Type]) :: Type where ToTuple '[a] = (a); ToTuple '[a, b] = (a, b) ... |
| 14:27:12 | <dminuoso> | eldritchcookie[4: ^- something like this. |
| 14:27:20 | <dminuoso> | You can use TH of course to remove the boilerplate |
| 14:28:06 | → | troydm joins (~troydm@host-176-37-124-197.b025.la.net.ua) |
| 14:28:22 | × | nschoe quits (~q@141.101.51.197) (Quit: Switching off) |
| 14:28:29 | <eldritchcookie[4> | argh i hate writing TH is there really no other way: |
| 14:28:32 | <eldritchcookie[4> | ? |
| 14:29:30 | <dminuoso> | Like c_wraith said, there's no relationship between the individual tuple types |
| 14:29:41 | <dminuoso> | And there's an upper limit too (I think 63-tuple is the maximum) |
| 14:30:25 | <dminuoso> | Do think of just a bunch of separate types `data Tuple2 a b = Tuple2 a b`, `data Tuple3 a b c = Tuple3 a b c` |
| 14:30:41 | <eldritchcookie[4> | guess i will swallow the TH then, surely no one uses functions with more than 63 arguments right? |
| 14:31:00 | <merijn> | eldritchcookie[4: GHC doesn't even implement tuples with more then 63 arguments :p |
| 14:31:04 | <dminuoso> | I would just write out the cases, its much easier to write and be sure its right. |
| 14:31:19 | <dminuoso> | merijn: Just be silent on the backstory why that limit exists. |
| 14:31:30 | <dminuoso> | It might alarm people. |
| 14:31:35 | <dminuoso> | :p |
| 14:31:36 | <merijn> | dminuoso: Videogame programming :p |
| 14:31:50 | <dminuoso> | Okay Im not familiar with that expression |
| 14:32:05 | <merijn> | dminuoso: That's one my systems programming professor coined in the class teaching C |
| 14:32:09 | → | xff0x joins (~xff0x@p3326132-ipngn2103sapodori.hokkaido.ocn.ne.jp) |
| 14:32:16 | <merijn> | dminuoso: The process of treating programming as if it is a videogame |
| 14:32:42 | <c_wraith> | ooh, am I going for the high score in tuple size? |
| 14:32:43 | <merijn> | i.e. compiler error/crash is game over, and then you just randomly try something else until you "beat the level" (it compiles and appears to work) |
| 14:32:56 | <dminuoso> | I see. |
| 14:33:04 | <merijn> | dminuoso: As opposed to trying to understand what/how/why |
| 14:33:07 | <dminuoso> | So code golfing is the equivalent of speed runs then? |
| 14:33:47 | → | nschoe joins (~q@141.101.51.197) |
| 14:34:27 | <merijn> | dminuoso: not really, most code golfers actually think long and hard on how you can do things |
| 14:34:28 | <dminuoso> | eldritchcookie[4: If you are going to make a bet on that, I will create an acme-64 package just for you. |
| 14:34:45 | <dminuoso> | merijn: sure, just like speed runners think long and hard and practice how to do things. |
| 14:34:49 | <merijn> | dminuoso: It's more akin to "cargo cult programming" in the sense of "doing things without udnerstanding" |
| 14:34:57 | <dminuoso> | Its not like many of their paths are just accidental |
| 14:35:17 | × | titibandit quits (~titibandi@xdsl-89-0-163-79.nc.de) (Remote host closed the connection) |
| 14:36:11 | <merijn> | dminuoso: The difference is that "videogame programming" is about the *process* used to program, whereas code golfing is merely about the end result (and generally the way those results are obtained are the exact opposite of videogame programming) |
| 14:37:08 | <dminuoso> | eldritchcookie[4: that packge will have functions const65 through constXXXXXXXXXXXX until such a high number, that the linker will run out of memory. Goal of the package? Ensuring a quality universe of packages that do not assume an upper limit of function arguments. |
| 14:37:54 | <dminuoso> | merijn: Fair. I do recall when I was a kid learning C and just adding asterisks and ampersands until the compiler seemed to be happy. |
| 14:38:01 | <dminuoso> | It did seem like playing a videogame without understanding the rules. |
| 14:38:58 | <boxscape_> | sounds like me with rust and lifetime annotations |
| 14:39:21 | <boxscape_> | (except for the "when I was a kid" part) |
| 14:39:35 | → | waleee joins (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) |
| 14:40:28 | <dminuoso> | Some of Haskell was the same for me. |
| 14:40:45 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:bccb:1151:f053:cd4c) |
| 14:40:51 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 14:40:52 | <dminuoso> | We even sometimes teach that style as hole-driven programming. |
| 14:41:08 | <dminuoso> | "Dont think about programming, just play the type checker" |
| 14:41:42 | <boxscape_> | yeah especially taken to its extreme when proving something in agda it can feel very much like a video game |
| 14:41:43 | geekosaur | hates type tetris |
| 14:42:00 | <geekosaur> | strongly prefer to understand why |
| 14:42:21 | <dminuoso> | boxscape_: I mean the compiler is a computer program, there's a user interface (via text files), there's some output, and you get quite a level of gratification upon success. |
| 14:42:26 | <dminuoso> | This *is* computer games. |
| 14:42:31 | <boxscape_> | fair |
| 14:43:58 | <dminuoso> | maerwald: By the way, my mission for postgresql-micro has started! But I must say, hasql is really cleanly written - it's almost a shame it comes with a dependency forest the size of a kmettiverse. |
| 14:44:38 | <dminuoso> | A lot of the functions Im writing end up looking quite like Nikitas work accidentally |
| 14:45:02 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:bccb:1151:f053:cd4c) (Ping timeout: 246 seconds) |
| 14:45:57 | <merijn> | geekosaur: For you: |
| 14:46:03 | <merijn> | @quote autrijus didn't.you.write |
| 14:46:03 | <lambdabot> | autrijus says: * autrijus stares at type Eval x = forall r. ContT r (ReaderT x IO) (ReaderT x IO x) and feels very lost <shapr> Didn't you write that code? <autrijus> yeah. and it works <autrijus> I |
| 14:46:03 | <lambdabot> | just don't know what it means. |
| 14:46:18 | <geekosaur> | yep, I've seen that one |
| 14:46:27 | <geekosaur> | both the quote and the code in context 🙂 |
| 14:46:42 | <merijn> | I certainly recall several times working on haskell that felt like that |
| 14:46:49 | <geekosaur> | tbh I understood the code better than the uses of it |
| 14:47:19 | <geekosaur> | my attempt to resuscitate pugs was very short lived |
| 14:47:24 | <merijn> | I wrote some subprocess management code to set up a process AND some extra pipes to it, it works marvelously, but I'm very confused looking at it now xD |
| 14:55:47 | × | gnalzo quits (~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c) (Quit: WeeChat 3.7.1) |
| 14:57:53 | <maerwald[m]> | dminuoso: yeah, he's a good engineer |
| 14:58:41 | <maerwald[m]> | As in: not stuffing everything full of category theory and type level programming, but making balanced decisions |
| 15:00:16 | <maerwald[m]> | E.g. avoiding type classes for the encoders/decoders |
| 15:00:30 | <maerwald[m]> | Because those really suck |
| 15:00:40 | → | CiaoSen joins (~Jura@p200300c9571bac002a3a4dfffe84dbd5.dip0.t-ipconnect.de) |
| 15:01:43 | × | igghibu quits (~igghibu@37.120.201.86) (Quit: igghibu) |
| 15:02:28 | × | xff0x quits (~xff0x@p3326132-ipngn2103sapodori.hokkaido.ocn.ne.jp) (Ping timeout: 252 seconds) |
| 15:04:04 | <maerwald[m]> | For the finicky parts, just using TH instead of coming up with beam style APIs |
| 15:07:08 | → | ryantrinkle joins (~ryantrink@209.91.238.110) |
| 15:07:33 | <ryantrinkle> | i'm using ghc 8.10.7 and -package flags seem to fail in the presence of cabal sublibraries |
| 15:07:46 | <ryantrinkle> | even though a -package flag is present, GHC still gives an error saying it is hidden |
| 15:07:49 | <ryantrinkle> | has anyone else seen this? |
| 15:12:26 | → | tremon joins (~tremon@83-85-213-108.cable.dynamic.v4.ziggo.nl) |
| 15:20:54 | <c_wraith> | is it a private sublibrary? |
| 15:21:48 | × | mizlan quits (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 260 seconds) |
| 15:25:55 | → | elkcl_ joins (~elkcl@broadband-188-255-19-11.ip.moscow.rt.ru) |
| 15:27:26 | × | elkcl quits (~elkcl@broadband-188-255-19-11.ip.moscow.rt.ru) (Ping timeout: 246 seconds) |
| 15:29:18 | → | elkcl joins (~elkcl@broadband-188-255-19-11.ip.moscow.rt.ru) |
| 15:29:28 | × | boxscape_ quits (~boxscape_@213.52.37.155) (Quit: Connection closed) |
| 15:30:38 | × | elkcl_ quits (~elkcl@broadband-188-255-19-11.ip.moscow.rt.ru) (Ping timeout: 272 seconds) |
| 15:31:27 | <merijn> | It has been 0 days since I last wished I could combine qualified imports with an import list in one declaration |
| 15:33:36 | <merijn> | All these pointless syntax tweaking proposals and extensions, and that's the one that'd most directly impact my life positively :p |
| 15:33:49 | <Jadesheit[m]> | make it :) |
| 15:34:00 | <dolio> | You can combine them. It just doesn't mean what you want. :) |
| 15:34:04 | <merijn> | dminuoso: That' |
| 15:34:11 | <merijn> | dolio: That's my point |
| 15:34:18 | <merijn> | dolio: The current version is stupid >.< |
| 15:40:11 | <eldritchcookie[4> | why does this code fail with can't match as ++ '[f ] with as0 ++ '[f]... (full message at <https://libera.ems.host/_matrix/media/v3/download/libera.chat/57e0fc7347352e9d4811266c4e93ebfb112f3917>) |
| 15:40:33 | <eldritchcookie[4> | like i literally did nothing yet and it doesn't typecheck? |
| 15:45:08 | → | razetime joins (~Thunderbi@49.207.194.134) |
| 15:48:47 | → | yvan-sraka joins (sid419690@id-419690.lymington.irccloud.com) |
| 15:48:48 | → | chexum_ joins (~quassel@gateway/tor-sasl/chexum) |
| 15:48:53 | × | chexum quits (~quassel@gateway/tor-sasl/chexum) (Quit: No Ping reply in 180 seconds.) |
| 15:53:48 | → | mizlan joins (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) |
| 15:53:49 | × | lortabac quits (~lortabac@2a01:e0a:541:b8f0:83e4:99f0:e8cd:3cd7) (Quit: WeeChat 2.8) |
| 16:00:14 | × | CiaoSen quits (~Jura@p200300c9571bac002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 255 seconds) |
| 16:01:54 | → | ddellacosta joins (~ddellacos@86.106.143.57) |
| 16:02:50 | → | mei joins (~mei@user/mei) |
| 16:06:13 | → | king_gs joins (~Thunderbi@2806:103e:29:45ac:af0:afaf:29e7:dd60) |
| 16:08:54 | → | [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470) |
| 16:11:10 | → | trev joins (~trev@user/trev) |
| 16:13:50 | <EvanR> | talismanick, well Auto is a Profunctor... |
| 16:16:23 | × | freeside quits (~mengwong@103.252.202.159) (Ping timeout: 264 seconds) |
| 16:17:35 | × | catern quits (~sbaugh@2604:2000:8fc0:b:a9c7:866a:bf36:3407) (Remote host closed the connection) |
| 16:24:58 | × | thongpv87 quits (~thongpv87@2402:9d80:347:404f:51d:aa77:e86f:6146) (Ping timeout: 252 seconds) |
| 16:28:26 | → | shelby joins (~thomas_sh@115.96.219.157) |
| 16:29:03 | × | shelby quits (~thomas_sh@115.96.219.157) (Client Quit) |
| 16:29:20 | × | razetime quits (~Thunderbi@49.207.194.134) (Remote host closed the connection) |
| 16:29:55 | × | waleee quits (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Ping timeout: 252 seconds) |
| 16:31:34 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 252 seconds) |
| 16:34:43 | → | freeside joins (~mengwong@103.252.202.159) |
| 16:35:23 | → | cameron_ joins (~quassel@050-089-109-059.res.spectrum.com) |
| 16:35:26 | → | razetime joins (~Thunderbi@49.207.194.134) |
| 16:36:03 | <cameron_> | so are you guys telling me the only way to perform IO in this language is to treat IO as a function that takes in the state of reality before the operation and returns the state of reality after the operation has been performed |
| 16:37:07 | <dolio> | No, that is just the implementation used. |
| 16:37:15 | <dolio> | That explanation doesn't really make sense. |
| 16:37:31 | <cameron_> | so what is the explanation that does make sense |
| 16:38:01 | <geekosaur> | it's not really the "state of reality", it's just a baton that gets handed off between IO operations so they happen in the right order |
| 16:38:25 | <mauke> | depends on what exactly you are looking for |
| 16:38:31 | <dolio> | IO is some more abstract type that doesn't have the same degeneracies as `World -> (a, World)`. |
| 16:38:58 | <mauke> | e.g. do you know javascript with async/await? |
| 16:39:02 | <cameron_> | just wondering how an IO operation is still a pure function |
| 16:39:12 | <cameron_> | yeah ive been reasoning it as javascripts then basically |
| 16:39:37 | <geekosaur> | because you're in effect building a program purely, then handing it off to the impure runtime to execute |
| 16:39:47 | <c_wraith> | cameron_: what we're saying is that IO is reified as *values* which can be passed around, composed, and generally treated like any other kind of value. How is that implemented? Doesn't matter. What it *means* is the important part. |
| 16:40:08 | <mauke> | do you understand how a pure language with recursion can express any computation? |
| 16:40:38 | <cameron_> | just in the way that recursion and imperative loops are pretty much interchangeable |
| 16:41:48 | <cameron_> | so every IO operation is just like a checkpoint basically and the state is a collection of the actions you've performed? |
| 16:42:07 | <mauke> | there are no checkpoints, really |
| 16:42:44 | → | wroathe joins (~wroathe@207-153-38-140.fttp.usinternet.com) |
| 16:42:44 | × | wroathe quits (~wroathe@207-153-38-140.fttp.usinternet.com) (Changing host) |
| 16:42:44 | → | wroathe joins (~wroathe@user/wroathe) |
| 16:44:22 | <mauke> | the way I think about it (first approximation) is: Haskell is a (pure) macro language for an imperative runtime language |
| 16:45:21 | <mauke> | that is, your Haskell code simply builds a list of imperative actions for some other interpreter to execute |
| 16:45:57 | <mauke> | which is a lot like constructing a string, then running it as a shell script |
| 16:47:08 | <mauke> | that's enough to explain main, putStr, and >>, but it doesn't go further than that |
| 16:47:39 | × | king_gs quits (~Thunderbi@2806:103e:29:45ac:af0:afaf:29e7:dd60) (Ping timeout: 248 seconds) |
| 16:48:12 | <mauke> | to properly explain >>= and getChar, we need to add the concept of callbacks from impure to pure code |
| 16:48:45 | <cameron_> | its just wierd to imagine the pure mathematical model relies on the state of the hardware its running on at a certain point of execution as an input |
| 16:48:53 | <yushyin> | when i was learning haskell, i thought of IO as a kind of (e)DSL that is interpreted by the runtime eventually |
| 16:48:53 | <mauke> | like a shell script that can dynamically invoke a utility to build more script fragments to run next |
| 16:49:50 | <geekosaur> | cameron_, but it doesn't. as I said earlier, all that "state" does is ensure IO actions happen in the right order |
| 16:50:38 | <geekosaur> | it's an empty state that is passed between actions so they depend on each other. ghc even erases it after that part is done |
| 16:50:54 | → | gnalzo joins (~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c) |
| 16:50:55 | <mauke> | the pure mathematical model might |
| 16:50:56 | <mauke> | but that's not what we're actually running |
| 16:52:16 | <cameron_> | i guess in the end its just instructions |
| 16:52:20 | <cameron_> | like an interface to the runtime |
| 16:53:22 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:bccb:1151:f053:cd4c) |
| 16:54:47 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 255 seconds) |
| 16:55:39 | <cameron_> | so is the main way to write concurrent programs or fetch some data over the internet just similar to using .then in javascript? |
| 16:55:58 | <monochrom> | GHC uses "State#" as a coding trick to trick the code generator into preserving code order. |
| 16:56:48 | <monochrom> | Because normally (without a data dependency, real or fictional) the code generator aims at re-ordering code for optimizations. |
| 16:57:15 | <monochrom> | State# is a phantom type, i.e., no actual value. It's fictional data dependency. |
| 16:57:44 | × | mizlan quits (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 246 seconds) |
| 16:57:51 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 16:57:51 | <monochrom> | This we know because we can look at the asm code and see no State# there. |
| 16:58:05 | <monochrom> | As opposed to armchair-philosophizing it. |
| 16:58:12 | <mauke> | cameron_: yes, pretty much |
| 16:58:25 | → | merijn joins (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) |
| 16:58:49 | <mauke> | only we spell it >>=, not .then |
| 16:59:18 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 272 seconds) |
| 16:59:18 | <dolio> | And have syntax that isn't terrible. |
| 16:59:28 | <cameron_> | so what is the basis in lambda calculus that accounts for data dependency |
| 16:59:29 | → | king_gs joins (~Thunderbi@187.201.110.169) |
| 16:59:30 | <monochrom> | :) |
| 16:59:35 | <cameron_> | like only perform this calculation if this data exists |
| 16:59:38 | <mauke> | debatable |
| 16:59:52 | <mauke> | huh? |
| 17:00:00 | <monochrom> | Lazy evaluation. |
| 17:00:32 | <cameron_> | i guess thats where the phantom data type comes in |
| 17:01:32 | <cameron_> | i do like the syntax though it is elegant, its just going to take some time to learn all the operators lol |
| 17:02:43 | <mauke> | data dependency is normally expressed through lambdas (or else I'm really confused what you are talking about) |
| 17:03:09 | <dolio> | I mean specifically writing .then(...).then(...).then(...) for a sequence of statements is pretty bad. |
| 17:03:38 | <mauke> | (\x.x+1) is a computation that depends on a value x |
| 17:03:56 | <cameron_> | i just dont know a lot about lambda calculus i figured the whole program would be modeled as given some input produce this output |
| 17:03:58 | <monochrom> | I fear that it's actuall .then(... .then(... .then(...))) :) |
| 17:04:05 | <dolio> | Yeah, that's even worse. |
| 17:04:07 | <cameron_> | but by data dependency i thought you meant data that may not exist yet at this time |
| 17:05:10 | <cameron_> | like what is the concept in lambda calculus that allows you to wait for something to happen |
| 17:06:03 | <mauke> | LC is timeless |
| 17:06:24 | <dolio> | An application of a function depends on that function. |
| 17:06:47 | <mauke> | but we're bolting it on to an imperative runtime that knows how to interact with the OS |
| 17:06:52 | <cameron_> | so you just have an instruction that tells the compiler that you are waiting for something |
| 17:07:16 | <dolio> | In pure lambda calculus, since you need to represent all data with functions, data dependencies are determined by function application. |
| 17:07:34 | → | mei_ joins (~mei@user/mei) |
| 17:07:38 | <mauke> | and then it just calls a function with the results |
| 17:07:40 | <dolio> | In something richer you'd have case statements on data. |
| 17:08:24 | <dolio> | And you can't generally choose which branch to go to without looking at the data. |
| 17:08:36 | <dminuoso> | cameron_: My preferred interpretation of IO is more like `type IO = [Instruction]`, that is thinking of an IO action as just a series of instructions that can be executed by some abstract machine. |
| 17:08:53 | <dminuoso> | or `newtype IO = IO [Instruction]` if you want |
| 17:09:44 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:bccb:1151:f053:cd4c) (Remote host closed the connection) |
| 17:09:55 | <dminuoso> | I dont think there's much utility in looking at the internals of IO in hopes of gaining a deeper understanding of Haskell itself. After compilation, that "state threading" disappears entirely, erased, so its a completely fictional trick that is just used by GHC implementation. |
| 17:10:04 | × | mei quits (~mei@user/mei) (Ping timeout: 252 seconds) |
| 17:10:18 | <mauke> | yeah, the I/O library (e.g. getChar) is in cahoots with the runtime system |
| 17:11:02 | <dminuoso> | Oh `newtype IO a = ...` of course, I missed the relatively important type of the result you would get, if you were to execute said abstract instructions. |
| 17:11:29 | <cameron_> | that makes more sense to think of it as a functional interaction with the machine |
| 17:11:42 | <dminuoso> | not "functional" really |
| 17:13:39 | <cameron_> | so is haskell really "almost" purely functional |
| 17:14:10 | <dminuoso> | Our IO is pure in the sense that evaluation does not cause execution (in the absence of unsafePerformIO) |
| 17:14:11 | <mauke> | depends on your definition of "haskell" :-) |
| 17:14:16 | × | dsrt^ quits (~dsrt@76.145.185.103) (Remote host closed the connection) |
| 17:14:23 | <cameron_> | lol |
| 17:14:32 | <dminuoso> | cameron_: Why do you say "almost"? |
| 17:14:49 | <mauke> | lambdabot: test |
| 17:14:53 | <monochrom> | To answer that, you must respect types, too. |
| 17:15:14 | <cameron_> | like there are some aspects that need to be passed off to the underlying turing machine at some point |
| 17:15:23 | <monochrom> | Suppose x :: String. Then purely function means that x is the same string every times. Haskell upholds that. |
| 17:15:24 | <dminuoso> | That's unrelated |
| 17:15:31 | <jean-paul[m]> | cameron_: Consider the type of `main`. It isn't `()`. It's `IO ()`. You _didn't_ do I/O by evaluating `main`. |
| 17:15:33 | <dminuoso> | cameron_: The key difference Im trying to get at is execution versus evaluation. |
| 17:15:45 | <monochrom> | Fortunately, getLine :: IO String, not getLine :: String. |
| 17:16:22 | <dminuoso> | cameron_: The *evaluation* of Haskell (in sense of a graph reduction machine) is in principle pure (in the absence of dark primitives like unsafePerformIO) |
| 17:16:47 | <monochrom> | Purely functional on getLine :: IO String requires only that getLine is the same procedure every time. Fortunately, that's a tautology. |
| 17:18:04 | <cameron_> | so the fact that you are performing the same operations on every execution is what makes it purely functional |
| 17:18:11 | <dminuoso> | cameron_: Here's a funny primitive that lets us explore it: `pseq` takes two argument, it first *evaluates* the first argument and then afterwards returns the second. It's a magic primitive provided by GHC Haskell. It is useful because it lets us maket hsi comparison: |
| 17:18:29 | <dminuoso> | By evaluate I mean in the sence of forcing it, graph reductions taking place, in the sence of substition, etc.. |
| 17:18:46 | <dminuoso> | % pseq (putStrLn "Hello World") () |
| 17:18:46 | <yahb2> | () |
| 17:19:07 | <cameron_> | that sounds pretty hacky |
| 17:19:12 | <dminuoso> | Note how yahb2 did not cause any printing, despite the action `putStrLn "Hello World"` being evaluated |
| 17:19:13 | <dolio> | The only meaningful way to answer questions like these are with respect to useful properties that they entail, like, "can I reorder/factor/inline/etc. expressions without worrying about it?" And the answer to that is "yes," at least if you're precise about what an "expression" is. |
| 17:19:33 | <monochrom> | No. C's gets stands the same operation every time too. But since its type is ()->String, we judge it by asking "is gets() the same string every time?". The answer is no. |
| 17:20:20 | <dminuoso> | cameron_: So its not really hacky, seq (which is related to pseq) is actually part of the Haskell specification itself. It is useful because it lets us control evaluation order which can help in certain performance issues. |
| 17:21:04 | <cameron_> | so main = getLine >>= putStrLn is not exactly a pure function |
| 17:21:14 | <dolio> | It's not a function. |
| 17:21:14 | <dminuoso> | main is not a function. |
| 17:21:19 | <dminuoso> | But it is a pure valu. |
| 17:21:23 | <monochrom> | :D |
| 17:21:24 | <cameron_> | i see |
| 17:21:44 | <dminuoso> | cameron_: Like I said, think of `newtype IO a = IO [Instruction]` |
| 17:21:57 | <dminuoso> | cameron_: So evaluation would amount to evaluating the list of instructions to execute |
| 17:22:06 | <dminuoso> | (which is very different from actually executing them) |
| 17:22:53 | <dminuoso> | And by the same logic `>>=` doesnt actually execute either, in that view of the world it just calculates a new set of instructions that combines two IO actions. |
| 17:23:54 | <cameron_> | so it does make more sense to me in terms of creating lists of instructions |
| 17:24:37 | × | coot quits (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot) |
| 17:25:12 | <dminuoso> | Right. And in the above case with `pseq (putStrLn "Hello World") ()` all we did was conceptually compute the list of instructions that, if executed, would print Hello World. But that doesnt print hello world for the same reason that computing a recipe doesnt actually bake the cake. |
| 17:25:14 | <cameron_> | which are then run seperately |
| 17:25:21 | × | razetime quits (~Thunderbi@49.207.194.134) (Remote host closed the connection) |
| 17:25:35 | <dminuoso> | (And in that analogy a recipe is just a list of cooking instructions) |
| 17:26:42 | → | mizlan joins (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) |
| 17:28:01 | → | justsomeguy joins (~justsomeg@user/justsomeguy) |
| 17:28:10 | <dminuoso> | cameron_: And further, in that sense putStrLn is a pure and deterministic function. If you apply `putStrLn` to "hello world" you always get the same list of instructions back - it's completely pure. Similarly any mention of `getLine` is the same list of instructions - its also completely pure |
| 17:28:43 | × | kuribas quits (~user@ip-188-118-57-242.reverse.destiny.be) (Ping timeout: 248 seconds) |
| 17:29:31 | <cameron_> | doesn't that get wierd if putStrLn were to for some reason fail |
| 17:29:41 | <cameron_> | but still the instructions for handling failure would be the same |
| 17:30:28 | → | titibandit joins (~titibandi@xdsl-89-0-163-79.nc.de) |
| 17:30:37 | <dminuoso> | That particular function not fail, the execution might however. |
| 17:30:49 | <dminuoso> | And for that failure we have IO exceptions |
| 17:30:59 | <mauke> | > let x = putStr "hello" in length [x, x, x] |
| 17:31:00 | <lambdabot> | 3 |
| 17:31:16 | <dminuoso> | mauke: to be fair, you only forced the spine not the elements. |
| 17:31:20 | <cameron_> | thank you lambdabot lol |
| 17:31:45 | × | merijn quits (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds) |
| 17:31:57 | <mauke> | sure, but this example would work the same way in a strict language |
| 17:32:42 | <dminuoso> | cameron_: perhaps the strange thing about Haskell is not necessarily IO, but rather the potential lack of it. |
| 17:33:27 | <dminuoso> | cameron_: In traditional languages like say C or Python, if we used haskell equivalent types, everything ends up producing an IO action. There's no way to state "this thing is pure and doesnt do anything" |
| 17:34:24 | <dminuoso> | Which is why the terms functions and routines became intermingled to mean the same thing, because in C everything is a routine. |
| 17:34:37 | <dminuoso> | (well presumably the break in terminology dates back even further, but anyway) |
| 17:35:34 | <dminuoso> | So in an etymological sense, C erreoneously names everything a function, but in truth these are all routines. They dont have functions in the mathematical sense at all. |
| 17:36:27 | <dminuoso> | The way we do it in our type system, these can coexist. putStrLn is a function producing a "routine/action/list-of-instructions" |
| 17:36:31 | <dolio> | They do. You just can't tell them apart from all non-functions. |
| 17:39:46 | <cameron_> | so \x -> x is a function that returns the input but getStrLn >>= putStrLn is a function that produces a routine and then sends that output to another function that produces a seperate routine |
| 17:40:02 | → | eggplantade joins (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net) |
| 17:41:14 | → | jao joins (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) |
| 17:41:56 | <mauke> | getStrLn >>= putStrLn is not a function |
| 17:42:23 | <[exa]> | cameron_: not sure if someone wrote it here already but I like the RealWorld look at IO, `newtype IO a = IO (RealWorld -> (a,RealWorld))`. Chaining is kinda straightforward there, and you see your get>>=put is very wrapped as a function |
| 17:42:43 | <c_wraith> | [exa]: that's exactly the bad starting point we're trying to get away from |
| 17:42:59 | <[exa]> | ah okay (but why, it helped me a lot. :D ) |
| 17:43:29 | <c_wraith> | well, because it's not a function. |
| 17:43:38 | <mauke> | the RealWorld thing is a compiler hack inside ghc that simplifies code generation. it's not a useful abstraction |
| 17:43:41 | <cameron_> | well together they may not be but is getStrLn by itself not a function that produces some routine |
| 17:43:45 | <cameron_> | and then pipes its output to another |
| 17:44:16 | <c_wraith> | putStrLn is a function. (>>=) is a function. getLine is not a function, nor is (getLine >>= putStrLn) |
| 17:45:10 | <cameron_> | whoops i started blending stuff together lol |
| 17:45:33 | <[exa]> | c_wraith: well it "contains" a function (and the wrap is thin/zero because newtype), from runtime perspective that's egal |
| 17:46:16 | <mauke> | getLine is a constant, not a function |
| 17:46:34 | <dminuoso> | cameron_: Really do try and think of IO as list of instructions, then the role of >>= becomes clearer. |
| 17:47:27 | <c_wraith> | [exa]: The internal things really aren't functions in the Haskell sense. It's good to put a wall up between the meaning of IO and the way GHC implements it, because the way GHC implements it is heavily based on other things GHC does |
| 17:47:50 | <[exa]> | ok |
| 17:47:52 | <dminuoso> | `(>>=)` takes a list of instructions producing a, and a function taking a which would produce further instructions, and overall produces a list of instructions that stitches these two things together, a kind of compound action that if executed, would first execute the first sub-action, once the result was obtained, would feed it into the function, and then *execute* the obtained instructions |
| 17:47:54 | <dminuoso> | further |
| 17:48:38 | <monochrom> | I think you can safely go back to an earlier model you thought up. Haskell is functional and can still do I/O by outsourcing effects to something else, so you just need functional interaction with that something else. |
| 17:49:01 | <monochrom> | Anything more fine-grained is beyond your current level, it seems. |
| 17:50:46 | <cameron_> | yeah im not exactly a computer science phd student, i just started using arrow expressions in javascript and really enjoyed it lol |
| 17:50:53 | <cameron_> | but i am curious about how it all works |
| 17:51:03 | × | nschoe quits (~q@141.101.51.197) (Quit: Switching off) |
| 17:51:25 | <dminuoso> | cameron_: Imagine you holding Gordon Ramsays recipe for "blond roux', a further recipe that requires a roux would cook a kind of sauce, then you could just write a new note that combines these two into a new cooking note that first instructs you to make a blond roux, and then fill it into the second recipe. What you get out is a singular recipe. |
| 17:52:11 | × | Kaiepi quits (~Kaiepi@nwcsnbsc03w-47-55-159-86.dhcp-dynamic.fibreop.nb.bellaliant.net) (Ping timeout: 248 seconds) |
| 17:52:49 | <dminuoso> | My point is merely, computing a list of instructions is just different from executing them. |
| 17:55:37 | <monochrom> | physics : spherical elephant of uniform density :: haskell : ReadWorld# |
| 17:55:38 | <cameron_> | it feels like having a blend of all styles of programming in the same language could be both more productive or a nightmare if it goes badly |
| 17:55:51 | <cameron_> | just wanted to see whats going on over here and what the benefits are of staying to the functional style |
| 17:55:59 | → | merijn joins (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) |
| 17:56:17 | <dminuoso> | Equational reasoning. |
| 17:56:27 | <dminuoso> | If you dont know what that is, substitute what I wrote with its definition. |
| 17:56:34 | <cameron_> | lol |
| 17:56:43 | <monochrom> | Ugh is that a pun haha |
| 17:56:56 | <cameron_> | seems like |
| 17:57:06 | <mauke> | hahaha |
| 17:57:37 | <monochrom> | Leibniz substitutability principle. |
| 17:58:13 | <monochrom> | http://www.vex.net/~trebla/haskell/prerequisite.xhtml#leibniz |
| 18:00:05 | → | jinsun__ joins (~jinsun@user/jinsun) |
| 18:00:05 | × | jinsun quits (~jinsun@user/jinsun) (Killed (lithium.libera.chat (Nickname regained by services))) |
| 18:00:05 | jinsun__ | is now known as jinsun |
| 18:00:48 | × | merijn quits (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) (Ping timeout: 252 seconds) |
| 18:01:35 | <cameron_> | i like how they seperate the concept of "school math" and whatever black magic you've decided to embark on here |
| 18:03:33 | <dminuoso> | What do you mean? |
| 18:03:48 | <monochrom> | My article. It mentions "school math skills". |
| 18:04:02 | <monochrom> | which is equational reasoning :) |
| 18:04:05 | <dminuoso> | No in particular, what did they mean by black magic |
| 18:04:14 | <cameron_> | whatever comes next after school math lol |
| 18:04:19 | <monochrom> | programming? >:) |
| 18:04:32 | <dminuoso> | I think the crux of what we're talking about you already learned in school. |
| 18:04:40 | <monochrom> | or perhaps measure theory |
| 18:04:50 | <cameron_> | mostly yes |
| 18:05:12 | <cameron_> | although i've never heard the word monad in school before |
| 18:05:26 | <dminuoso> | I think much of "unlearning" that we talk about in Haskell is more about us using different terms in ways you may not be used to. |
| 18:05:55 | <dminuoso> | With something like `variable` its super strange, because the mathy notion you learn in school already when solving simple equations |
| 18:06:01 | → | thegeekinside joins (~thegeekin@189.217.82.244) |
| 18:06:32 | <cameron_> | the language does depend on context quite a bit |
| 18:06:44 | <dminuoso> | Which students of say C then proceed to replace with something different (namely that of a mutable store/reference), and then in Haskell we end up using the term variable in the math sense. |
| 18:07:06 | <mauke> | fortunately you can learn and understand the entirety of IO without touching monads in the abstract |
| 18:07:14 | <monochrom> | My most bitter complaint is = |
| 18:07:19 | <mauke> | just like you can learn addition (like 3+4) without group theory |
| 18:07:53 | <dminuoso> | monochrom: Do you happen to know whether <- from do-notation was borrowed from another language? |
| 18:08:42 | <monochrom> | A lot of 1970s pseudocode (e.g. Knuth's) write "x <- x+1" for Pascal's "x := x+1" |
| 18:08:51 | × | titibandit quits (~titibandi@xdsl-89-0-163-79.nc.de) (Quit: Leaving.) |
| 18:09:42 | <mauke> | maybe from list comprehension? |
| 18:09:46 | <monochrom> | In retrospect, perhaps "1970s pseudocode" is redundant, one can just say "pseudocode" without ambiguity, no one does pseudocode in the 21st century. |
| 18:10:20 | <hpc> | trying to define pseudocode is a bit futile anyway imo, the way they did it |
| 18:10:20 | <cameron_> | isnt 21st century pseudocode just python |
| 18:10:37 | <hpc> | the whole point of pseudocode is it isn't codified so you can express whatever with it |
| 18:11:00 | <hpc> | there's no "you can only write continuation passing style in pseudocode version 1.2" |
| 18:12:29 | <dminuoso> | hpc: This goes into my belief system of ignosticism. I think similarly to religious discussion, pseudocode is based on the notion that you just start writing in some language language without any definition whatsoever under the assumption that the other person will have a matching set of definitions for "pseudolanguage" |
| 18:12:36 | <mauke> | which version of pseudocode adds support for Win32 COM? |
| 18:13:00 | <dminuoso> | hpc: With sufficient complexity in the domain, you will have mismatching definitions leading to quirky discussions and emotions. |
| 18:13:33 | <cameron_> | i wonder when ai will be sufficiently advanced to infer your meaning from whatever pseudocode you've written |
| 18:14:01 | <dminuoso> | to be fair, copilot is often quite good at it already for some languages. |
| 18:14:15 | <dminuoso> | (well not for pseudocode, but still) |
| 18:14:29 | <dminuoso> | but who knows, maybe I should try tossing pseudo code at chatgpt and see what it does with it |
| 18:14:50 | <cameron_> | chatgpt can be pretty scary sometimes |
| 18:15:05 | <mauke> | copilot is also good for copying GPL'd code into your project :-P |
| 18:15:24 | <cameron_> | @FBI |
| 18:15:24 | <lambdabot> | Unknown command, try @list |
| 18:16:40 | <dminuoso> | mauke: Much worse, a better question is whether since it used GPLd code for training, whether copilot generated code is a derivative of said training material. |
| 18:16:56 | <mauke> | ooh |
| 18:17:16 | <mauke> | intuitively, I'd say yes |
| 18:17:35 | <dminuoso> | Intuitively, Id say this will be decided in courts all over the world in the following years. |
| 18:18:20 | <dminuoso> | And outside of common law, it will not be worth trying to prove that |
| 18:18:56 | <monochrom> | Intuitively, I'd say everyone avoids it because "this hasn't been tried in courts, let's not risk it". |
| 18:19:05 | <monochrom> | So, game theory! |
| 18:19:05 | <dminuoso> | Thats not my experience. |
| 18:19:34 | <dminuoso> | The first problem is, it will be incredibly difficult proving any particular region was generated by copilot. |
| 18:20:00 | <monochrom> | Ah OK, so the opposite effect. |
| 18:20:11 | <dolio> | Yeah, most programmers are too stupid to avoid it for that reason. |
| 18:20:36 | <monochrom> | Everyone does it, but nobody dares to bring it to court because "this hasn't been tried in courts" again. :) |
| 18:20:59 | → | econo joins (uid147250@user/econo) |
| 18:22:23 | <dolio> | (See all the folks who think using code on e.g. github with no license could never come back to bite them.) |
| 18:22:45 | × | son0p quits (~ff@2604:3d08:5b7f:5540::417e) (Ping timeout: 260 seconds) |
| 18:23:06 | <ryantrinkle> | c_wraith: the package *has* a private sublibrary, but i'm only trying to import the regular old public library |
| 18:23:18 | <dminuoso> | Jeesh, I have tossed half a dozen pseudo codes at chatgpt and it found the underlying algorithms every time, including an explanation. All identifiers were garbled to avoid some kind of pattern matching of wiki.. |
| 18:23:19 | × | beteigeuze quits (~Thunderbi@bl14-81-220.dsl.telepac.pt) (Ping timeout: 256 seconds) |
| 18:23:21 | <ryantrinkle> | using ghc-pkg to manually resolve it to a package ID, and then using -package-id instead of -package fixed it |
| 18:23:30 | <dminuoso> | chatgpt is mindboggling. :S |
| 18:23:36 | <ryantrinkle> | so it seems that for some reason ghc-8.10.7 just can't resolve packages to package-ids correctly |
| 18:24:39 | → | Guest4496 joins (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) |
| 18:25:07 | <monochrom> | Hrm, yeah that looks like something it should not be good at, given that you changed the vocabulary, almost a substitution cipher. |
| 18:25:47 | <cameron_> | whats even crazier is that it usually explains what its doing step by step |
| 18:26:33 | <dminuoso> | The step-by-step explanation part I somewhat get, given that stackoverflow is riddled with answers where people explain code regions in great detail |
| 18:26:36 | × | jinsun quits (~jinsun@user/jinsun) (Read error: Connection reset by peer) |
| 18:27:15 | <cameron_> | i wonder what is the most complex working program its generated from scratch |
| 18:27:26 | → | jinsun joins (~jinsun@user/jinsun) |
| 18:27:45 | <dminuoso> | I've seen examples where complete webpages with interactive JavaScript and CSS were synthesized and customized based on some dialogs. |
| 18:27:54 | <cameron_> | insane |
| 18:28:11 | <dminuoso> | Well, its somewhat error prone and requires handholding |
| 18:28:34 | <monochrom> | Already beats a lot of entry-level programmers. |
| 18:28:53 | <cameron_> | youre just the senior dev emailing the junior dev lol |
| 18:29:03 | <dminuoso> | Sure, something like that |
| 18:30:03 | → | instantaphex joins (~jb@c-73-171-252-84.hsd1.fl.comcast.net) |
| 18:30:10 | <dminuoso> | You know what, next year I will just use chatgpt for advent of code. |
| 18:30:50 | <dminuoso> | (or whatever new language model will be the hot stuff at that point) |
| 18:31:45 | → | elevenkb joins (~elevenkb@105.224.37.128) |
| 18:32:17 | ← | jakalx parts (~jakalx@base.jakalx.net) (Error from remote client) |
| 18:34:59 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 18:36:49 | → | Kaiepi joins (~Kaiepi@nwcsnbsc03w-47-55-159-86.dhcp-dynamic.fibreop.nb.bellaliant.net) |
| 18:38:32 | → | beteigeuze joins (~Thunderbi@bl14-81-220.dsl.telepac.pt) |
| 18:39:40 | × | eggplantade quits (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 18:41:41 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:780a:3a53:75ea:e01e) |
| 18:41:44 | → | abhixec joins (~abhinav@c-67-169-139-16.hsd1.ca.comcast.net) |
| 18:42:13 | <cameron_> | https://pastebin.com/HtvcQMSy |
| 18:42:21 | <cameron_> | i got chat gpt to generate this entire tic tac toe game |
| 18:42:32 | <cameron_> | you can overwrite the other players moves but it works lol |
| 18:43:24 | × | beteigeuze quits (~Thunderbi@bl14-81-220.dsl.telepac.pt) (Ping timeout: 260 seconds) |
| 18:43:47 | → | sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 18:45:30 | <mauke> | duckduckgo.com down? |
| 18:45:40 | <jean-paul[m]> | working here |
| 18:47:46 | <mauke> | "It's not just you! duckduckgo.com is down." |
| 18:48:08 | <mauke> | or at least loading slowly, intermittently |
| 18:48:08 | <darkling> | WFM. |
| 18:48:41 | × | king_gs quits (~Thunderbi@187.201.110.169) (Ping timeout: 246 seconds) |
| 18:49:11 | × | elevenkb quits (~elevenkb@105.224.37.128) (Quit: Client closed) |
| 18:51:55 | × | jinsun quits (~jinsun@user/jinsun) (Ping timeout: 260 seconds) |
| 18:55:12 | → | tzh joins (~tzh@c-24-21-73-154.hsd1.or.comcast.net) |
| 18:55:32 | → | panovia joins (~user@user/siracusa) |
| 18:56:11 | × | beefbambi quits (~beefbambi@2401:4900:230d:f57c:538c:d7cc:50c0:e377) (Read error: Connection reset by peer) |
| 18:57:53 | → | beefbambi joins (~beefbambi@183.82.26.189) |
| 18:58:18 | → | coot joins (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) |
| 18:58:37 | → | elevenkb joins (~elevenkb@105.224.37.128) |
| 18:58:57 | → | kuribas joins (~user@ptr-17d51eobge4k180xjsg.18120a2.ip6.access.telenet.be) |
| 19:03:56 | → | waleee joins (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) |
| 19:04:19 | × | coot quits (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot) |
| 19:11:18 | → | FarisAlmutairi joins (~FarisAlmu@142.154.108.249) |
| 19:12:21 | → | nasrudin__ joins (~nasrudin_@107-132-214-117.lightspeed.sndgca.sbcglobal.net) |
| 19:19:30 | → | merijn joins (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) |
| 19:20:44 | × | johnjaye quits (~pi@173.209.64.74) (Ping timeout: 260 seconds) |
| 19:22:36 | → | johnjaye joins (~pi@173.209.64.74) |
| 19:22:36 | × | nasrudin__ quits (~nasrudin_@107-132-214-117.lightspeed.sndgca.sbcglobal.net) (Read error: Connection reset by peer) |
| 19:22:48 | → | nasrudin__ joins (~nasrudin_@107-132-214-117.lightspeed.sndgca.sbcglobal.net) |
| 19:25:17 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
| 19:27:55 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 19:28:52 | → | Tuplanolla joins (~Tuplanoll@91-159-68-152.elisa-laajakaista.fi) |
| 19:31:44 | × | phma quits (~phma@host-67-44-208-104.hnremote.net) (Read error: Connection reset by peer) |
| 19:31:55 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:780a:3a53:75ea:e01e) (Remote host closed the connection) |
| 19:32:17 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 255 seconds) |
| 19:32:39 | → | phma joins (phma@2001:5b0:211b:f318:7482:d8c2:3f03:7c4c) |
| 19:34:09 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 19:35:08 | → | jmdaemon joins (~jmdaemon@user/jmdaemon) |
| 19:35:12 | × | avicenzi quits (~avicenzi@2a00:ca8:a1f:b004::c32) (Ping timeout: 265 seconds) |
| 19:35:50 | × | merijn quits (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) (Read error: Connection reset by peer) |
| 19:39:48 | × | iqubic quits (~avi@2601:601:1100:edd0:43b1:181f:28ff:d60c) (Remote host closed the connection) |
| 19:45:53 | × | VY2_ quits (~user@213.24.133.13) (Remote host closed the connection) |
| 19:54:47 | × | perrierjouet quits (~perrier-j@modemcable048.127-56-74.mc.videotron.ca) (Ping timeout: 246 seconds) |
| 19:59:44 | × | instantaphex quits (~jb@c-73-171-252-84.hsd1.fl.comcast.net) (Ping timeout: 246 seconds) |
| 19:59:48 | → | Unicorn_Princess joins (~Unicorn_P@user/Unicorn-Princess/x-3540542) |
| 20:06:58 | → | coot joins (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) |
| 20:09:40 | × | coot quits (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Client Quit) |
| 20:18:45 | → | Sgeo joins (~Sgeo@user/sgeo) |
| 20:19:08 | × | FarisAlmutairi quits (~FarisAlmu@142.154.108.249) (Quit: Client closed) |
| 20:20:06 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 20:20:14 | × | beefbambi quits (~beefbambi@183.82.26.189) (Read error: Connection reset by peer) |
| 20:20:25 | → | beefbambi joins (~beefbambi@183.82.26.189) |
| 20:21:16 | → | jero98772 joins (~jero98772@190.158.28.44) |
| 20:22:20 | × | Guest4496 quits (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 260 seconds) |
| 20:23:25 | → | king_gs joins (~Thunderbi@187.201.110.169) |
| 20:24:29 | × | chiselfuse quits (~chiselfus@user/chiselfuse) (Ping timeout: 255 seconds) |
| 20:25:26 | → | chiselfuse joins (~chiselfus@user/chiselfuse) |
| 20:25:26 | × | beefbambi quits (~beefbambi@183.82.26.189) (Read error: Connection reset by peer) |
| 20:25:46 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 272 seconds) |
| 20:26:37 | → | beefbambi joins (~beefbambi@183.82.26.189) |
| 20:29:34 | × | freeside quits (~mengwong@103.252.202.159) (Ping timeout: 272 seconds) |
| 20:30:16 | → | eggplantade joins (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net) |
| 20:31:33 | × | nasrudin__ quits (~nasrudin_@107-132-214-117.lightspeed.sndgca.sbcglobal.net) (Ping timeout: 260 seconds) |
| 20:34:25 | × | trev quits (~trev@user/trev) (Remote host closed the connection) |
| 20:35:59 | × | leah2 quits (~leah@vuxu.org) (Ping timeout: 260 seconds) |
| 20:38:26 | × | king_gs quits (~Thunderbi@187.201.110.169) (Ping timeout: 272 seconds) |
| 20:38:50 | × | kuribas quits (~user@ptr-17d51eobge4k180xjsg.18120a2.ip6.access.telenet.be) (Remote host closed the connection) |
| 20:39:09 | → | perrierjouet joins (~perrier-j@modemcable048.127-56-74.mc.videotron.ca) |
| 20:46:08 | × | eggplantade quits (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 20:47:58 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:780a:3a53:75ea:e01e) |
| 20:50:25 | → | leah2 joins (~leah@vuxu.org) |
| 20:51:11 | → | nasrudin__ joins (~nasrudin_@81.171.62.8) |
| 20:54:44 | → | freeside joins (~mengwong@103.252.202.159) |
| 21:00:52 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:780a:3a53:75ea:e01e) (Remote host closed the connection) |
| 21:01:40 | → | titibandit joins (~titibandi@xdsl-89-0-163-79.nc.de) |
| 21:08:03 | × | abhixec quits (~abhinav@c-67-169-139-16.hsd1.ca.comcast.net) (Ping timeout: 268 seconds) |
| 21:10:31 | × | Kaiepi quits (~Kaiepi@nwcsnbsc03w-47-55-159-86.dhcp-dynamic.fibreop.nb.bellaliant.net) (Ping timeout: 268 seconds) |
| 21:15:05 | × | sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.) |
| 21:16:45 | → | sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 21:18:27 | → | wroathe joins (~wroathe@207-153-38-140.fttp.usinternet.com) |
| 21:18:27 | × | wroathe quits (~wroathe@207-153-38-140.fttp.usinternet.com) (Changing host) |
| 21:18:27 | → | wroathe joins (~wroathe@user/wroathe) |
| 21:18:27 | × | nasrudin__ quits (~nasrudin_@81.171.62.8) (Read error: Connection reset by peer) |
| 21:19:10 | → | nasrudin__ joins (~nasrudin_@81.171.62.8) |
| 21:23:34 | × | justsomeguy quits (~justsomeg@user/justsomeguy) (Ping timeout: 252 seconds) |
| 21:27:43 | → | mikoto-chan joins (~mikoto-ch@2001:999:404:e3fe:180c:9642:5d86:5844) |
| 21:35:38 | <eldritchcookie[4> | how can i in a polymophic instance contrain so that the type isn't a function one so no types like a -> b |
| 21:36:22 | <nasrudin__> | Anyone here have intuitions about prepromorphisms? |
| 21:37:24 | <[exa]> | eldritchcookie[4: doing negation in constructive logic is pretty hard, but you can instead ask for some proof of property that the functions don't really have, like runtime representability (perhaps Data or so) |
| 21:38:12 | <[exa]> | (Data is probably a bad example but I imagine GHC base would have something relatable) |
| 21:38:59 | <[exa]> | nasrudin__: kinda. Don't ask to ask, just ask. :D |
| 21:39:45 | <nasrudin__> | Two questions about prepromorphisms: |
| 21:39:45 | <nasrudin__> | 1) Is there a good reason why the natural transformation of a prepromorphism isn't allowed to change the functor between its input and its output? |
| 21:39:45 | <nasrudin__> | 2) What are some motivations for prepromorphisms? In the context of recursion schemes and DSLs, I'd guess they might correspond to any kind of AST-to-AST transformation we might do before a fold, but again this makes me wonder why the natural transformation isn't allowed to change functors... |
| 21:41:30 | <[exa]> | the best answer I'd have is basically from here https://stackoverflow.com/a/47466960/1043097 |
| 21:43:51 | × | elevenkb quits (~elevenkb@105.224.37.128) (Quit: Client closed) |
| 21:44:23 | <eldritchcookie[4> | my th generates this code... (full message at <https://libera.ems.host/_matrix/media/v3/download/libera.chat/91968220574a592e755bc3f6d9b831ed8dd874f5>) |
| 21:46:12 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 272 seconds) |
| 21:48:13 | → | Kaiepi joins (~Kaiepi@nwcsnbsc03w-47-55-159-86.dhcp-dynamic.fibreop.nb.bellaliant.net) |
| 21:54:51 | <[exa]> | nasrudin__: did you check fokkinga's thesis? http://maartenfokkinga.github.io/utwente/mmfphd.pdf |
| 21:55:36 | <[exa]> | I'm not sure if the natural transformation requirement is implied there, just structure preservation (so that the whole thing is uniquely defined) |
| 21:56:04 | <nasrudin__> | Unfortunately, I can't follow much from his thesis |
| 21:56:31 | <nasrudin__> | (for now) |
| 21:57:59 | ← | jakalx parts (~jakalx@base.jakalx.net) (Error from remote client) |
| 22:01:22 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:780a:3a53:75ea:e01e) |
| 22:02:11 | × | motherfsck quits (~motherfsc@user/motherfsck) (Ping timeout: 260 seconds) |
| 22:04:50 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 22:05:24 | × | ddellacosta quits (~ddellacos@86.106.143.57) (Ping timeout: 268 seconds) |
| 22:05:41 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:780a:3a53:75ea:e01e) (Ping timeout: 246 seconds) |
| 22:06:19 | <[exa]> | nasrudin__: like, me neither. :] |
| 22:07:14 | <[exa]> | btw there was another #haskell-something channel for discussing highly theoretical stuff, try playing with /list |
| 22:07:51 | <nasrudin__> | O_O |
| 22:07:55 | <nasrudin__> | that sounds perfect |
| 22:07:58 | <nasrudin__> | thanks! |
| 22:08:25 | <[exa]> | might have been #haskell-in-depth |
| 22:08:59 | <[exa]> | less chance that the question gets lost in scrollback before the venerable gurus see it |
| 22:09:52 | <geekosaur> | yeh, that was the original intent of #haskell-in-depth |
| 22:10:09 | <geekosaur> | sadly it only got used that way a few times, and then all the deep stuff moved back in here |
| 22:10:46 | <[exa]> | I'd still try. :D |
| 22:14:15 | × | fserucas quits (~fserucas@2001:818:e376:a400:fb92:70c1:dd88:c7d7) (Ping timeout: 252 seconds) |
| 22:18:14 | <cameron_> | https://pastebin.com/EW1RVFHS |
| 22:18:22 | <cameron_> | now i got chatgpt to make a lisp interpreter using lisp |
| 22:19:31 | <monochrom> | Hrm maybe I should lurk in #haskell-in-depth too... |
| 22:21:57 | → | Guest71 joins (~Guest71@81-224-186-223-no2000.tbcn.telia.com) |
| 22:22:27 | × | mikoto-chan quits (~mikoto-ch@2001:999:404:e3fe:180c:9642:5d86:5844) (Ping timeout: 256 seconds) |
| 22:23:53 | <Guest71> | Hi I have custom built ghc on a server machine and where I build my project. The cabal.project file has a `with-compiler` flag to pick up the custom GHC. However, now that i am developing on my local machine, I have to remove the cabal.project everytime I want to build anything. Is there some cabal.project clause I can use to conditionally build it |
| 22:24:12 | <Guest71> | I attempted to use a flag |
| 22:24:39 | <Guest71> | something like `if flag(server)....` and have the with-compiler field there |
| 22:24:51 | <Guest71> | but I got this error message "Cannot set compiler in a conditional clause of a cabal project file" |
| 22:25:56 | <Guest71> | This is version 3.8.1.0 of cabal |
| 22:26:11 | <geekosaur> | #hackage might be helpful with that |
| 22:26:15 | <sclv> | Guest71: set the custom compiler in a cabal.project.local specific to the server machine |
| 22:26:54 | <Guest71> | and not check it in my git repo right? |
| 22:27:02 | <Guest71> | is that the standard workflow? |
| 22:27:03 | <sclv> | you can't set the compiler in a conditional clause because A) cabal.project files don't take flags and B) conditional clauses can have _tests_ on compilers |
| 22:27:04 | <sclv> | Guest71: yep |
| 22:27:24 | <sclv> | if something is only for one or another specific machine, it goes in a cabal.project.local |
| 22:27:35 | <sclv> | You also can pass in a flag to cabal to pick which cabal project you use. |
| 22:27:46 | <sclv> | conditionals in cabal project files are specifically for casing on compiler and architecture. |
| 22:27:48 | <Guest71> | hmm I occasionally want to share my cabal.project files with my coworkers |
| 22:27:59 | × | mizlan quits (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 260 seconds) |
| 22:28:02 | <sclv> | Well you can share everything else in your cabal.project file with them! |
| 22:28:22 | <sclv> | cabal considers the union of the cabal.project and the cabal.project.local file |
| 22:28:36 | <Guest71> | "you also can pass in a flag to cabal to pick which cabal project you use" -> this would be nice as well |
| 22:29:07 | <sclv> | "cabal build --project-file=MYFILE" |
| 22:29:09 | <Guest71> | could you tell me what flag I need to pass to cabal to give it a cabal.project file in the command line |
| 22:29:13 | <Guest71> | sweet |
| 22:30:45 | × | thyriaen quits (~thyriaen@2a01:aea0:dd4:4bae:6245:cbff:fe9f:48b1) (Quit: Leaving) |
| 22:31:40 | <Guest71> | thanx! |
| 22:32:01 | <monochrom> | That one is discoverable from "cabal build --help". |
| 22:36:05 | × | Guest71 quits (~Guest71@81-224-186-223-no2000.tbcn.telia.com) (Quit: Client closed) |
| 22:37:12 | × | gnalzo quits (~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c) (Quit: WeeChat 3.7.1) |
| 22:37:56 | → | erisco joins (~erisco@d24-141-66-165.home.cgocable.net) |
| 22:39:35 | → | mizlan joins (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) |
| 22:43:16 | → | unit73e joins (~emanuel@2001:818:e8dd:7c00:656:e5ff:fe72:9d36) |
| 22:44:28 | × | mizlan quits (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 272 seconds) |
| 22:47:14 | <unit73e> | not sure if it's just me, but that very useful "wish I knew when learning haskell" is often down. downloaded the pdf. |
| 22:47:44 | <[exa]> | unit73e: it's on github right? (is github down again? :D ) |
| 22:48:19 | <unit73e> | [exa], it is indeed in github and it's not down lol |
| 22:48:23 | <geekosaur> | someone was reporting ddg down earlier, I wonder if there's a network "event" of some kind |
| 22:48:28 | <unit73e> | it's just the official site is convenient |
| 22:49:23 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds) |
| 22:49:52 | <unit73e> | we're still in crazy clown world so maybe there was an "event" |
| 22:50:00 | <unit73e> | who knows? |
| 22:50:13 | <unit73e> | pick your clown, doesn't matter much |
| 22:56:43 | × | notzmv quits (~zmv@user/notzmv) (Ping timeout: 248 seconds) |
| 22:56:53 | → | mizlan joins (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) |
| 22:57:19 | → | merijn joins (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) |
| 23:03:28 | × | freeside quits (~mengwong@103.252.202.159) (Ping timeout: 272 seconds) |
| 23:06:09 | → | motherfsck joins (~motherfsc@user/motherfsck) |
| 23:06:12 | × | bgs quits (~bgs@212-85-160-171.dynamic.telemach.net) (Remote host closed the connection) |
| 23:10:30 | → | notzmv joins (~zmv@user/notzmv) |
| 23:11:23 | × | biberu quits (~biberu@user/biberu) (Read error: Connection reset by peer) |
| 23:11:24 | <intelligent_boat> | if I ask "what are THE BEST MONADS" that would be an unanswerable question, I know, so let me try to make the question better... what are some useful monads to know about? things like state, writer, reader. I used State to do some advent of code problems. I don't usually write much Haskell otherwise. so, stuff useful to beginner |
| 23:12:29 | × | takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection) |
| 23:14:57 | <monochrom> | My favourites are [], Maybe, Either e, (->) e, Cont r. There may be more. |
| 23:15:42 | <monochrom> | You already listed State and Writer. They are my favourites too. |
| 23:15:54 | → | biberu joins (~biberu@user/biberu) |
| 23:16:09 | → | gurkenglas joins (~gurkengla@p548ac72e.dip0.t-ipconnect.de) |
| 23:16:20 | → | freeside joins (~mengwong@103.252.202.159) |
| 23:17:18 | <monochrom> | My favourite though anti-climatic theorem (so it generates infinitely many favourite monads) is this: Every representable functor is a monad. |
| 23:17:56 | <monochrom> | And that's just because "my functor is represented by Foo" just means "my functor is equivalent to (->)Foo". |
| 23:18:03 | <Rembane> | monochrom: Are all monads your favorites? |
| 23:18:44 | <monochrom> | So this gives for example "data P a = P a a" (represented by Bool) and "data S a = S a (S a)" (represented by Natural). |
| 23:19:13 | <monochrom> | You know, so far, every monad I have met is a favourite. :) |
| 23:19:53 | <Rembane> | :) |
| 23:22:27 | <monochrom> | But if you suspect that some of them get me more excited than others, yes, I'm very much more excited by Cont, probability monads, and sometimes (->)Foo. |
| 23:23:35 | <monochrom> | There was a time I was excited by parser monads. Now it's merely useful. |
| 23:23:54 | → | jmorris joins (uid537181@id-537181.uxbridge.irccloud.com) |
| 23:27:07 | × | titibandit quits (~titibandi@xdsl-89-0-163-79.nc.de) (Remote host closed the connection) |
| 23:29:09 | <Rembane> | I'm still in the fascination phase with parser monads. They make me happy every time I use them. |
| 23:29:12 | <intelligent_boat> | haven't gotten a chance to look into parsing much, usually just making do with lines/words for advent of code |
| 23:29:27 | <intelligent_boat> | maybe should look at them some day |
| 23:31:47 | × | merijn quits (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) (Ping timeout: 260 seconds) |
| 23:36:52 | <mauke> | I've used https://hackage.haskell.org/package/base-4.17.0.0/docs/Text-ParserCombinators-ReadP.html all throughout AoC |
| 23:36:53 | <mauke> | would recommend |
| 23:54:43 | × | Tuplanolla quits (~Tuplanoll@91-159-68-152.elisa-laajakaista.fi) (Quit: Leaving.) |
| 23:55:06 | → | merijn joins (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) |
| 23:57:48 | → | Lycurgus joins (~juan@user/Lycurgus) |
| 23:59:47 | × | merijn quits (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) (Ping timeout: 260 seconds) |
All times are in UTC on 2023-01-02.