Home liberachat/#haskell: Logs Calendar

Logs on 2022-04-21 (liberachat/#haskell)

00:00:12 <Guest91> One other thing I did notice while messing around with the cabal that ghcup gave me: the --enable-tests and --run-tests flags no longer worked for things I told cabal to install.  Is that something that works again in the latest version of cabal, or is that set of flags now repurposed?
00:00:15 × littlebobeep quits (~alMalsamo@gateway/tor-sasl/almalsamo) (Ping timeout: 240 seconds)
00:00:44 × redb quits (~nmh@136.49.49.211) (Ping timeout: 250 seconds)
00:00:46 <sclv> old behavior is with v1-install
00:00:54 × jerry99 quits (~339ea683@cerf.good1.com) (Quit: CGI:IRC (Ping timeout))
00:00:59 <sclv> new behavior is a totally different workflow.
00:01:02 <Guest91> OK, guess I'll be using v1-install a lot then.
00:01:24 <sclv> right. new is an extremely per-user workflow
00:01:46 <Guest91> Or is there a way in the new workflow to get the test suites to run for the thing I'm installing and all the deps too?
00:01:51 <sclv> you should warn the prof that in a few years we will be new behavior only
00:02:03 <Guest91> Will do.
00:02:12 redb joins (~nmh@136.49.49.211)
00:02:33 <sclv> in the new workflow “installing” a lib is a fiction. its project based and manages lib deps behind the scenes
00:02:34 <Guest91> Also, I fear that if I'm doing this again in four years, I may end up bald from ripping out my own hair.
00:02:58 <Guest91> Ooof.  No obvious way to work with a central setup there at all.
00:03:21 <sclv> they should move to a teaching plan based on projects with fixed deps, and not try to centrally manage libs
00:03:43 <sclv> it doesn’t make things pedagogically harder, and teaches a modern approach
00:03:44 × xff0x_ quits (~xff0x@om126194210237.10.openmobile.ne.jp) (Read error: Connection reset by peer)
00:04:08 <geekosaur> note that a stack resolver or a cabal freeze file will do almost all of what your prof wants, and both work with a modern workflow
00:04:33 stackdroid18 parts (14094@user/stackdroid) ()
00:04:36 <Guest91> Got bit years ago like that with Ruby when CVE-2009-1904 dropped and one web app we had was carrying around its own version of every gem instead of using system ones.  We ended up just killing the app outright.
00:04:39 <sclv> Or just giving a skeleton project with the deps already fixed
00:04:49 <sclv> just have the students git clone it and off they fo
00:05:59 <geekosaur> Guest91, you'd be bitten by that with Haskell anyway because of cross-module inlining
00:06:15 <geekosaur> even if you replace the global one you *still* have to recompile everything that uses it
00:06:26 <Guest91> Hah, I am warned.  So far nobody's tried putting up Haskell code on the web server, though.
00:07:57 jerry99 joins (~339ea102@cerf.good1.com)
00:08:04 <Guest91> Python, Ruby, Perl, PHP, JavaScript, sure.  No Haskell.
00:08:09 × abiss27 quits (~abiss27@user/abiss) (Quit: hasta la vista... tchau!)
00:10:39 × gurkenglas quits (~gurkengla@dslb-178-012-018-212.178.012.pools.vodafone-ip.de) (Ping timeout: 240 seconds)
00:15:21 × chomwitt quits (~chomwitt@2a02:587:dc1b:da00:41cd:5357:91a5:6) (Ping timeout: 248 seconds)
00:16:31 <Guest91> Thanks for all the help and pointers.  I'm going to leave this build of 8.6.5 running and pick up tomorrow.
00:17:40 × pretty_dumm_guy quits (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Quit: WeeChat 3.5)
00:17:43 × ralu1 quits (~ralu@static.211.245.203.116.clients.your-server.de) (Ping timeout: 256 seconds)
00:19:22 × mvk quits (~mvk@2607:fea8:5ce3:8500::46a8) (Ping timeout: 250 seconds)
00:21:44 × euandreh quits (~euandreh@2804:14c:33:9fe5:2165:73d6:1630:f174) (Ping timeout: 260 seconds)
00:31:36 × machinedgod quits (~machinedg@24.105.81.50) (Ping timeout: 276 seconds)
00:36:57 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
00:38:25 wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com)
00:38:26 × wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host)
00:38:26 wroathe joins (~wroathe@user/wroathe)
00:40:56 deadmarshal_ joins (~deadmarsh@95.38.229.55)
00:41:37 <monochrom> The problem with cabal/stack-project-based at school for student accounts is that schools give student accounts very limited disk quota.
00:41:57 <monochrom> I have had students exceeding disk quota just by a "cabal update".
00:42:44 <monochrom> The error message did not say that either, too.
00:43:34 <monochrom> Multiple students got that problem before the nth one cleverly discovered it was a "disk out of space" error.
00:45:25 <monochrom> My solution for now is that I don't involve anything that doesn't come with GHC. Hell I rolled my own unit-test library and include it in every assignment. "cabal repl --build-depends HUnit" is out of the question, see above.
00:45:54 × deadmarshal_ quits (~deadmarsh@95.38.229.55) (Ping timeout: 276 seconds)
00:46:05 <sclv> gak
00:46:21 <sclv> nix would work but its awful heavyweight
00:47:09 <monochrom> My previous solution was I did manual dependency chasing for HUnit and prepared a zip file containing HUnit's tarball, its dependencies' tarballs, and a shell script. The shell script called "runghc Setup.hs build/copy/register" in the right order. At least it took much less disk space.
00:47:34 <sclv> i think that a "local hackage" would be like that but nicer
00:47:37 <monochrom> I am not my school's sysadmin, I cannot just decree "nix".
00:48:06 <sclv> there's a tool that's in development iirc that makes bundling up a "local hackage" easier
00:48:37 <sclv> students would still have the hit of building at least once the libs they needed and the on-disk binary cost of that
00:48:53 <sclv> but thats much smaller than the footprint of a full 01-index tarball
00:50:55 × mmhat quits (~mmh@55d4917e.access.ecotel.net) (Quit: WeeChat 3.5)
00:52:36 <dolio> Isn't cabal v1-update going to blow up the disks, too?
00:53:08 <dolio> It's the same list of packages.
00:53:12 <sclv> with a local hackage it won't :-)
00:53:25 × lbseale quits (~ep1ctetus@user/ep1ctetus) (Read error: Connection reset by peer)
00:53:32 <sclv> otherwise i think the idea is all these other solutions avoid ever having to update, by having all the packages distributed directly
00:53:33 <dolio> Well, right.
00:53:33 euandreh joins (~euandreh@2804:14c:33:9fe5:2165:73d6:1630:f174)
00:53:58 <dolio> Yeah, you can use a project file with all the dependencies in a repo or something.
00:54:32 <dolio> Presumably.
00:59:20 <jackdk> monochrom: yeah, this disk quota issue will become a serious problem for teaching Haskell soon, unless you want to confine yourself to included packages.
00:59:55 xff0x_ joins (~xff0x@125x102x200x106.ap125.ftth.ucom.ne.jp)
01:00:48 <jackdk> dolio: The way one academic institution did this was the lab base image did a bunch of cabal v1-install of everything the courses needed at start of semester, all at once, and this provided packages in the global db so cabal v2-install would solve and find them
01:01:41 yauhsien joins (~yauhsien@61-231-27-3.dynamic-ip.hinet.net)
01:01:58 × kristjansson quits (sid126207@id-126207.tinside.irccloud.com) (Excess Flood)
01:02:20 kristjansson joins (sid126207@id-126207.tinside.irccloud.com)
01:02:22 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
01:04:14 dmenz joins (~dmenz@2804:14d:5cd4:8125:9e31:dbe9:5043:1a2e)
01:04:33 <abastro[m]> Oh, Haskell build tool is still not ideal
01:04:50 × jerry99 quits (~339ea102@cerf.good1.com) (Quit: CGI:IRC)
01:05:09 jerry99 joins (~339ea102@cerf.good1.com)
01:05:20 <abastro[m]> Btw can I maintain a cabal store independent of user?
01:05:41 <abastro[m]> So that I would have other users capable of accessing it
01:06:05 <monochrom> cabal assumes write permissions fundamentally.
01:06:38 <abastro[m]> Ouch
01:07:08 <monochrom> Hell, cabal assumes single user fundamentally.
01:07:33 <abastro[m]> Why is cabal so bas
01:07:36 cesar- joins (~cesar@2600:1700:9490:79f0::f)
01:07:39 × yauhsien quits (~yauhsien@61-231-27-3.dynamic-ip.hinet.net) (Remote host closed the connection)
01:07:40 <abastro[m]> s/bas/bad
01:08:05 <abastro[m]> It somewhat wastes disk spaces
01:08:23 <jackdk> Because package management is a hard problem
01:08:45 yauhsien joins (~yauhsien@61-231-27-3.dynamic-ip.hinet.net)
01:08:59 <abastro[m]> At least ability to link the built packages would be great..
01:09:22 <sclv> a read only store is perfectly reasonable
01:09:34 <sclv> there’s just some manual plumbing involved
01:10:14 <abastro[m]> Wish "Read only stores linked from personal store" was easier
01:10:26 × dmenz quits (~dmenz@2804:14d:5cd4:8125:9e31:dbe9:5043:1a2e) (Quit: Leaving)
01:11:23 vysn joins (~vysn@user/vysn)
01:11:28 <abastro[m]> If haskell had more manpower, cabal would not be in such a state, right?
01:11:36 <abastro[m]> I heard of how great rust package manager is
01:12:12 <sclv> there’s virtually no demand for the thing you’re asking for
01:12:18 werneta joins (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
01:12:59 <sclv> academic labs are a very strange and particular case. it would be good to support them better, but its not a normal development workfloe
01:13:23 <abastro[m]> Well, I mean, even I want to limit disk space usage
01:13:33 <monochrom> 01-index.tar is the fundamental bottleneck. (Build products are dwarved by that.) I don't know that cargo or pip or gem... are really doing better there.
01:13:54 <sclv> but what you are asking for is unrelated to single user disk usage
01:13:55 <abastro[m]> Oh?
01:13:59 <abastro[m]> How big is 01-index.tar
01:14:30 × yauhsien quits (~yauhsien@61-231-27-3.dynamic-ip.hinet.net) (Ping timeout: 276 seconds)
01:14:36 <abastro[m]> I thought built packages take the most of the space
01:14:40 <abastro[m]> But index file?
01:14:44 <sclv> a fixed shared store is about one computer with Many users
01:14:47 × neurocyte8614492 quits (~neurocyte@user/neurocyte) (Ping timeout: 240 seconds)
01:15:20 <abastro[m]> Yep
01:15:31 <sclv> no modern compiled language goes easy on disk afaik.
01:15:49 <abastro[m]> I mean
01:15:54 <davean> abastro[m]: Why do you think this isn't how all the other ones work?
01:15:56 <sclv> and arguably even noncompiled languages get nutty with large dep trees
01:16:06 <abastro[m]> One could perhaps have one for each computer
01:16:42 <sclv> one what? one store? if you have a single user on each computer, you Do
01:16:54 <abastro[m]> And then one computer for many users shared
01:17:05 <sclv> *facepalm*
01:17:20 <abastro[m]> I mean, why would disk quotas be small here
01:17:51 <abastro[m]> Isn't it because each computer is shared by lots of users?
01:18:25 <sclv> Yes. and as i said a teaching lab is a unique case, not common to any standard modern development env
01:18:58 <abastro[m]> Sorry but could you explain more about teaching lab?
01:19:12 andrey joins (~andrey@p200300dbcf0d4c00ca7da127e9eab0e0.dip0.t-ipconnect.de)
01:19:45 <abastro[m]> I thought of a typical cloud environment running on server where each computers are shared by many users
01:19:56 <abastro[m]> Guess this case is a bit different?
01:20:09 <sclv> a typical cloud env is nothing like that
01:20:29 <abastro[m]> Eh?
01:20:49 <abastro[m]> I mean, it's not like one user is assigned entire computer
01:21:10 <sclv> the “cloud” usually gives individual users/orgs an entire virtual computer that secretly is running on shared hardware
01:21:28 × andrey_ quits (~andrey@p200300dbcf0690007a1a8916775a33e5.dip0.t-ipconnect.de) (Ping timeout: 248 seconds)
01:21:30 <sclv> you don’t have a linux install with 100+ accounts able to login
01:21:43 <abastro[m]> Yea
01:21:44 <abastro[m]> Yep.. oh wait
01:21:44 <abastro[m]> Isn't it the same situation?
01:21:46 <abastro[m]> Oh right
01:21:49 <abastro[m]> Wait
01:22:08 <abastro[m]> Isn't virtualization exactly for this thing
01:23:17 <abastro[m]> Virtual computer giving illusion of owning the computer when it doesn't, actually.
01:23:59 <monochrom> Here is the real difference between cloud and school student account:
01:24:56 <monochrom> The cloud gives you 100GB disk space and charges you I don't know a hundred dollars per year maybe.
01:25:04 <abastro[m]> Now I realized what you mean, so in the academic lab, one computer OS comes with many users... whhhh
01:25:24 <monochrom> The schoold gives you 100MB disk space and charges you I don't know ten thousand dollars per year maybe. >_<
01:25:32 <sclv> lmao
01:25:58 <abastro[m]> Wat
01:25:59 <abastro[m]> Ten thousands lul
01:26:15 <abastro[m]> "We don't have that money, it needs to go into constructing buildings"
01:26:24 <abastro[m]> Tho I think lots of startups begin with free version which doesn't give much disk space
01:26:39 <monochrom> I think it's 7000 cdn$ in Canadian universities. And the US is strictly more expensive.
01:26:42 <abastro[m]> Also free versions does provide like 10GB at least
01:26:55 <abastro[m]> Or was ir 100GB
01:26:59 <abastro[m]> Now I guess I see
01:27:16 <abastro[m]> Disk spaces are cheap but uni cannot somehow afford it. Wow?
01:27:56 <abastro[m]> (I thought my uni was more conventional, it often gives us 10GB disk space at least as well. Enough to run small haskell project)
01:28:00 <sclv> Willing to bet that cloud providers somehow have fewer middle manager administrators than campuses these days
01:28:23 <monochrom> Anyway it's somewhat below $10k in Canada and somewhat above $10k in US so let's say the "average" is $10k heh. (yay ballparks.)
01:29:00 <monochrom> To be fair, $10k at a university also buys you courses, not just a computer account.
01:29:17 <monochrom> Right? I want to make money too!
01:29:36 <monochrom> And my TAs want to make money too.
01:29:42 <monochrom> It all adds up quickly.
01:30:04 <monochrom> But I just like the comedy of comparing cloud with school accounts >:)
01:32:55 × xkuru quits (~xkuru@user/xkuru) (Read error: Connection reset by peer)
01:33:19 × vysn quits (~vysn@user/vysn) (Ping timeout: 240 seconds)
01:35:13 × [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Ping timeout: 246 seconds)
01:35:53 × Me-me quits (~me-me@v.working.name) (Quit: Disconnecting on purpose.)
01:35:57 AlexNoo_ joins (~AlexNoo@178.34.161.31)
01:36:22 Me-me joins (~me-me@tunnel690570-pt.tunnel.tserv12.mia1.ipv6.he.net)
01:37:07 × AlexNoo quits (~AlexNoo@178.34.161.31) (Read error: Connection reset by peer)
01:37:25 <abastro[m]> Well you do need to state the problematic side
01:37:32 <abastro[m]> BUILDINGS!!
01:37:39 <abastro[m]> More Buildings!!!
01:37:47 abastro[m] sigh
01:37:54 × Me-me quits (~me-me@tunnel690570-pt.tunnel.tserv12.mia1.ipv6.he.net) (Changing host)
01:37:54 Me-me joins (~me-me@user/me-me)
01:38:16 <abastro[m]> Once heard 40~50% of uni budget goes into buildings
01:39:33 [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470)
01:43:18 littlebobeep joins (~alMalsamo@gateway/tor-sasl/almalsamo)
01:45:46 ralu1 joins (~ralu@static.211.245.203.116.clients.your-server.de)
01:45:56 × vicfred quits (~vicfred@user/vicfred) (Quit: Leaving)
01:51:25 × TonyStone quits (~TonyStone@cpe-74-76-51-197.nycap.res.rr.com) (Remote host closed the connection)
01:54:51 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
01:56:25 TonyStone joins (~TonyStone@2603-7080-8607-c36a-e10b-aeba-a8b3-e9aa.res6.spectrum.com)
01:57:39 abastro joins (~abab9579@220.75.216.63)
01:59:01 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 246 seconds)
01:59:21 × oxide quits (~lambda@user/oxide) (Ping timeout: 276 seconds)
02:00:35 × ec quits (~ec@gateway/tor-sasl/ec) (Ping timeout: 240 seconds)
02:01:01 oxide joins (~lambda@user/oxide)
02:01:36 × waleee quits (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Ping timeout: 260 seconds)
02:01:52 × EvanR quits (~EvanR@user/evanr) (Quit: Leaving)
02:03:48 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
02:06:23 × Guest91 quits (~Guest91@caliga.eecs.tufts.edu) (Quit: Client closed)
02:12:35 <janus> abastro[m]: doesn't seem like that is true for iowa: https://fmb.fo.uiowa.edu/university-wide-budgeted-expenditures-fy2020
02:12:47 × earthy quits (~arthurvl@2001:984:275b:1:ba27:ebff:fea0:40b0) (Ping timeout: 260 seconds)
02:13:10 [Leary] joins (~Leary]@122-58-90-96-vdsl.sparkbb.co.nz)
02:13:21 <janus> BLDG RENEWAL is part of the red 2.5% at the bottom
02:13:21 <abastro> Oh, TIL that was regional one.
02:13:38 <abastro> Interesting that how salaries are of huge portion there
02:14:03 <abastro> Perhaps higher salary standard affecting?
02:14:11 × JordiGH quits (~jordi@user/jordigh) (Ping timeout: 260 seconds)
02:17:30 × oxide quits (~lambda@user/oxide) (Quit: oxide)
02:17:54 oxide joins (~lambda@user/oxide)
02:18:12 × jinsun__ quits (~jinsun@user/jinsun) (Ping timeout: 276 seconds)
02:18:47 frost joins (~frost@user/frost)
02:18:59 aman_ joins (~aman@user/aman)
02:20:10 JordiGH joins (~jordi@user/jordigh)
02:22:12 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
02:25:17 <Axman6> Universities literally exist to emply people to do research, so it's no surprise their major expenditure is salaries
02:25:36 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija)))
02:25:36 finn_elija joins (~finn_elij@user/finn-elija/x-0085643)
02:25:36 finn_elija is now known as FinnElija
02:26:20 lifter joins (~lifter@2600:1702:37d0:4310:10d9:2213:a793:979a)
02:26:22 earthy joins (~arthurvl@2a02-a469-f5e2-1-ba27-ebff-fea0-40b0.fixed6.kpn.net)
02:28:35 <lifter> Am I correct that there really isn't a practical application of the "fix" function given that there is nothing you can do with "fix" that you cannot accomplish by some other, more idiomatic means?
02:28:38 × Hash quits (~Hash@hey.howstoned.ru) (Read error: Connection reset by peer)
02:30:18 Hash joins (~Hash@hey.howstoned.ru)
02:30:48 <Axman6> it's just a convenience function, it's Haskell equivalent of the Y-combinator
02:31:23 <Axman6> sometimes you don't want to name a function to make a recursive function, and that's exactly what fix allows you to do
02:31:51 <lifter> Ah OK I can see that I think.
02:31:51 <Axman6> let f x = ... f ... === fix (\f x -> ...f ...)
02:33:12 <lifter> Well you've still named your recursive function "f", right?
02:33:46 <Axman6> only within the lambda - f is not a name that is useable by any other code
02:34:33 <dolio> > fix ?? 5 $ \fac n -> if n == 0 then 1 else n * fac (n-1)
02:34:35 <lambdabot> 120
02:35:08 <Axman6> > fix ('a':) -- recursion without having to use any names at all
02:35:10 <lambdabot> "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
02:35:22 × tcard quits (~tcard@p2878075-ipngn18701hodogaya.kanagawa.ocn.ne.jp) (Quit: Leaving)
02:35:28 <lifter> I'm aware of those examples. Just searching for a practical application.3
02:35:51 <dolio> That is a practical example.
02:35:56 Sgeo_ joins (~Sgeo@user/sgeo)
02:36:01 <dolio> They define macros in Scheme for that.
02:36:26 <Axman6> but like many functions in the prelude, fix is just a convenience for those times when it makes sense to use, just like flip, const, ap, id (hmmm, I wonder of those are turing complete...)
02:36:37 <lifter> I mean you could just do `['a','a'..]`
02:36:40 × JordiGH quits (~jordi@user/jordigh) (Ping timeout: 248 seconds)
02:36:46 <dibblego> why use map f instead of foldr ((:) . f) []? Just searching for a practical application of map
02:36:56 <Axman6> that actually produces a different value in memory
02:36:57 <zzz> dolio: what's the `??` ?
02:37:06 <dolio> It's infix flip.
02:37:30 <Axman6> the fix version is a self recursive list, whereas the ['a','a'..] version will build up a larger and larger list as more of it is avaluated
02:37:55 × oxide quits (~lambda@user/oxide) (Quit: oxide)
02:38:14 <Axman6> so, while those values are Eq equivalent, they do actually behave differently
02:38:43 <lifter> Hmm I don't quite understand the distinctino.
02:38:45 <Axman6> > let as = 'a':as in as -- the tail of the list literally points to itself
02:38:46 <lambdabot> "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
02:38:52 oxide joins (~lambda@user/oxide)
02:39:00 × Sgeo quits (~Sgeo@user/sgeo) (Ping timeout: 276 seconds)
02:39:26 <Axman6> in ['a','a'..], each cons cell is distinct, they are not the same location in memory
02:39:47 <lifter> Well OK I can see that what's happening under the hood is different. Wow that's pretty wild.
02:40:09 <Axman6> @src repeat
02:40:09 <lambdabot> repeat x = xs where xs = x : xs
02:40:29 <Axman6> if you had used repeat the result is identical to the fix version
02:40:39 <Axman6> repeat x = fix (x:)
02:41:00 <lifter> OK that's interesting.
02:41:49 <Axman6> if you think about it in terms of C, it's like having a linked list struct which points to itself
02:43:45 <Sgeo_> Is there a name for the concept that s -> a is the same as (a->r)->s->r? Something with continuations or continuation passing style?
02:44:28 <dolio> The Yoneda lemma.
02:44:49 <Axman6> yoneda a bigger lemma
02:45:31 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
02:46:01 <Sgeo_> Thank you
02:46:50 × oxide quits (~lambda@user/oxide) (Quit: oxide)
02:47:10 oxide joins (~lambda@user/oxide)
02:48:02 × oxide quits (~lambda@user/oxide) (Client Quit)
02:48:47 oxide joins (~lambda@user/oxide)
02:50:03 × oxide quits (~lambda@user/oxide) (Client Quit)
02:50:32 oxide joins (~lambda@user/oxide)
02:51:06 aman_ is now known as aman
02:56:54 × oxide quits (~lambda@user/oxide) (Quit: oxide)
02:57:40 <jackdk> I use `fix` often in monadic code like `fix $ \loop -> do ...`, in things like socket handlers
03:01:40 oxide joins (~lambda@user/oxide)
03:02:11 JordiGH joins (~jordi@user/jordigh)
03:05:03 × oxide quits (~lambda@user/oxide) (Client Quit)
03:05:29 oxide joins (~lambda@user/oxide)
03:08:35 <lifter> jackdk: Yeah that's a neat example, thanks!
03:09:43 <jackdk> lifter: yw. I sometimes find it nicer than the combinators in `monad-loops`, as you let control fall out the bottom of the function when you're done
03:23:56 <Axman6> I wonder how hard it would be to write something which gives you the same semantics for looping as continue, break etc. in other languages; loop \continue break -> do ... when done break; when shouldSkip continue; ...
03:24:13 <Axman6> feels doable using Cont(T)
03:26:09 <Axman6> https://hackage.haskell.org/package/loops-0.2.0.2/docs/Control-Monad-Loop.html
03:27:27 × JordiGH quits (~jordi@user/jordigh) (Ping timeout: 260 seconds)
03:27:52 × pavonia quits (~user@user/siracusa) (Quit: Bye!)
03:30:46 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
03:31:44 yauhsien joins (~yauhsien@61-231-27-3.dynamic-ip.hinet.net)
03:32:38 × cesar- quits (~cesar@2600:1700:9490:79f0::f) (Ping timeout: 250 seconds)
03:33:30 tcard joins (~tcard@p2878075-ipngn18701hodogaya.kanagawa.ocn.ne.jp)
03:35:58 × yauhsien quits (~yauhsien@61-231-27-3.dynamic-ip.hinet.net) (Ping timeout: 246 seconds)
03:50:05 × wyrd quits (~wyrd@gateway/tor-sasl/wyrd) (Quit: leaving)
03:58:29 × oxide quits (~lambda@user/oxide) (Quit: oxide)
03:58:56 oxide joins (~lambda@user/oxide)
04:00:50 CodeKiwi is now known as DigitalKiwi
04:01:01 <albet70> how you pronounce >=>?
04:01:13 <dolio> That's a fish.
04:01:20 <dibblego> "are you gonna go my way?"
04:02:12 <albet70> so f >=> g is f fish g?
04:02:42 <dibblego> are you, f, gonna go my, g, way?
04:02:57 × [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Read error: Connection reset by peer)
04:04:10 × oxide quits (~lambda@user/oxide) (Quit: oxide)
04:04:33 oxide joins (~lambda@user/oxide)
04:08:19 × abastro quits (~abab9579@220.75.216.63) (Ping timeout: 240 seconds)
04:08:57 <albet70> >=> is Kleisli arrow?
04:09:05 <dibblego> kleisli composition
04:12:01 <albet70> which scenario would use Kleisli composition? I barely used it ever
04:12:38 <dibblego> every time you need a function of type Monad m => (a -> m b) -> (b -> m c) -> a -> m
04:13:51 <albet70> fish = \g, f -> \x, y -> f (g x y) y
04:14:55 <dibblego> fish f g = \a -> f a >>= g
04:15:41 <albet70> without (), it's easy to misunderstand
04:16:35 <albet70> \a->(f a >>= g) or (\a -> f a) >>= g
04:16:55 <dibblego> fish f g = (\a -> ((f a) >>= g))
04:16:58 <zzz> albet70: one of the most.familiar cases might be the composition of functions of the type a -> Either b a
04:22:01 cdman joins (~dcm@27.2.217.159)
04:22:01 × cdman quits (~dcm@27.2.217.159) (Changing host)
04:22:01 cdman joins (~dcm@user/dmc/x-4369397)
04:23:07 yauhsien joins (~yauhsien@61-231-27-3.dynamic-ip.hinet.net)
04:25:58 × lifter quits (~lifter@2600:1702:37d0:4310:10d9:2213:a793:979a) ()
04:30:27 deadmarshal_ joins (~deadmarsh@95.38.229.55)
04:31:13 pilyn joins (~pilyn@user/pilyn)
04:42:44 × jerry99 quits (~339ea102@cerf.good1.com) (Quit: CGI:IRC (EOF))
04:43:12 × pilyn quits (~pilyn@user/pilyn) (Remote host closed the connection)
04:43:50 pilyn joins (~pilyn@user/pilyn)
04:45:56 vysn joins (~vysn@user/vysn)
04:47:17 bahamas joins (~lucian@84.232.140.158)
04:51:15 EvanR joins (~EvanR@user/evanr)
04:55:39 × renzhi quits (~xp@2607:fa49:6500:b100::229c) (Ping timeout: 240 seconds)
04:57:32 × img quits (~img@user/img) (Quit: ZNC 1.8.2 - https://znc.in)
04:58:57 img joins (~img@user/img)
05:03:07 <zzz> is there any reason why we have to surround operators in parens when asking ghci for their type?
05:04:15 × yauhsien quits (~yauhsien@61-231-27-3.dynamic-ip.hinet.net) (Remote host closed the connection)
05:04:22 <zzz> @type $
05:04:23 <lambdabot> error:
05:04:23 <lambdabot> parse error on input ‘$’
05:04:23 <lambdabot> Perhaps you intended to use TemplateHaskell
05:05:28 × son0p quits (~ff@181.136.122.143) (Ping timeout: 248 seconds)
05:05:46 <zzz> :info $ works just fine
05:06:22 <zzz> i guess :type demands an expression
05:06:53 × pilyn quits (~pilyn@user/pilyn) (Quit: Leaving)
05:09:04 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 246 seconds)
05:09:16 yauhsien joins (~yauhsien@61-231-27-3.dynamic-ip.hinet.net)
05:13:23 <abastro[m]> :t $
05:13:25 <lambdabot> error:
05:13:25 <lambdabot> parse error on input ‘$’
05:13:25 <lambdabot> Perhaps you intended to use TemplateHaskell
05:13:27 × earthy quits (~arthurvl@2a02-a469-f5e2-1-ba27-ebff-fea0-40b0.fixed6.kpn.net) (Ping timeout: 240 seconds)
05:13:29 <abastro[m]> Oh
05:14:20 <jackdk> zzz: I think asking `:t` for the type of anything but an expression is an ill-posed question
05:14:24 earthy joins (~arthurvl@2a02-a469-f5e2-1-ba27-ebff-fea0-40b0.fixed6.kpn.net)
05:14:39 × yauhsien quits (~yauhsien@61-231-27-3.dynamic-ip.hinet.net) (Ping timeout: 256 seconds)
05:14:50 <dsal> :t ($)
05:14:51 <lambdabot> (a -> b) -> a -> b
05:15:04 <jackdk> % :info id
05:15:05 <yahb> jackdk: id :: a -> a -- Defined in `GHC.Base'
05:15:14 <jackdk> % :info $
05:15:15 <yahb> jackdk: ($) :: (a -> b) -> a -> b -- Defined in `GHC.Base'; infixr 0 $
05:15:27 <jackdk> % infixr 0 id
05:15:27 <yahb> jackdk: ; <interactive>:124:10: error: parse error on input `id'
05:15:34 <jackdk> % infixr 0 `id`
05:15:35 <yahb> jackdk: ; <interactive>:125:10: error:; The fixity signature for `id' lacks an accompanying binding; (The fixity signature must be given where `id' is declared)
05:15:39 <jackdk> darn
05:16:59 jbarot joins (~jbarot@180.190.247.113)
05:17:47 jbarot is now known as pawikan_
05:18:00 <pawikan_> Hi. I'm learning haskell.
05:18:36 × redb quits (~nmh@136.49.49.211) (Ping timeout: 240 seconds)
05:18:46 <dragestil> Are there any modern successors of haskell-indexer or haskell-code-explorer? both seem unmaintained now. And haskell-language-server does not support cross-library find-definition either.
05:19:24 Neon joins (~Neon@2001:18c0:aa0:8200:cd5c:6a4f:dbd9:2404)
05:19:48 × pawikan_ quits (~jbarot@180.190.247.113) (Client Quit)
05:24:39 redb joins (~nmh@136.49.49.211)
05:25:39 yauhsien joins (~yauhsien@61-231-27-3.dynamic-ip.hinet.net)
05:29:23 × redb quits (~nmh@136.49.49.211) (Ping timeout: 256 seconds)
05:32:29 takuan joins (~takuan@178-116-218-225.access.telenet.be)
05:33:55 × deadmarshal_ quits (~deadmarsh@95.38.229.55) (Ping timeout: 256 seconds)
05:35:18 × aman quits (~aman@user/aman) (Remote host closed the connection)
05:35:58 aman joins (~aman@user/aman)
05:37:49 xkuru joins (~xkuru@user/xkuru)
05:39:53 jakalx parts (~jakalx@base.jakalx.net) (Disconnected: Replaced by new connection)
05:39:54 jakalx joins (~jakalx@base.jakalx.net)
05:53:22 Midjak joins (~Midjak@82.66.147.146)
05:54:53 × bahamas quits (~lucian@84.232.140.158) (Ping timeout: 256 seconds)
05:54:59 × inversed quits (~inversed@94.13.111.159) (Read error: Connection reset by peer)
05:55:06 michalz joins (~michalz@185.246.204.43)
05:57:46 × zmt01 quits (~zmt00@user/zmt00) (Quit: Leaving)
05:57:50 redb joins (~nmh@136.49.49.211)
05:58:01 <maerwald[m]> dragestil: there's a trick to allor cross-library find definition
05:58:19 <maerwald[m]> You "vendor" all dependencies (add them as packages in cabal.project)
05:58:31 <maerwald[m]> Local packages work in HLS
05:59:52 <maerwald[m]> https://cabal.readthedocs.io/en/stable/cabal-project.html?highlight=optional-packages#cfg-field-optional-packages
06:00:13 × yauhsien quits (~yauhsien@61-231-27-3.dynamic-ip.hinet.net) (Remote host closed the connection)
06:00:20 zmt00 joins (~zmt00@user/zmt00)
06:01:13 yauhsien joins (~yauhsien@61-231-27-3.dynamic-ip.hinet.net)
06:01:33 <dragestil> maerwald[m]: ok, but can I point to hls packages already in the local filesystem this way?
06:02:15 × redb quits (~nmh@136.49.49.211) (Ping timeout: 256 seconds)
06:02:29 <dragestil> or do I have to get an extra copy of the package I want to find definitions through cabal?
06:03:08 redb joins (~nmh@136.49.49.211)
06:03:59 <dragestil> say I have two projects A and B, both depending on module C. Will I have to download C twice, if I want to find definitions in both projects, of symbols defined in C?
06:05:39 × jao quits (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Ping timeout: 240 seconds)
06:05:53 gpncarl joins (~gpncarl@222.249.231.3)
06:06:13 × yauhsien quits (~yauhsien@61-231-27-3.dynamic-ip.hinet.net) (Ping timeout: 256 seconds)
06:07:19 × redb quits (~nmh@136.49.49.211) (Ping timeout: 240 seconds)
06:08:05 pretty_dumm_guy joins (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655)
06:08:35 × gpncarl quits (~gpncarl@222.249.231.3) (Quit: WeeChat 3.4.1)
06:14:41 redb joins (~nmh@136.49.49.211)
06:17:39 × slac71531 quits (~slack1256@191.125.99.203) (Ping timeout: 240 seconds)
06:19:04 × redb quits (~nmh@136.49.49.211) (Ping timeout: 246 seconds)
06:19:36 yauhsien joins (~yauhsien@61-231-27-3.dynamic-ip.hinet.net)
06:20:08 <albet70> % :t (>=>) @[]
06:20:08 <yahb> albet70: (a -> [b]) -> (b -> [c]) -> a -> [c]
06:21:53 <albet70> >=> = \g, f -> \a -> join (f <$> (g a))?
06:22:39 hololeap joins (~hololeap@user/hololeap)
06:22:57 <albet70> f :: b -> [c], but g a:: [b]
06:23:30 deadmarshal_ joins (~deadmarsh@95.38.229.55)
06:23:48 <albet70> so fmap f (g a) would get [[c]]
06:23:55 <albet70> is that right?
06:24:50 pagnol joins (~user@014198154145.ctinets.com)
06:25:27 × tzh quits (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) (Remote host closed the connection)
06:25:52 coot joins (~coot@213.134.190.95)
06:27:20 <hololeap> your syntax is a little weird, but you're essentially correct
06:27:39 acidjnk joins (~acidjnk@p200300d0c722df6114cdc3ce0552b93f.dip0.t-ipconnect.de)
06:27:57 <albet70> what's your syntax?
06:28:37 <dragestil> OK, reading the docs I added optional package pointing to a local ghc repo in a project, restarting the language server it still cannot find reference to some symbols defined in ghc
06:28:37 <hololeap> I was referring to this: >=> = \g, f -> \a -> join (f <$> (g a))?
06:28:47 dyeplexer joins (~dyeplexer@user/dyeplexer)
06:29:53 <albet70> >=> = \g, f-> \a -> (g a) >>= f?
06:30:40 <hololeap> (>=>) = \f g -> join . fmap g . f
06:31:00 redb joins (~nmh@136.49.49.211)
06:31:01 <hololeap> or, f >=> g = join . fmap g . f
06:31:20 × Ram-Z quits (Ram-Z@2a01:7e01::f03c:91ff:fe57:d2df) (Ping timeout: 260 seconds)
06:32:04 abastro joins (~abab9579@220.75.216.63)
06:32:31 <hololeap> or this, which is what I think you were going for: (>=>) = \f g -> \a -> join (g <$> f a)
06:32:56 <hololeap> it was really just the comma that made it "weird"
06:33:34 <hololeap> and also if you define an infix function like that, you need to wrap it in parens
06:34:17 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Remote host closed the connection)
06:34:41 geekosaur joins (~geekosaur@xmonad/geekosaur)
06:34:58 jbarot joins (~jbarot@180.190.247.113)
06:35:07 jbarot is now known as pawikan_
06:35:10 <pawikan_> hello everyone
06:35:36 × redb quits (~nmh@136.49.49.211) (Ping timeout: 276 seconds)
06:35:49 <hololeap> yo
06:35:58 <pawikan_> how long are you using haskell?
06:36:25 <hololeap> I dunno, I think I first tried it out around 2016 or so
06:36:27 mikoto-chan joins (~mikoto-ch@213.177.151.239)
06:37:07 <pagnol> I've returned to writing some Haskell after a long break and what I'm struggling to get used to is the absence of 'proper' records
06:37:22 <pawikan_> Good for you @hololeap
06:37:26 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
06:37:34 <pawikan_> I'm just starting learning haskell.
06:37:45 <albet70> "hololeap :it was really just the comma that made it "weird"", is that , in lambda is available?
06:37:54 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
06:38:02 <albet70> \f g and \f, g
06:38:03 × mikoto-chan quits (~mikoto-ch@213.177.151.239) (Read error: Connection reset by peer)
06:38:12 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
06:38:23 <hololeap> no, you can't put a comma in a lambda like that
06:38:32 <albet70> some languages use , to split parameter in lambda
06:38:43 <albet70> "hololeap :no, you can't put a comma in a lambda like that", ok
06:39:39 <hololeap> the only place commas are used are structures with separated values, like tuples and lists
06:39:56 <hololeap> that might not be 100% true, but more or less is
06:40:01 <albet70> why some people use \f g and some using \g f, is there a rule?
06:40:30 <hololeap> no, not really a rule, just convention, but it's mostly preference
06:41:35 <albet70> about fmap on list, use recursive to define and use list compression to define, are ok?
06:41:49 <albet70> list comprehension
06:42:37 <hololeap> define fmap on a list? like as an exercise?
06:42:46 <albet70> use iteration, not recursion
06:42:58 <hololeap> fmap's already defined for lists
06:43:41 <albet70> fmap f xs = [ f x |x <- xs ]
06:43:47 mikoto-chan joins (~mikoto-ch@213.177.151.239)
06:43:53 <hololeap> all you need to do is walk the list and convert each value using the given function, so recursion is fine for that
06:44:28 <hololeap> defining fmap for lists using list comprehensions seems silly, since list comprehensions rely on fmap being defined for lists :p
06:44:30 <albet70> "hololeap :all you need to do is walk the list and convert each value using the given function, so recursion is fine for that", but what if there is no tail call optimization
06:44:52 <hololeap> ghc figures that out for you
06:45:54 × mikoto-chan quits (~mikoto-ch@213.177.151.239) (Read error: Connection reset by peer)
06:46:21 <zzz> list comprehensions are silly. fight me
06:47:41 <hololeap> you might have to add some eager evaluation in there to prevent a buildup of thunks on long lists, but other than that, ghc should figure it out for you
06:50:11 <zzz> id = \x -> [ a | a <- x ]
06:51:40 <Axman6> pawikan_: is there anything we can help you with? Please feel free to ask
06:52:06 mikoto-chan joins (~mikoto-ch@213.177.151.239)
06:53:03 × xkuru quits (~xkuru@user/xkuru) (Read error: Connection reset by peer)
06:57:22 dhouthoo joins (~dhouthoo@178-117-36-167.access.telenet.be)
06:59:42 × phma quits (~phma@2001:5b0:2143:fb58:37e7:bba5:12de:8897) (Read error: Connection reset by peer)
07:00:27 phma joins (~phma@host-67-44-209-28.hnremote.net)
07:03:24 inversed joins (~inversed@94.13.111.159)
07:03:41 redb joins (~nmh@136.49.49.211)
07:08:25 × redb quits (~nmh@136.49.49.211) (Ping timeout: 246 seconds)
07:09:50 <abastro> I also think list comprehension is silly
07:10:37 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
07:12:01 <albet70> using list comprehension can express prime in one line
07:13:54 × shriekingnoise quits (~shrieking@201.231.16.156) (Quit: Quit)
07:14:54 <albet70> > p = s [2..] where s (x : xs) = s [i <- xs, mod i x /= 0]
07:14:56 <lambdabot> <hint>:1:3: error: parse error on input ‘=’
07:15:17 <albet70> > s [2..] where s (x : xs) = s [i <- xs, mod i x /= 0]
07:15:19 <lambdabot> <hint>:1:9: error: parse error on input ‘where’
07:17:13 <tomsmeding> > let p = s [2..] where s (x : xs) = s [i <- xs, mod i x /= 0] in p
07:17:15 <lambdabot> <hint>:1:41: error:
07:17:15 <lambdabot> parse error on input ‘<-’
07:17:15 <lambdabot> Perhaps this statement should be within a 'do' block?
07:17:25 <tomsmeding> > let p = s [2..] where s (x : xs) = s [i | i <- xs, mod i x /= 0] in p
07:17:31 <lambdabot> mueval-core: Time limit exceeded
07:17:40 <tomsmeding> ¯\_(ツ)_/¯
07:17:55 fendor joins (~fendor@178.115.48.2.wireless.dyn.drei.com)
07:18:56 son0p joins (~ff@181.136.122.143)
07:18:58 <janus> @src catMaybes
07:18:58 <lambdabot> catMaybes ls = [x | Just x <- ls]
07:19:39 redb joins (~nmh@136.49.49.211)
07:19:39 <janus> zzz: how would you prefer to express catMaybes? with do-notation?
07:19:50 × Neon quits (~Neon@2001:18c0:aa0:8200:cd5c:6a4f:dbd9:2404) (Quit: Leaving)
07:20:09 Major_Biscuit joins (~MajorBisc@c-001-009-046.client.tudelft.eduvpn.nl)
07:20:50 <tomsmeding> base defines catMaybes using 'mapMaybe id', and mapMaybe using recursion
07:21:44 <janus> but it is unclear what base optimizes for, i don't think it is readability ;)
07:21:49 <tomsmeding> indeed :p
07:21:51 Pickchea joins (~private@user/pickchea)
07:22:23 zeenk joins (~zeenk@2a02:2f04:a313:d600:8d26:ec9f:3ff6:fc94)
07:24:04 jinsun joins (~jinsun@user/jinsun)
07:24:21 × redb quits (~nmh@136.49.49.211) (Ping timeout: 276 seconds)
07:24:57 chele joins (~chele@user/chele)
07:27:22 gurkenglas joins (~gurkengla@dslb-178-012-018-212.178.012.pools.vodafone-ip.de)
07:29:34 <abastro> Hm, isn't it that hard with do notation?
07:30:06 <abastro> I mean
07:30:21 <abastro> Is primes that hard to achieve with do notation
07:30:30 lortabac joins (~lortabac@2a01:e0a:541:b8f0:8b3f:8bd5:3852:70b0)
07:30:41 merijn joins (~merijn@c-001-001-001.client.esciencecenter.eduvpn.nl)
07:30:44 <abastro> I dislike how there are two somewhat competing syntaxes for lists
07:30:54 gehmehgeh joins (~user@user/gehmehgeh)
07:31:02 pretty_d1 joins (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655)
07:31:45 × pretty_d1 quits (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Client Quit)
07:31:47 × pretty_dumm_guy quits (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Ping timeout: 256 seconds)
07:33:52 `2jt joins (~jtomas@175.red-83-36-129.dynamicip.rima-tde.net)
07:35:20 pretty_dumm_guy joins (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655)
07:36:45 × pawikan_ quits (~jbarot@180.190.247.113) (Quit: Leaving)
07:38:56 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
07:39:17 <tdammers> list comprehensions combine several common operations on lists into a single, compact syntax: cartesian product, filtering (including via pattern matching), and mapping.
07:40:07 <tdammers> and they're not "competing syntaxes", really; you can write the same stuff in different ways, but each has different tradeoffs when it comes to readability and signalling intent
07:40:47 × mikoto-chan quits (~mikoto-ch@213.177.151.239) (Read error: Connection reset by peer)
07:43:46 Ram-Z joins (~Ram-Z@li1814-254.members.linode.com)
07:45:23 mmhat joins (~mmh@55d4dd86.access.ecotel.net)
07:45:34 <tomsmeding> abastro: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/exts/monad_comprehensions.html#extension-MonadComprehensions
07:46:23 mikoto-chan joins (~mikoto-ch@213.177.151.239)
07:48:35 machinedgod joins (~machinedg@24.105.81.50)
07:49:01 × zyklotomic quits (~ethan@res380d-128-61-86-145.res.gatech.edu) (Ping timeout: 246 seconds)
07:50:17 jgeerds joins (~jgeerds@d53604b0.access.ecotel.net)
07:51:00 × Sgeo_ quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer)
07:51:01 redb joins (~nmh@136.49.49.211)
07:51:03 zyklotomic joins (~ethan@res380d-128-61-87-175.res.gatech.edu)
07:54:23 × acidjnk quits (~acidjnk@p200300d0c722df6114cdc3ce0552b93f.dip0.t-ipconnect.de) (Ping timeout: 260 seconds)
07:55:35 × redb quits (~nmh@136.49.49.211) (Ping timeout: 256 seconds)
07:57:50 <abastro> Existence of monad comprehension is the proof of the competition ime
07:58:37 <abastro> You could say it is not competing syntax, yeah, but then haskell got tons of syntax sugars which is hard to learn for beginners
08:01:56 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection)
08:01:56 <tomsmeding> abastro: haskell has lots of places where there are multiple ways to do the same thing
08:02:05 CiaoSen joins (~Jura@p200300c95732ec002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
08:02:21 <tomsmeding> function argument patterns / case expressions / pattern guards
08:02:52 <tomsmeding> MultiParamTypeClasses + FunctionalDependencies / TypeFamilies
08:02:58 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
08:04:09 <tomsmeding> [1..10] / enumFromTo 1 10
08:04:16 × littlebobeep quits (~alMalsamo@gateway/tor-sasl/almalsamo) (Ping timeout: 240 seconds)
08:04:22 <tomsmeding> maybe/either / pattern matching
08:04:43 × hololeap quits (~hololeap@user/hololeap) (Excess Flood)
08:04:46 <tomsmeding> f (g x) / f $ g x
08:04:53 <tomsmeding> $ / &
08:04:56 <tomsmeding> :')
08:06:00 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
08:06:05 <zzz> janus: i don't have a specially favorite way, but there are no shortage of alternatives like `catMaybes = map fromJust . filter isJust`
08:06:45 littlebobeep joins (~alMalsamo@gateway/tor-sasl/almalsamo)
08:10:14 hololeap joins (~hololeap@user/hololeap)
08:14:47 anomal joins (~anomal@87.227.196.109)
08:17:48 <abastro> Multiple ways to do the same thing, tbh I don't like some of that
08:18:14 <abastro> Particularly because it is hard to say what is idiomatic.
08:19:04 <abastro> FunDeps vs TypeFamilies are one problem I think. (Btw I recall using '&' was discouraged)
08:20:30 <abastro> Eww pattern guards..
08:20:57 ccntrq joins (~Thunderbi@2a01:e34:eccb:b060:b69c:53df:cf2c:87d1)
08:21:21 <zzz> some convenient sugar is good but in haskell there's a lot of bloat. if ... else ... then is completely unnecessary for example
08:21:57 <abastro> Yep, that as well
08:22:11 <zzz> pattern guards i like though
08:22:27 <abastro> If blockarguments were a thing, `bool` can replace if-then-else
08:22:45 <abastro> The problem with pattern guards as I see is how they add to the possible syntax
08:23:24 <abastro> Actually yea, maybe pattern guards are not that problematic
08:23:32 <abastro> ..hm
08:23:41 <abastro> How is pattern guards distinct from viewpatterns?
08:23:55 redb joins (~nmh@136.49.49.211)
08:24:00 × abastro quits (~abab9579@220.75.216.63) (Remote host closed the connection)
08:24:32 abastro joins (~abab9579@220.75.216.63)
08:24:39 <merijn> Well, one requires an extension, one does not...
08:25:14 <abastro> I mean ofc other than that
08:25:14 × chenqisu1 quits (~chenqisu1@183.217.200.38) (Quit: Leaving)
08:25:15 <merijn> One is implicit function application voodoo, then other is explicit syntax
08:26:21 <abastro> Implicit function application voodoo?
08:26:56 <abastro> (I now think maybe pattern guard is fine? But then, it still adds to existing pile of syntax)
08:26:58 × michalz quits (~michalz@185.246.204.43) (Read error: Connection reset by peer)
08:28:44 <zzz> i use pattern guards instead of matching + testing if True/False, so in my approach i effectively reduce syntactic complexity
08:30:58 <abastro> How do you achieve that?
08:31:02 <abastro> Could you show an example?
08:31:16 <[Leary]> Pattern guards are important when your scrutinee is of unknown type, e.g. casting from an existential into several possible types. Case-of would require a bunch of pointless nesting.
08:31:29 <zzz> i will write https://paste.jrvieira.com/1650529874386
08:31:51 × redb quits (~nmh@136.49.49.211) (Ping timeout: 256 seconds)
08:33:03 michalz joins (~michalz@185.246.204.58)
08:35:34 <zzz> or *i would* write, in a perfect world where `if` was not a reserved word
08:36:17 <merijn> zzz: eh...that's is a bad example, since it's needlessly complex :p
08:36:38 <merijn> zzz: https://paste.tomsmeding.com/ziG9PMWq
08:36:55 <abastro> There is also `bool t f p`
08:37:46 <zzz> merijn: it's only needlessy complex because there is alternative syntax. my point is to reduce syntax
08:37:51 redb joins (~nmh@136.49.49.211)
08:38:10 × yauhsien quits (~yauhsien@61-231-27-3.dynamic-ip.hinet.net) (Remote host closed the connection)
08:38:15 <zzz> i don't like that guards test for True/False
08:38:30 <abastro> I mean, you could use `bool`
08:38:38 <abastro> Or hypothetically, make `if` function
08:38:44 yauhsien joins (~yauhsien@61-231-27-3.dynamic-ip.hinet.net)
08:38:47 tzh joins (~tzh@c-24-21-73-154.hsd1.or.comcast.net)
08:38:59 × xff0x_ quits (~xff0x@125x102x200x106.ap125.ftth.ucom.ne.jp) (Ping timeout: 240 seconds)
08:39:01 <zzz> yes
08:39:14 <zzz> but at some point we are just writing lisp
08:39:37 <zzz> and noone wants that also :p
08:42:17 <abastro> Could useBlockArguments
08:42:28 × redb quits (~nmh@136.49.49.211) (Ping timeout: 250 seconds)
08:43:37 × yauhsien quits (~yauhsien@61-231-27-3.dynamic-ip.hinet.net) (Ping timeout: 246 seconds)
08:44:11 <zzz> the hell with do notation!
08:44:23 <abastro> https://paste.tomsmeding.com/I1gXsBMs
08:44:25 <merijn> Hot take: BlockArguments is terrible extension
08:44:54 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
08:45:06 <abastro> Well I like how parens could be avoided with BlockArguments
08:45:50 <zzz> merijn: i tend to agree. what makes it terrible in your opinion?
08:46:22 <abastro> Perhaps if-then-else also encourages proliferation of "Bool", so it deserves to be lengthy
08:46:46 × rembo10 quits (~rembo10@main.remulis.com) (Quit: ZNC 1.8.2 - https://znc.in)
08:47:32 <zzz> Bool should not benefit from special treatment
08:47:40 rembo10 joins (~rembo10@main.remulis.com)
08:47:52 × tzh quits (~tzh@c-24-21-73-154.hsd1.or.comcast.net) (Quit: zzz)
08:47:53 <zzz> nor should lists
08:48:01 <abastro> True
08:48:12 <zzz> :)
08:49:59 × infinity0 quits (~infinity0@185.112.146.113) (Ping timeout: 240 seconds)
08:52:46 × pretty_dumm_guy quits (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Quit: WeeChat 3.5)
08:54:22 tatsumaru joins (~tatsumaru@87.227.200.124)
08:54:23 chomwitt joins (~chomwitt@2a02:587:dc1b:da00:e2f9:e987:da5c:6097)
08:57:19 × aman quits (~aman@user/aman) (Ping timeout: 240 seconds)
08:57:44 aman joins (~aman@user/aman)
08:57:58 × Pickchea quits (~private@user/pickchea) (Ping timeout: 246 seconds)
08:59:45 tatsumaru parts (~tatsumaru@87.227.200.124) ()
09:01:51 ubert1 joins (~Thunderbi@2a02:8109:9880:303c:8727:84d3:4f94:88b2)
09:02:33 × byorgey quits (~byorgey@155.138.238.211) (Quit: leaving)
09:06:12 kuribas joins (~user@ip-188-118-57-242.reverse.destiny.be)
09:07:05 <tdammers> I have all sorts of complaints about lisp, but "too many parenthesizes" is not one of htem
09:10:17 redb joins (~nmh@136.49.49.211)
09:10:18 × deadmarshal_ quits (~deadmarsh@95.38.229.55) (Ping timeout: 276 seconds)
09:12:16 DNH joins (~DNH@2a02:8109:b740:2c4:11d5:718e:c7c6:4a90)
09:12:28 <kuribas> tdammers: +1
09:12:42 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
09:14:27 fef joins (~thedawn@user/thedawn)
09:14:32 × redb quits (~nmh@136.49.49.211) (Ping timeout: 250 seconds)
09:16:00 yauhsien joins (~yauhsien@61-231-27-3.dynamic-ip.hinet.net)
09:17:05 <kuribas> lisps offer a great deal of flexibility, but it's easy for code to become only readable by the author.
09:17:37 <kuribas> types reduce the expressivity, but make code more readable by other programmers.
09:19:33 <abastro> I saw ppl finding typical Haskell code quite unreadable though
09:21:22 <merijn> abastro: Sure, if you don't bother to learn the syntax
09:25:23 <kuribas> abastro: you can make unreadable, complicated code in any language.
09:25:44 <kuribas> IMO most unreadable haskell snippets use the (->) monad or functor.
09:25:56 <kuribas> That or use unnecessary abstractions.
09:26:21 <zzz> can you write unreadable code in APL?
09:27:19 __monty__ joins (~toonn@user/toonn)
09:27:20 <kuribas> "can you write readable code in APL" FTFY
09:27:23 × abastro quits (~abab9579@220.75.216.63) (Ping timeout: 256 seconds)
09:28:07 <zzz> prespective
09:28:36 <merijn> kuribas: No :D
09:31:17 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
09:34:51 <kuribas> hmm, dynamic types are just dependent pairs...
09:35:45 <kuribas> And partial functions over those pairs.
09:37:49 × aman quits (~aman@user/aman) (Quit: aman)
09:38:23 aman joins (~aman@user/aman)
09:39:13 redb joins (~nmh@136.49.49.211)
09:39:53 <lortabac> kuribas: 'Dynamic' in Haskell is a dependent pair, but I don't think it makes sense to generalize this specific representation to a universal definition of dynamic types
09:42:16 × CiaoSen quits (~Jura@p200300c95732ec002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 248 seconds)
09:42:22 <tdammers> when people say "unreadable", they usually mean "I am not familiar with this language and its idioms"
09:44:57 × redb quits (~nmh@136.49.49.211) (Ping timeout: 256 seconds)
09:46:35 <kuribas> tdammers: yeah, "(+) <$> [1, 2] <$> [3, 4]" would be weird to an outsider.
09:46:56 <kuribas> erm "(+) <$> [1, 2] <*> [3, 4]"
09:47:49 <kuribas> lortabac: dynamic types are most of the time implemented by a tag + value.
09:48:02 <kuribas> lortabac: then they pattern match on the tag internally.
09:48:10 <kuribas> lortabac: which is just a dependent pair.
09:49:43 <kuribas> dyn : (t : Type ** t)
09:49:46 <lortabac> kuribas: are you sure? To me "dependent" means that the dependency between the tag and the type is somehow formalized
09:50:07 <lortabac> if it's all unsafe casts can we really call it dependent?
09:50:18 <kuribas> lortabac: that's the partial part :)
09:50:29 <kuribas> partial operations over dependent pairs.
09:50:50 <lortabac> I see
09:51:24 <lortabac> maybe we should say "morally dependent pairs" or something like that
09:51:44 <lortabac> but now I see your point
09:51:52 × oxide quits (~lambda@user/oxide) (Ping timeout: 246 seconds)
09:52:00 <kuribas> lortabac: I am just thinking about how dynamic programmers claim types restrict you.
09:52:25 <abastro[m]> tdammers: Well but ppl say e.g. Go is highly readable
09:52:37 <kuribas> but you can implement dynamic in a static language using a dependent pair + unsafe cast.
09:53:03 <lortabac> kuribas: to be honest I kind of agree with them on this point
09:53:24 <__monty__> You don't even need those though? A simple ADT is also morally equivalent.
09:54:15 <lortabac> some of the things that you would do in Clojure are hard to do in Haskell
09:54:31 zebrag joins (~chris@user/zebrag)
09:54:39 <__monty__> And vice versa : )
09:55:00 oxide joins (~lambda@user/oxide)
09:55:03 <tdammers> abastro[m]: so? Go looks very similar to languages people are already familiar with, so that's no surprise.
09:55:08 <kuribas> lortabac: I really disagree.
09:55:21 <kuribas> lortabac: They are easy to do in haskell, but we don't like the solution because it is partial.
09:55:41 <kuribas> lortabac: or involves passing a Aeson Value everywhere.
09:56:00 × yauhsien quits (~yauhsien@61-231-27-3.dynamic-ip.hinet.net) (Remote host closed the connection)
09:56:00 <abastro[m]> Indeed
09:56:29 <kuribas> You could make a static language with an "Any" type, which will have an implicit unsafe cast wherever used.
09:56:29 <abastro[m]> Also imperative style is similar to how ppl perform commands themselves
09:57:26 <abastro[m]> E.g. loop statement could be intuitive to even beginners
09:58:08 <tdammers> kuribas: not all those things are necessarily partial. In some cases, the problem is rather that Haskell largely uses nominal types rather than structural; conceptually, any value inhabits exactly one type. An example of an architecture where this matters is Ring middlewares. For example, you can make a middleware that augments a JSON request with a parsed body; any middlewares that don't care
09:58:10 <tdammers> about the parsed payload can just pass it through, but those that do care about it can match on it and use it.
09:58:28 <lortabac> kuribas: you would need a whole ecosystem of dynamically-typed Haskell in order to make it really usable
09:58:28 <lortabac> and also some syntactic sugar
09:58:31 pretty_dumm_guy joins (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655)
09:58:56 <tdammers> if we want to do this in Haskell, things get awkward; we need to define separate types for "request without parsed payload" and "request with parsed payload"
09:59:25 <tdammers> a structural type system could, in principle, make this more ergonomic, without sacrificing type safety
10:00:09 acidjnk joins (~acidjnk@p200300d0c722df61048d478b5774cff4.dip0.t-ipconnect.de)
10:00:20 <abastro[m]> Structural type system is also unwieldy in other ways iirc
10:00:37 <abastro[m]> How do you do Typeclasses in structural types
10:01:30 <kuribas> tdammers: I think higher kinded extensible records are a great solution for this.
10:01:40 × pagnol quits (~user@014198154145.ctinets.com) (Ping timeout: 246 seconds)
10:02:44 × aman quits (~aman@user/aman) (Quit: aman)
10:02:56 <kuribas> lortabac: yeah, I am thinking about a language that mixes static with dynamic.
10:03:28 <lortabac> btw GHC already has Any
10:03:44 <abastro[m]> :i Any
10:03:49 redb joins (~nmh@136.49.49.211)
10:03:50 <lortabac> but you have to unsafeCoerce explicitly in order to use it
10:04:09 <abastro[m]> Eh that does not work..
10:06:22 × fendor quits (~fendor@178.115.48.2.wireless.dyn.drei.com) (Remote host closed the connection)
10:08:59 × redb quits (~nmh@136.49.49.211) (Ping timeout: 240 seconds)
10:09:52 infinity0 joins (~infinity0@185.112.146.113)
10:10:30 dextaa joins (~dextaa@user/dextaa)
10:10:50 <kuribas> > 2 :: Any
10:10:52 <lambdabot> error:
10:10:52 <lambdabot> • No instance for (Num Any) arising from the literal ‘2’
10:10:52 <lambdabot> • In the expression: 2 :: Any
10:10:59 <kuribas> > (2 :: Int) :: Any
10:11:01 <lambdabot> error:
10:11:01 <lambdabot> • Couldn't match expected type ‘Any’ with actual type ‘Int’
10:11:01 <lambdabot> • In the expression: (2 :: Int) :: Any
10:11:21 <kuribas> > (undefined :: Any) + 2
10:11:23 <lambdabot> error:
10:11:23 <lambdabot> • No instance for (Num Any) arising from a use of ‘+’
10:11:23 <lambdabot> • In the expression: (undefined :: Any) + 2
10:11:34 <kuribas> lortabac: yeah.
10:11:39 <lortabac> this is another Any
10:12:22 × DNH quits (~DNH@2a02:8109:b740:2c4:11d5:718e:c7c6:4a90) (Quit: My MacBook has gone to sleep. ZZZzzz…)
10:12:54 <lortabac> I'm talking about GHC.Exts.Any
10:13:43 × zebrag quits (~chris@user/zebrag) (Quit: Konversation terminated!)
10:17:05 zebrag joins (~chris@user/zebrag)
10:17:51 Aseel joins (~Aseel@175.142.127.212)
10:18:04 × zeenk quits (~zeenk@2a02:2f04:a313:d600:8d26:ec9f:3ff6:fc94) (Quit: Konversation terminated!)
10:18:06 pagnol joins (~user@014198154145.ctinets.com)
10:18:34 krappix joins (~krappix@nat-eduroam-76-gw-01-lne.lille.inria.fr)
10:20:29 <kuribas> lortabac: how is it different?
10:21:27 <krappix> Hello all, how can I convert a string datetime to dataTime data: for example `"2022-04-21T10:13:31Z"` become `{day = 2022-04-21, time = 10:13:31}`
10:21:44 × jmdaemon quits (~jmdaemon@user/jmdaemon) (Ping timeout: 248 seconds)
10:22:16 × acidjnk quits (~acidjnk@p200300d0c722df61048d478b5774cff4.dip0.t-ipconnect.de) (Ping timeout: 248 seconds)
10:22:51 akegalj joins (~akegalj@93-136-71-186.adsl.net.t-com.hr)
10:23:10 deadmarshal_ joins (~deadmarsh@95.38.229.55)
10:23:53 <merijn> there's a parse function in the time package
10:23:56 <merijn> @hackage time
10:23:56 <lambdabot> https://hackage.haskell.org/package/time
10:24:28 <merijn> Specifically parseTimeM
10:24:30 <merijn> https://hackage.haskell.org/package/time-1.12.1/docs/Data-Time-Format.html#v:parseTimeM
10:25:53 × jinsun quits (~jinsun@user/jinsun) (Read error: Connection reset by peer)
10:26:08 jinsun joins (~jinsun@user/jinsun)
10:28:09 × zzz quits (~z@user/zero) (Ping timeout: 248 seconds)
10:28:18 × deadmarshal_ quits (~deadmarsh@95.38.229.55) (Ping timeout: 276 seconds)
10:28:53 <krappix> merijn: thank you
10:28:56 acidjnk joins (~acidjnk@p200300d0c722df612d209b48ee4192e4.dip0.t-ipconnect.de)
10:32:27 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
10:32:32 × econo quits (uid147250@user/econo) (Quit: Connection closed for inactivity)
10:33:30 × mmhat quits (~mmh@55d4dd86.access.ecotel.net) (Ping timeout: 276 seconds)
10:33:55 mmhat joins (~mmh@55d4dd86.access.ecotel.net)
10:36:39 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 240 seconds)
10:37:01 Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915)
10:37:21 × mcglk quits (~mcglk@131.191.49.120) (Read error: Connection reset by peer)
10:38:42 × Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 276 seconds)
10:39:02 mcglk joins (~mcglk@131.191.49.120)
10:39:03 redb joins (~nmh@136.49.49.211)
10:39:42 dextaa9 joins (~dextaa@user/dextaa)
10:39:45 Lord_of_Life_ is now known as Lord_of_Life
10:41:57 × dextaa quits (~dextaa@user/dextaa) (Ping timeout: 276 seconds)
10:41:57 dextaa9 is now known as dextaa
10:42:11 × jinsun quits (~jinsun@user/jinsun) (Ping timeout: 256 seconds)
10:42:13 jinsun__ joins (~jinsun@user/jinsun)
10:43:10 × krappix quits (~krappix@nat-eduroam-76-gw-01-lne.lille.inria.fr) (Ping timeout: 250 seconds)
10:43:54 × redb quits (~nmh@136.49.49.211) (Ping timeout: 276 seconds)
10:44:50 <dminuoso> Are there any well maintained haskell libraries that also expose a flake?
10:44:59 DNH joins (~DNH@2a02:8109:b740:2c4:11d5:718e:c7c6:4a90)
10:45:07 <dminuoso> Trying to get a gist of how haskell packages usually write their flakes
10:53:29 deadmarshal_ joins (~deadmarsh@95.38.229.55)
10:54:39 × ralu1 quits (~ralu@static.211.245.203.116.clients.your-server.de) (Ping timeout: 240 seconds)
10:55:52 × jgeerds quits (~jgeerds@d53604b0.access.ecotel.net) (Ping timeout: 248 seconds)
11:01:53 yauhsien joins (~yauhsien@61-231-27-3.dynamic-ip.hinet.net)
11:02:40 CiaoSen joins (~Jura@p200300c95732ec002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
11:02:41 × fef quits (~thedawn@user/thedawn) (Quit: Leaving)
11:05:33 <lortabac> kuribas: the Any in lambdabot is the bool monoid (true if at least one element is true)
11:06:33 × yauhsien quits (~yauhsien@61-231-27-3.dynamic-ip.hinet.net) (Ping timeout: 256 seconds)
11:11:59 × acidjnk quits (~acidjnk@p200300d0c722df612d209b48ee4192e4.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
11:12:38 redb joins (~nmh@136.49.49.211)
11:13:57 aman joins (~aman@user/aman)
11:16:24 × merijn quits (~merijn@c-001-001-001.client.esciencecenter.eduvpn.nl) (Ping timeout: 276 seconds)
11:16:33 <dminuoso> Unrelatedly, if I bump cabal-version from >=1.10 to 3.0, does this warrant a major version bump?
11:16:55 × akegalj quits (~akegalj@93-136-71-186.adsl.net.t-com.hr) (Quit: leaving)
11:16:59 fendor joins (~fendor@178.115.48.2.wireless.dyn.drei.com)
11:17:07 <dminuoso> If I take PVP literally, it seems not
11:17:26 <dminuoso> Dunno
11:17:28 <dminuoso> "Note that modifying imports or depending on a newer version of another package may cause extra orphan instances to be exported and thus force a major version change.
11:17:43 <dminuoso> Is cabal itself "a package you depend upon"?
11:19:57 <__monty__> Doesn't cabal-install discard package versions with incompatible cabal-version constraints?
11:20:50 <dminuoso> I guess if it did, it doesnt matter
11:22:54 × anomal quits (~anomal@87.227.196.109) (Remote host closed the connection)
11:28:37 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
11:29:02 Pickchea joins (~private@user/pickchea)
11:30:07 Unicorn_Princess joins (~Unicorn_P@93-103-228-248.dynamic.t-2.net)
11:39:40 × deadmarshal_ quits (~deadmarsh@95.38.229.55) (Ping timeout: 246 seconds)
11:42:36 <kuribas> tdammers: why would a middleware want to pass a parsed request?
11:44:39 <kuribas> tdammers: you mean like parse bytestring into JSON, to avoid every middleware having to do that?
11:46:11 <kuribas> tdammers: you could use "vault" for that.
11:46:27 <kuribas> Create a key for JSON body, and put it in the vault.
11:46:41 × pagnol quits (~user@014198154145.ctinets.com) (Remote host closed the connection)
11:46:45 <kuribas> tdammers: I don't see how this needs dynamic types.
11:50:42 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
11:51:15 merijn joins (~merijn@c-001-001-001.client.esciencecenter.eduvpn.nl)
11:56:25 × merijn quits (~merijn@c-001-001-001.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds)
11:57:56 <abastro[m]> What is "vault"?
11:58:59 × Pickchea quits (~private@user/pickchea) (Ping timeout: 240 seconds)
12:00:34 × meinside quits (uid24933@id-24933.helmsley.irccloud.com) (Quit: Connection closed for inactivity)
12:05:37 merijn joins (~merijn@c-001-001-001.client.esciencecenter.eduvpn.nl)
12:12:05 <kuribas> abastro[m]: https://hackage.haskell.org/package/wai-3.2.3/docs/Network-Wai.html#v:vault
12:12:44 <abastro[m]> Oh, so an invisible store
12:14:29 <kuribas> more like a store that allows you to put any type in it.
12:14:39 × qwedfg quits (~qwedfg@user/qwedfg) (Ping timeout: 240 seconds)
12:14:44 <tdammers> kuribas: it doesn't, that's the thing. The middleware is essentially (Request -> Response) -> (RequestWithMaybeJSONPayload -> Response) or sth like that. Which would work, except that now Request and RequestWithMaybeJSONPayload are no longer the same type, even for non-JSON requests
12:15:21 <kuribas> tdammers: put JSON in the vault?
12:15:45 <tdammers> that removes the JSON parsing aspect from the type entirely
12:16:06 JordiGH joins (~jordi@user/jordigh)
12:16:32 <kuribas> so just like the dynamic solution, right?
12:16:50 <tdammers> well, vault is kind of out-of-band
12:17:00 dcoutts__ joins (~duncan@host213-122-143-81.range213-122.btcentralplus.com)
12:17:10 <tdammers> the way Ring does it, you just extend the request object with an additional field
12:17:15 ralu1 joins (~ralu@static.211.245.203.116.clients.your-server.de)
12:17:26 <tdammers> I guess you could use some sort of extensible-records solution for that in Haskell
12:19:07 × dcoutts_ quits (~duncan@host213-122-143-81.range213-122.btcentralplus.com) (Ping timeout: 240 seconds)
12:22:58 × aman quits (~aman@user/aman) (Quit: aman)
12:26:27 × JordiGH quits (~jordi@user/jordigh) (Ping timeout: 260 seconds)
12:27:26 × Aseel quits (~Aseel@175.142.127.212) (Remote host closed the connection)
12:35:34 <abastro[m]> Static types are often problematic like in this case, I gusss
12:35:49 <abastro[m]> I should have said nominal type duh
12:38:18 × `2jt quits (~jtomas@175.red-83-36-129.dynamicip.rima-tde.net) (Ping timeout: 276 seconds)
12:38:45 <abastro[m]> (Hmm I wonder how structural typing could be done well)
12:41:00 <tdammers> I've been thinking about that myself (the "structural typing done well" thing)
12:44:11 <abastro[m]> Oh, could you give the gist of results?
12:44:59 <kuribas> tdammers: but "Application -> Application" doesn't change the type.
12:45:08 <kuribas> I don't see how anything other than vault can help here...
12:45:58 <kuribas> higher kinded extensible-records are nice since you can have variations of the same kind of data, and also apply generic methods over them.
12:46:07 <tdammers> abastro[m]: currently, the results I have are "I will have to make a little toy language to try out a bunch of things", and "I will likely have to sacrifice type inference to a large extent"
12:46:11 <kuribas> I am experimenting in idris with them.
12:46:27 <abastro[m]> Oh no. Losing type inference..
12:46:38 <kuribas> So you can do folds over fields, mapping fields, zipping records, etc...
12:46:40 <tdammers> kuribas: obviously the Middleware type would have to change
12:46:50 <abastro[m]> It was not fun in Scala with less and unreliable type inference
12:46:54 <kuribas> tdammers: so it wouldn't be middleware anymore.
12:47:16 <kuribas> Middleware is something transparent between.
12:47:27 <abastro[m]> Kuribas, interesting that you could avoid doing lots of proofs
12:47:42 <kuribas> abastro[m]: which proofs?
12:48:10 <tdammers> oh, if that's your definition, then the clojure one doesn't qualify either, because it's not transparent either
12:48:28 <tdammers> idk., call it a "filter" or a "combinator" then
12:48:32 <kuribas> yeah, I guess not
12:49:27 <kuribas> abastro[m]: the type of map: mapRecord : ({a : k} -> f a -> g a) -> Record f l -> Record g l
12:49:31 <abastro[m]> Proofs that the records could be folded, zipped with types matching
12:49:31 <abastro[m]> That and extension as well
12:50:02 <kuribas> abastro[m]: I have: data RecordList : (k -> Type) -> List (String, k) -> Type
12:50:09 <kuribas> abastro[m]: Record is just a wrapper.
12:51:05 <kuribas> abastro[m]: "get" involves a "proof" that the field exists.
12:51:19 <abastro[m]> Yea, those ones
12:51:20 <kuribas> abastro[m]: which interestingly resolves to an integer (the index in the list).
12:51:32 <abastro[m]> I wonder if one of the proofs could be problematic
12:51:46 <kuribas> abastro[m]: nah, the proof is a simple induction.
12:52:46 <kuribas> abastro[m]: and the proof is done automatically by idris.
12:52:51 <kuribas> using proof search.
12:53:04 <tdammers> so, red herring - my point is, if I want to use the design of that Ring middleware in a nominally typed language, it gets ugly, but that's not because the language is typed, it's because the types are nominal
12:53:42 <kuribas> abastro[m]: so idris will just search all constructors for the right type. If found it is then converted to an integer (the index in the list).
12:54:18 <abastro[m]> Interesting, so that deptypes could be useful for certain usecases like this
12:54:56 <abastro[m]> Sometimes structural types feel like dynamic to me
12:55:05 <kuribas> IMO subtypes are problematic.
12:55:16 <kuribas> It's better to have polymorphism.
12:55:24 <kuribas> with constraints.
12:55:34 <kuribas> TypeWithFeature t => t -> ...
12:55:52 <kuribas> the constraint can be any proof in fact.
12:56:12 AlexNoo_ is now known as AlexNoo
12:56:45 <tdammers> kuribas: in general I agree; however, if you're going to do the "incremental enrichment" style processing that clojure people love so much, then this still means you have to introduce a lot of types, with the potential for a combinatorial explosion
12:56:46 <kuribas> For example {0 t:String} -> TableInSchema (s:Schema) t => t -> ...
12:57:33 <abastro[m]> Extensible records?
12:57:45 <abastro[m]> Oh right
12:58:11 <abastro[m]> Those records are subtyping-capable ones
12:59:58 <abastro[m]> <del>In the end, OOP wins in practical world I guess</del>
13:00:07 <kuribas> tdammers: I think it's easier to use a HKD record with Maybe.
13:01:42 <tdammers> kuribas: but now you have to tell everyone in the chain about the JSON value you may or may not be adding somewhere along the way, even all the parts of the chain that will do absolutely nothing with it other than pass it along unchanged
13:02:49 <abastro[m]> Time to use duck typing?
13:03:01 <tdammers> that is exactly what I want to avoid
13:03:16 <abastro[m]> What is wrong with duck typing tho
13:03:33 <tdammers> in a nutshell: jesus.save() and file.save() aren't the same thing
13:03:41 <abastro[m]> It is basis of incredible amount of SW infrastructure
13:04:10 <abastro[m]> Yea but some tradeoff is inevitable
13:07:01 <abastro[m]> In which way is dynamic typing different?
13:07:13 acidjnk joins (~acidjnk@p200300d0c722df617c5129eda301b2dd.dip0.t-ipconnect.de)
13:07:26 <abastro[m]> I guess I wrongly equated dynamic typing with duck typing
13:09:56 <tdammers> "dynamic typing" means you don't perform type checks; if there are any type errors in your program, it will crash at runtime.
13:10:38 <abastro[m]> How about duck typing?
13:10:55 <kuribas> tdammers: then use vault?
13:11:09 <kuribas> tdammers: either it's in the type, or not, there is nothing between :)
13:11:19 <tdammers> duck typing basically means that instead of asking an object "are you a duck", you ask it to quack; if it can quack, then you treat it as a duck
13:11:49 <tdammers> kuribas: it should be in the type, yes, but, hmm, let me see if I can come up with a boiled-down example
13:12:30 <kuribas> tdammers: make the "extra fields" type polymorphic.
13:12:42 <kuribas> tdammers: and then a constraint on that field when you require it to have something.
13:13:11 boxscape_ joins (~boxscape_@p4ff0b7be.dip0.t-ipconnect.de)
13:14:10 <abastro[m]> Oh, so dynamic typing may crash if the type is wrong, before seeing its behavior
13:14:16 <boxscape_> It looks like if define a symbol and import a symbol with the same name, and then use it, GHC will prefer the symbol defined in that module, and not say anything about ambiguity. Is that generally true?
13:14:17 <boxscape_> for some reason I fully expected an error, but I'd much prefer to rely on the former behavior for a plugin I'm writing
13:15:15 × lottaquestions quits (~nick@2607:fa49:5041:a200:5fb5:5ae2:e3c1:daee) (Quit: Konversation terminated!)
13:15:25 <abastro[m]> Confused because considerable portion of dynamic typing world is consisted of duck typing. I think there should be a good reason why it is so widespread.
13:17:34 jgeerds joins (~jgeerds@d53604b0.access.ecotel.net)
13:18:41 <boxscape_> duck typing seems like a strange mixture of nominal and structural typing. You're asking whether a value has the right structure by checking if it has a method with the right name
13:18:45 <tdammers> duck typing is popular in dynamic languages, because nominal type checks ("is-a") don't really buy you anything
13:18:47 × acidjnk quits (~acidjnk@p200300d0c722df617c5129eda301b2dd.dip0.t-ipconnect.de) (Ping timeout: 260 seconds)
13:18:58 <tdammers> either way, things crash at runtime
13:19:14 <tdammers> "this thing isn't declared to be a duck" vs. "this thing cannot quack" - but in both cases, it crashes
13:19:18 pavonia joins (~user@user/siracusa)
13:20:01 <tdammers> nominal checks however require more ceremony - you have to declare the type and its inheritance chain, and you have to add those type checks before accessing the quack() method
13:20:14 <abastro[m]> Yep, it is good enough for dynamic typing
13:20:33 <tdammers> it's more that Java-style type checks don't buy you anything in a dynamic language
13:20:40 <boxscape_> (actually I guess my previous statement applies to regular structural typing, too, since you check whether record fields have the right names)
13:20:57 <tdammers> PHP did cargo-cult Java's class model, including the is-a checks, but in practice, they're pretty much worthless
13:21:37 <abastro[m]> Java style type checks lol
13:21:50 <dminuoso> tdammers: I guess duck-typing is just an awkward phrasing of protocols/interfaces.
13:22:06 <dminuoso> Particularly for languages that lack the formalism to talk about protocols.
13:22:07 <abastro[m]> (Imho Java itself is lol. Got a good time at 2000 IT boom)
13:22:34 <tdammers> boxscape_: in principle, yes, but 1) the checks are done statically, so they still buy you a lot compared to dynamic duck typing, and 2) you can design the "names" system such that names are actually unique, so "jesus.save" and "file.save" would reference *different* 'save' labels
13:22:41 <abastro[m]> I heard protocols are not alike interfaces
13:22:51 <abastro[m]> But to my eyes it is closer to interfaces than typeclasses
13:22:56 <boxscape_> tdammers right, good point
13:23:27 <tdammers> dminuoso: I'd say duck typing is "protocols/interfaces, but implicit, and only checked at runtime"
13:23:32 <dminuoso> Yeah.
13:23:41 <dminuoso> Sounds about right
13:24:33 <dminuoso> Perhaps one important aspect about duck typing that is rarely mentioned, is that duck typing in particular makes sense for languages with monkey patching or meta programming abilities
13:24:47 <abastro[m]> Dynamic protocols sound quite good tbh
13:24:48 <dminuoso> Say Ruby's method_missing, which you can drive as dynamic as you want
13:24:56 n3t joins (n3t@s45.mydevil.net)
13:25:53 <dminuoso> Someone else might amend your thing with new methods/capabilities after the fact, allowing to satisfy some particular interface
13:26:20 <abastro[m]> OOP at its finest
13:26:35 <tdammers> yeah, so if you're going to miss out on static assertions anyway, at least make maximum use of the freedom that gives you
13:26:45 <dminuoso> Well, in some sense this is *actual* OOP in the original sense of smalltalk
13:26:51 <tdammers> yep
13:26:58 <abastro[m]> Oh
13:27:49 <abastro[m]> Python is rightful successor of smalltalk then?
13:27:58 <dminuoso> Hardly
13:28:11 <abastro[m]> Hmm
13:28:19 <dminuoso> Quite a many languages offer the capabilities, but it's not widely used and certainly doesnt influence design choices by authors.
13:28:29 <dminuoso> The core theme of OOP is that you have these objects that interact by exchanging "messages", they talk to each other.
13:28:46 <dminuoso> While objects can have internal state
13:29:05 <dminuoso> The only somewhat common example of this pattern Ive seen is in the Erlang world
13:29:32 <abastro[m]> Oh, so duck typing is only part of it
13:30:04 <abastro[m]> Funny that I saw some ppl consider Erlang as functional (along with oop ofc)
13:30:47 <boxscape_> this looks like a good explanation of Alan Kay's original view of OOP https://ovid.github.io/articles/alan-kay-and-oo-programming.html
13:33:42 <abastro[m]> Enterprise OOP got bigger though, because ppl love blunt classification
13:34:56 × Major_Biscuit quits (~MajorBisc@c-001-009-046.client.tudelft.eduvpn.nl) (Quit: WeeChat 3.4)
13:35:30 <abastro[m]> E.g. "A bat is a bird, it can fly and has similar behaviors"
13:37:35 <geekosaur> which is still slightly better than "a bat is a mouse with wings"
13:38:23 <exarkun> https://stackoverflow.com/questions/13737458/cycle-in-type-synonym-declarations why is the type in the question not allowed but the newtype in the answer is allowed
13:39:00 wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com)
13:39:00 × wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host)
13:39:00 wroathe joins (~wroathe@user/wroathe)
13:39:00 <merijn> exarkun: type synonyms are effectively just textual aliases
13:39:00 <boxscape_> ah, hm, looks like what I said above about ambiguous names is actually only true in ghci, in ghc you do get an error :/
13:39:21 <merijn> exarkun: so a cyclic/recursive definition would expand to infinite size during type checking
13:39:32 abastro[m] sent a hs code block: https://libera.ems.host/_matrix/media/r0/download/libera.chat/483e85e0656278159253d51df5df0abb2ad74a27
13:39:33 <merijn> exarkun: A newtype creates a new *opaque* type
13:39:56 <merijn> exarkun: Which means the expansion only happens when you "unpack" the newtype, which happens one finite step at a time
13:40:01 <geekosaur> boxscape_, yes, in ghci every line shadows every preceding line and creates a new local declaration
13:40:13 <merijn> (very handwavy explanation, but that's the gist)
13:40:55 <boxscape_> geekosaur and right, makes sense that it would work if it's being treated as a local declaration
13:40:59 <boxscape_> s/and/ah
13:41:28 × frost quits (~frost@user/frost) (*.net *.split)
13:41:28 × hololeap quits (~hololeap@user/hololeap) (*.net *.split)
13:41:28 × littlebobeep quits (~alMalsamo@gateway/tor-sasl/almalsamo) (*.net *.split)
13:41:28 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (*.net *.split)
13:41:28 × gehmehgeh quits (~user@user/gehmehgeh) (*.net *.split)
13:41:28 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (*.net *.split)
13:41:28 × ChaiTRex quits (~ChaiTRex@user/chaitrex) (*.net *.split)
13:41:28 × azimut quits (~azimut@gateway/tor-sasl/azimut) (*.net *.split)
13:41:28 × adanwan quits (~adanwan@gateway/tor-sasl/adanwan) (*.net *.split)
13:41:28 × chexum quits (~quassel@gateway/tor-sasl/chexum) (*.net *.split)
13:41:28 × jpds quits (~jpds@gateway/tor-sasl/jpds) (*.net *.split)
13:41:28 × califax quits (~califax@user/califx) (*.net *.split)
13:41:28 × stiell_ quits (~stiell@gateway/tor-sasl/stiell) (*.net *.split)
13:41:35 <merijn> exarkun: In essence, the type synonym is an infinitely big (and thus irrepresentible in the type checker) term, whereas the newtype is a finite (but recursive) one
13:41:38 <geekosaur> ghci is just a bit weird, but it'd be even weirder if it behaved like an actual file
13:41:54 <boxscape_> so ghci kind of has local type declarations
13:42:08 <exarkun> merijn: Should I be concerned with why this difference exists, or is it just because?
13:42:09 akegalj joins (~akegalj@141-136-168-234.dsl.iskon.hr)
13:43:10 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
13:43:19 JordiGH joins (~jordi@user/jordigh)
13:43:24 <merijn> exarkun: I'd say it's due to a bit of a misnomer of type (which kinda implies it's defining a new (ha!) type, but is really defining a synonym/textual alias, whereas newtype defines a, well, new type ;)
13:43:37 <geekosaur> ghci makes a little moresense if you treat it as the inside of a `do` (which was the original intent)
13:43:49 <abastro[m]> I think newtypes are effectively datatypes, but they are optimized so that the conversion takes no cost in runtine.
13:44:07 <merijn> exarkun: So when you write "type Foo = Int" you can use Foo and Int interchangably. If you write "newtype Foo = Foo Int" you need to explicitly wrap/unwrap Foo to get an Int
13:44:10 <boxscape_> geekosaur right, do + the ability to declare types
13:44:35 <boxscape_> (which also shadow imports
13:44:37 <boxscape_> )
13:44:45 <exarkun> merijn: okay, I might understand that. thanks.
13:44:54 <abastro[m]> exarkun I'd say `type` is like macros
13:45:08 <abastro[m]> Tho I'd be quite wrong with this
13:45:23 <abastro[m]> They do behave somewhat alike typedef in C
13:45:56 <geekosaur> it creates an alias in the typechecker
13:46:21 × redb quits (~nmh@136.49.49.211) (Ping timeout: 256 seconds)
13:47:47 zer0bitz joins (~zer0bitz@2001:2003:f444:8f00:7182:b1bf:175f:4221)
13:47:59 Pickchea joins (~private@user/pickchea)
13:49:25 <abastro[m]> Type alias, yea that should be better and correct term
13:49:55 abastro joins (~abab9579@220.75.216.63)
13:51:18 xff0x_ joins (~xff0x@om126194210237.10.openmobile.ne.jp)
13:52:05 jonathanx joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
13:52:16 <dminuoso> Maybe we should have named `type` `alias`, and `newtype` just `type`. :)
13:52:30 <dminuoso> But alas, hysterical raisins.
13:52:35 <abastro> Great naming!
13:52:44 <abastro> Btw what does alias does, exactly?
13:52:54 <geekosaur> all three are kinda misnamed, but it's far too late now
13:53:16 <abastro> Idris do took `data` IIRC
13:53:20 <abastro> Or perhaps I misremembered
13:53:36 <boxscape_> Idris took most of the Haskell98 syntax
13:53:48 <dminuoso> It's just a bit sad because while it doesn't really have a meaningful impact on advanced users of Haskell, it does present one other hurdle for newcomers.
13:53:54 <abastro> `type A = B` does not literally replace all occurrences of A with B, right?
13:54:02 <dminuoso> abastro: correct
13:54:20 <dminuoso> abastro: once you have type aliases you get a whole lot of fun in GHC in facft.
13:54:21 <abastro> Yep, as it does not literally replace, what does it do?
13:54:31 <dminuoso> Sometimes GHC will show you the aliased name, sometimes not..
13:54:35 <Alex_test> [quote=Falcon post_id=437033 time=1650547944 user_id=7]
13:54:35 <Alex_test> ����� ��� � ������������� ������ "�������� ��������"! *��������*
13:54:35 <Alex_test> [/quote]
13:54:35 <Alex_test> �������?!?!
13:54:35 <Alex_test> ������� ������� �.�. �., ������... *������*
13:54:51 <dminuoso> Heck, you sometimes have something like Expected `[Unaliased]` but got `Aliased`
13:54:56 <dminuoso> Real fun this way
13:55:13 <Alex_test> ��.
13:55:35 <dminuoso> abastro: its just a statement of equality . `type T = Int` is just saying these two things are the same thing.
13:55:45 <abastro> I see
13:55:45 <dminuoso> That means you can substitute one for the other anywhere
13:55:50 <abastro> So implementation dependent it is
13:55:54 <dminuoso> No, not at all
13:55:56 <dminuoso> That's the point
13:55:58 <abastro> I mean
13:56:27 <abastro> Whether GHC would replace occurrences of `T` to `Int` for `type T = Int`
13:57:27 <dminuoso> If you specify -fprint-expanded-synonyms it will always expand all mentions to the expanded type
13:57:33 <dminuoso> If not, it's largely implementation dependent
13:58:14 <dminuoso> Now before you imagine -fprint-expanded-synonyms to be something you would always want
13:58:41 × cdman quits (~dcm@user/dmc/x-4369397) (Quit: Leaving)
13:58:48 <boxscape_> abastro there are some things that wouldn't be true if it would just replace it, like e.g. in Haskell98 you can't use type synonyms in instances, though with -XTypeSynonymInstances you can
13:58:52 <abastro> How does GHC even manage to print with all these?
13:59:02 <dminuoso> age :: Lens T Int
13:59:04 <dminuoso> looks nice
13:59:12 <abastro> Oh I mean
13:59:27 <abastro> How does GHC manage to type check with all the type aliases/
13:59:31 <abastro> It must be "fun"
14:00:20 <dminuoso> I dont think this is a particular challenge
14:00:56 <abastro> Why?
14:00:57 califax joins (~califax@user/califx)
14:01:03 FinnElija joins (~finn_elij@user/finn-elija/x-0085643)
14:01:11 adanwan joins (~adanwan@gateway/tor-sasl/adanwan)
14:01:15 azimut joins (~azimut@gateway/tor-sasl/azimut)
14:01:18 <dminuoso> As long as you know T is a type synonym, you could either always normalize, or just rig an type equality check to normalize whenever the other thing is not a type alias?
14:01:19 chexum joins (~quassel@gateway/tor-sasl/chexum)
14:01:41 <abastro> I see, interesting
14:01:54 gehmehgeh joins (~user@user/gehmehgeh)
14:01:56 <dminuoso> The former is a bit simpler, but a bit more annoying on diagnostics
14:02:00 <dminuoso> Given my above example:
14:02:03 <dminuoso> age :: Lens T Int
14:02:14 jpds joins (~jpds@gateway/tor-sasl/jpds)
14:02:15 <geekosaur> the only "fun" part about it is trying to remember when an alias was used so the error messages better match the source
14:02:15 littlebobeep joins (~alMalsamo@gateway/tor-sasl/almalsamo)
14:02:18 <dminuoso> type Lens s t a b = forall f . Functor f => (a -> f b) -> s -> f t
14:02:41 <dminuoso> The left hand side is nice to look at, the right hand side is not.
14:03:03 <abastro> I see. Btw... <del>value alias in haskell when</del>
14:03:05 slack1256 joins (~slack1256@191.126.99.203)
14:03:06 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
14:03:15 <geekosaur> let-in
14:03:21 hololeap joins (~hololeap@user/hololeap)
14:05:11 <abastro> `let` enables sharing, no?
14:05:37 <abastro> I heard `type` does not enable sharing of the involved types
14:06:25 deadmarshal_ joins (~deadmarsh@95.38.229.55)
14:06:32 <dminuoso> type-level evaluation works almost, but not quite, entirely different from value-level evaluation
14:06:37 <dminuoso> Not sure what "sharing" would even mean at the type level
14:06:41 ChaiTRex joins (~ChaiTRex@user/chaitrex)
14:07:54 <abastro> Now I wonder how dependent typing would even be possible
14:08:00 <abastro> With such distinctions
14:08:40 stiell_ joins (~stiell@gateway/tor-sasl/stiell)
14:09:09 redb joins (~nmh@136.49.49.211)
14:10:32 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
14:12:30 [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470)
14:12:39 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 240 seconds)
14:12:45 × nehsou^ quits (~nehsou@50-192-56-193-static.hfc.comcastbusiness.net) (Remote host closed the connection)
14:13:19 × redb quits (~nmh@136.49.49.211) (Ping timeout: 246 seconds)
14:13:24 <geekosaur> let *may* enable sharing, it's up to the compiler
14:13:34 <geekosaur> types, it's not clear that "sharing" is a concept
14:13:54 <abastro> Oh noo.. I thought it was enforced.
14:13:58 <geekosaur> in a language like Omega it would
14:14:06 <geekosaur> I believe ghc takes it as a hint
14:14:25 <abastro> I again reveals that my haskell is not properly learned
14:15:09 <boxscape_> dminuoso presumably sharing would mean that if you have `type Sum = 3 + 5`, 3 + 5 is only computed once, regardless of how often you use the type Sum
14:15:34 × littlebobeep quits (~alMalsamo@gateway/tor-sasl/almalsamo) (Ping timeout: 240 seconds)
14:15:55 Guest97 joins (~Guest97@2804:4d98:3001:15:db7c:f54a:d2b3:85db)
14:16:12 <dminuoso> boxscape_: Oh boy, now I want TypeTrace!
14:16:14 × Katarushisu quits (~Katarushi@cpc147334-finc20-2-0-cust27.4-2.cable.virginm.net) (Quit: The Lounge - https://thelounge.chat)
14:16:21 <boxscape_> oh yeah, that would be nice
14:16:30 waleee joins (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340)
14:16:34 Katarushisu joins (~Katarushi@cpc147334-finc20-2-0-cust27.4-2.cable.virginm.net)
14:16:56 <boxscape_> maybe you can implement it with custom type warnings https://github.com/ghc-proposals/ghc-proposals/pull/454
14:17:02 yauhsien joins (~yauhsien@61-231-27-3.dynamic-ip.hinet.net)
14:17:13 <dminuoso> boxscape_: but anyway, I dont have any real type theory expertise to presume to know whether sharing at the type level even makes sense.
14:17:25 <dminuoso> In the presence of type inference and all
14:17:35 <boxscape_> fair, same here I suppose
14:17:42 × marquis_andras quits (~marquis_a@14-201-230-116.tpgi.com.au) (Ping timeout: 260 seconds)
14:18:23 <abastro> TypeTrace XD
14:18:39 × gurkenglas quits (~gurkengla@dslb-178-012-018-212.178.012.pools.vodafone-ip.de) (Ping timeout: 256 seconds)
14:19:35 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection)
14:19:46 × Guest97 quits (~Guest97@2804:4d98:3001:15:db7c:f54a:d2b3:85db) (Client Quit)
14:20:33 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
14:21:56 × pie_ quits (~pie_bnc@user/pie/x-2818909) (Quit: pie_)
14:23:21 littlebobeep joins (~alMalsamo@gateway/tor-sasl/almalsamo)
14:26:06 × sammelweis_ quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Remote host closed the connection)
14:26:23 redb joins (~nmh@136.49.49.211)
14:28:32 vicfred joins (~vicfred@user/vicfred)
14:28:36 <abastro> https://paste.tomsmeding.com/8AqrxpWX
14:28:59 <abastro> I guess I like having fun with useless abstractions
14:29:31 marquis_andras joins (~marquis_a@110-175-153-86.static.tpgi.com.au)
14:30:52 × redb quits (~nmh@136.49.49.211) (Ping timeout: 250 seconds)
14:31:34 <dminuoso> abastro: Lookup TOCTOU
14:31:43 MajorBiscuit joins (~MajorBisc@c-001-009-046.client.tudelft.eduvpn.nl)
14:31:47 <dminuoso> On a multi-user system that code has TOCTOU races
14:32:21 pie_ joins (~pie_bnc@user/pie/x-2818909)
14:32:28 × pie_ quits (~pie_bnc@user/pie/x-2818909) (Client Quit)
14:32:40 <abastro> You got why I said "useless"
14:33:38 <abastro> But if my executable is working on a directory not intended for user access and user accessed anyway, is it my fault?
14:33:41 pie_ joins (~pie_bnc@user/pie/x-2818909)
14:35:12 × benin quits (~benin@183.82.204.110) (Quit: The Lounge - https://thelounge.chat)
14:36:04 × deadmarshal_ quits (~deadmarsh@95.38.229.55) (Ping timeout: 246 seconds)
14:41:39 × pretty_dumm_guy quits (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Ping timeout: 240 seconds)
14:42:52 × yauhsien quits (~yauhsien@61-231-27-3.dynamic-ip.hinet.net) (Remote host closed the connection)
14:43:27 yauhsien joins (~yauhsien@61-231-27-3.dynamic-ip.hinet.net)
14:43:48 <maerwald_> that's why I dislike the 'path' package
14:43:55 <maerwald_> It makes that distinction as well
14:44:27 × michalz quits (~michalz@185.246.204.58) (Remote host closed the connection)
14:45:51 shriekingnoise joins (~shrieking@201.231.16.156)
14:47:53 <abastro> Oh, path package existed
14:48:06 <abastro> Apparently it depends on heavyweight aeson
14:48:19 × yauhsien quits (~yauhsien@61-231-27-3.dynamic-ip.hinet.net) (Ping timeout: 246 seconds)
14:48:20 sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10)
14:49:10 pretty_dumm_guy joins (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655)
14:49:16 <abastro> Is it really bad if I assume no one should interfere with certain directories in my program?
14:49:34 <maerwald_> yes
14:49:41 <maerwald_> the filesystem is mutable
14:50:19 <abastro> Then how do I manage the directories
14:52:20 <maerwald_> you handle failure when you operate on the file, so filesystem code usually has a lot of try/catch
14:52:36 <maerwald_> and you try to avoid checking the file type explicitly
14:52:57 emad joins (~emad@102.47.204.93)
14:53:24 × emad quits (~emad@102.47.204.93) (Remote host closed the connection)
14:53:57 <abastro> I mean, isn't throwing IO exception equal to "We would not care about this specific case"
14:54:07 <abastro> oh you mean handling every possible exceptions
14:54:46 Sgeo joins (~Sgeo@user/sgeo)
14:54:47 ec joins (~ec@gateway/tor-sasl/ec)
14:54:48 × merijn quits (~merijn@c-001-001-001.client.esciencecenter.eduvpn.nl) (Ping timeout: 276 seconds)
14:56:28 <abastro> But that's not always practical
14:56:29 <geekosaur> you don't have to catch every possible exception, but for example if you expect a file and it's a directory then openFile will throw (except with a local directory on *bsd)
14:57:50 <abastro> Yep, I think in some cases, one just want to throw the error as "unexpected"
14:58:17 <abastro> Because it is likely a user error or hardware fault
14:58:49 × akegalj quits (~akegalj@141-136-168-234.dsl.iskon.hr) (Ping timeout: 246 seconds)
14:59:02 redb joins (~nmh@136.49.49.211)
14:59:21 <abastro> I think for small scripts, if I created a directory for my executable's usage, and someone modified it, then it is okay to throw error
14:59:45 × elkcl quits (~elkcl@broadband-37-110-156-162.ip.moscow.rt.ru) (Read error: Connection reset by peer)
14:59:58 elkcl joins (~elkcl@broadband-37-110-156-162.ip.moscow.rt.ru)
15:01:05 × dextaa quits (~dextaa@user/dextaa) (Remote host closed the connection)
15:02:15 dextaa joins (~dextaa@user/dextaa)
15:02:31 <abastro[m]> But yeah, "this directory better exists so I can avoid creating it by mistake" is dumb
15:03:00 × dextaa quits (~dextaa@user/dextaa) (Remote host closed the connection)
15:03:03 <abastro[m]> Still think Executable part is worth remaining tho
15:03:43 × abastro quits (~abab9579@220.75.216.63) (Ping timeout: 260 seconds)
15:03:50 <abastro[m]> As I dislike when suddenly `/usr/bin/sudo` disappears
15:04:11 <abastro[m]> (Could happen regularly I guess)
15:05:34 × lortabac quits (~lortabac@2a01:e0a:541:b8f0:8b3f:8bd5:3852:70b0) (Quit: WeeChat 2.8)
15:05:48 dextaa joins (~dextaa@user/dextaa)
15:05:50 <abastro[m]> If filesystem is mutable, how do you manage cleaning up files?
15:07:09 × redb quits (~nmh@136.49.49.211) (Ping timeout: 276 seconds)
15:07:34 × dextaa quits (~dextaa@user/dextaa) (Remote host closed the connection)
15:07:35 × xff0x_ quits (~xff0x@om126194210237.10.openmobile.ne.jp) (Read error: Connection reset by peer)
15:09:01 dextaa joins (~dextaa@user/dextaa)
15:11:14 <abastro[m]> Is "trying to remove files" enough?
15:14:35 × dextaa quits (~dextaa@user/dextaa) (Remote host closed the connection)
15:14:59 <c_wraith> there are hierarchies of how much to care. Is the file in a user-owned application-specific space? Then if something else the user does interferes with it, that's their fault.
15:15:07 × maerwald_ quits (~maerwald@mail.hasufell.de) (Changing host)
15:15:07 maerwald_ joins (~maerwald@user/maerwald)
15:15:15 maerwald_ is now known as maerwald
15:15:17 <c_wraith> Is the file in the shared temporary space? Best not to expect anything of it
15:15:37 <c_wraith> and there's a spectrum in between
15:15:44 dextaa joins (~dextaa@user/dextaa)
15:15:52 redb joins (~nmh@136.49.49.211)
15:16:07 <maerwald> abastro[m]: removePathForcibly
15:16:17 <maerwald> and on windows, you also need retry strategies due to file locking
15:17:23 <c_wraith> The most dangerous cases are when you're writing a long-running program that will run with elevated privileges that creates temporary files in /tmp.
15:17:48 <abastro[m]> c_wraith: yea, I assume it is in user-owned app-specific space. So I think it's okay to crash while doing restartable tasks
15:18:18 <abastro[m]> maerwald: Surely `removePathForcibly` can fail
15:18:24 <maerwald> sure
15:18:32 <maerwald> you just `try` it an ignore errors then
15:18:50 <abastro[m]> c_wraith: oh no, elevated privilege
15:19:11 <abastro[m]> Yea, in the end, there is a scope in which you ignore vs consider
15:19:16 yauhsien joins (~yauhsien@61-231-27-3.dynamic-ip.hinet.net)
15:20:30 <maerwald> hideError errs = handleIO (\e -> if ioeGetErrorType e `elem` errs then pure () else liftIO . ioError $ e)
15:21:33 × redb quits (~nmh@136.49.49.211) (Ping timeout: 256 seconds)
15:23:53 <abastro[m]> Accumulating errors to log might be good hmm
15:24:09 kenran joins (~kenran@200116b82be0c90001725bbb0612ecd3.dip.versatel-1u1.de)
15:24:14 <abastro[m]> Wait I could just `stderr`
15:25:19 <geekosaur> until you have multiple threads and they interleave
15:25:59 × justsomeguy quits (~justsomeg@user/justsomeguy) (Ping timeout: 240 seconds)
15:30:20 merijn joins (~merijn@c-001-001-001.client.esciencecenter.eduvpn.nl)
15:32:53 × Pickchea quits (~private@user/pickchea) (Ping timeout: 256 seconds)
15:33:22 pagnol joins (~user@014198154145.ctinets.com)
15:34:52 × merijn quits (~merijn@c-001-001-001.client.esciencecenter.eduvpn.nl) (Ping timeout: 246 seconds)
15:35:10 <abastro[m]> Hehe
15:35:11 <abastro[m]> Wait that could be messup
15:36:01 <abastro[m]> "Error: Foo"... (full message at https://libera.ems.host/_matrix/media/r0/download/libera.chat/16cd4b824228d3f7911017caf66cb8acc9333650)
15:36:48 <geekosaur> it gets pretty bad, yep
15:37:09 <geekosaur> especially since buffering doesn't work the same way in Haskell as in C
15:39:34 × jpds quits (~jpds@gateway/tor-sasl/jpds) (Ping timeout: 240 seconds)
15:39:49 _ht joins (~quassel@231-169-21-31.ftth.glasoperator.nl)
15:42:26 redb joins (~nmh@136.49.49.211)
15:43:09 jpds joins (~jpds@gateway/tor-sasl/jpds)
15:44:56 <abastro[m]> Is it different in C?
15:45:18 × zaquest quits (~notzaques@5.130.79.72) (Remote host closed the connection)
15:45:59 × jgeerds quits (~jgeerds@d53604b0.access.ecotel.net) (Ping timeout: 240 seconds)
15:46:23 zaquest joins (~notzaques@5.130.79.72)
15:46:54 <geekosaur> C's string output will write to the buffer as a chunk. Haskell's putStr is literally mapM_ putChar, so another thread can interleave at the character level
15:46:59 akegalj joins (~akegalj@141-136-168-234.dsl.iskon.hr)
15:48:06 <c_wraith> yeah, you discover that very quickly if you're doing output from multiple threads.
15:48:07 × waleee quits (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Ping timeout: 260 seconds)
15:48:19 <abastro[m]> Now that is another gripe of String
15:48:31 <pagnol> does this correspond to anything in Haskell or cat theory? https://ramdajs.com/docs/#applySpec
15:48:41 <pagnol> (minus the recursion)
15:49:19 <c_wraith> that looks a lot like a catamorphism
15:49:34 <c_wraith> which is a fancy word for a specific kind of fold
15:49:48 <pagnol> means nothing to me but I'll look into it, thanks
15:50:07 × pagnol quits (~user@014198154145.ctinets.com) (Remote host closed the connection)
15:51:13 <c_wraith> oh, I misread. too bad they didn't stick around for a correction.
15:51:48 pagnol joins (~user@014198154145.ctinets.com)
15:52:10 <c_wraith> pagnol: I misread. that's not it at all
15:52:20 <pagnol> c_wraith: my battery died, did you write anything more in response to my question?
15:52:28 <abastro[m]> Weird mix of record
15:52:48 carl joins (~carl@120.244.220.166)
15:52:54 <c_wraith> yeah, I wrote "I misread, it's not a catamorphism at all"
15:53:03 <abastro[m]> The API looks like weird mix of records to me*
15:54:19 <pagnol> If we disregard the recursion/nesting, then it's somewhat like A -> Map String (A -> ... whatever )
15:54:23 <c_wraith> I don't think that's anything especially interesting theoretically. maybe you could claim there's something interesting about the preservation of shape, but mostly it's a convenient shorthand for constructing a flavor of function
15:54:36 <hololeap> kinda looks like: Map k (a -> v) -> a -> Map k v
15:55:45 <pagnol> ah yes
15:55:52 × coot quits (~coot@213.134.190.95) (Quit: coot)
15:56:26 coot joins (~coot@213.134.190.95)
15:56:39 × machinedgod quits (~machinedg@24.105.81.50) (Ping timeout: 240 seconds)
15:57:07 <pagnol> maybe in Haskell it's a bit awkward due to the lack of a proper record type, but I find myself reaching for this pattern in other languages quite often
15:58:17 <c_wraith> > sequence (M.fromList [("foo", (+1))]) 1
15:58:18 <lambdabot> fromList [("foo",2)]
15:58:28 <abastro[m]> For the specified example there, one can use Monoid
15:58:39 <c_wraith> or just sequence.
15:59:12 <abastro[m]> > foldMap (\a -> (Sum a, Product a)) [1..5]
15:59:12 <pagnol> well usually one would like to use the type system to make sure that exactly certain keys are present
15:59:14 <lambdabot> (Sum {getSum = 15},Product {getProduct = 120})
16:00:03 <abastro[m]> Instead of a tuple, one could create record datatype which implements Monoid
16:00:29 <c_wraith> if you have a data type, just make it Traversable
16:01:12 <c_wraith> that gets you basically the functionality there.
16:02:20 <c_wraith> of course, you typically wouldn't require that all your fields be the same type in Haskell. that's where things get more complex.
16:02:32 <pagnol> right
16:03:38 lbseale joins (~ep1ctetus@user/ep1ctetus)
16:04:37 <abastro[m]> I don't think we would get this kind of pattern that often in nominally typed languages
16:05:12 <abastro[m]> Could be useful for js
16:05:48 <c_wraith> we certainly have "build a record from an input"
16:06:14 <c_wraith> it just tends to get abstracted in a totally different direction
16:06:15 <abastro[m]> Oh, from single input?
16:06:57 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
16:06:59 <abastro[m]> Right.
16:07:11 <c_wraith> like, parser combinators for instance
16:07:24 <pagnol> alright, that's been an enlightening discussion thank you everybody for your responses
16:08:10 <abastro[m]> Actually I don't see the `applySpec` saving much keystrokes
16:08:46 <abastro[m]> Could use lambdas and apply parameter to each
16:08:57 × boxscape_ quits (~boxscape_@p4ff0b7be.dip0.t-ipconnect.de) (Quit: Connection closed)
16:09:05 <abastro[m]> I could be mistaken though, like perhaps the records are large
16:10:22 <c_wraith> well, if you use it consistently, it gives you a kind of reuse.
16:10:35 <c_wraith> with how it supports nested records
16:11:12 × carl quits (~carl@120.244.220.166) (Quit: WeeChat 3.5)
16:11:34 × kenran quits (~kenran@200116b82be0c90001725bbb0612ecd3.dip.versatel-1u1.de) (Quit: WeeChat info:version)
16:12:01 <pagnol> I find it useful in TypeScript because you can define a new type based an existing one and also supply a mapping in a type-safe manner
16:12:07 × vysn quits (~vysn@user/vysn) (Ping timeout: 240 seconds)
16:12:12 <c_wraith> that's what made me think of parser combinators - the way they can be nested simply
16:12:56 kenran joins (~kenran@200116b82be0c9005f346492206b34b5.dip.versatel-1u1.de)
16:13:10 × kenran quits (~kenran@200116b82be0c9005f346492206b34b5.dip.versatel-1u1.de) (Client Quit)
16:13:23 kenran joins (~kenran@200116b82be0c9005f346492206b34b5.dip.versatel-1u1.de)
16:14:44 × ubert1 quits (~Thunderbi@2a02:8109:9880:303c:8727:84d3:4f94:88b2) (Remote host closed the connection)
16:15:01 <pagnol> I thought conceptually perhaps there is a connection to lenses somewhere
16:17:30 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
16:18:41 <c_wraith> I thought about that a bit, when I was connecting it up with Traversable, as lenses are sort of a generalization of Traversable. but you quickly get into incredibly ad-hoc things that work like `each' if you try to go that way
16:19:17 <c_wraith> > (1, 2) & each +~ 6
16:19:18 <lambdabot> (7,8)
16:19:47 <c_wraith> handy, but so hard to predict
16:19:49 × coot quits (~coot@213.134.190.95) (Quit: coot)
16:20:29 × vicfred quits (~vicfred@user/vicfred) (Quit: Leaving)
16:23:19 × zyklotomic quits (~ethan@res380d-128-61-87-175.res.gatech.edu) (Ping timeout: 240 seconds)
16:23:22 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Remote host closed the connection)
16:24:30 × ralu1 quits (~ralu@static.211.245.203.116.clients.your-server.de) (Ping timeout: 276 seconds)
16:24:42 <c_wraith> or more directly...
16:24:44 <c_wraith> > sequenceOf each ((+2), (*3)) 5
16:24:46 <lambdabot> (7,15)
16:25:02 geekosaur joins (~geekosaur@xmonad/geekosaur)
16:25:23 zyklotomic joins (~ethan@r4-128-61-95-197.res.gatech.edu)
16:25:41 <c_wraith> ultimately, anything working like that in Haskell has the restriction that the functions must all have the same output type as well as the same input type
16:26:26 × jinsun__ quits (~jinsun@user/jinsun) ()
16:27:14 merijn joins (~merijn@c-001-001-001.client.esciencecenter.eduvpn.nl)
16:27:55 <c_wraith> however, I've just realized... you can do a combinator interface without anything special at all
16:28:38 jinsun joins (~jinsun@user/jinsun)
16:29:02 <c_wraith> > (pure (,) <*> show <*> (* 3)) 2
16:29:03 <lambdabot> ("2",6)
16:29:27 <c_wraith> the function instance for Applicative does everything already
16:30:10 <c_wraith> that's probably the most Haskellish interpretation of the purpose of that function
16:32:57 <c_wraith> at least when you look at applying it to records rather than the way TS uses dictionaries
16:35:23 jakalx parts (~jakalx@base.jakalx.net) (Error from remote client)
16:36:11 × kuribas quits (~user@ip-188-118-57-242.reverse.destiny.be) (Remote host closed the connection)
16:36:30 jakalx joins (~jakalx@base.jakalx.net)
16:38:20 bitmapper joins (uid464869@id-464869.lymington.irccloud.com)
16:38:54 <bitmapper> is snap still ok to use or has development been slow for so long that it is no longer up to date
16:39:45 × ccntrq quits (~Thunderbi@2a01:e34:eccb:b060:b69c:53df:cf2c:87d1) (Remote host closed the connection)
16:41:56 heichro joins (~user@p5495e117.dip0.t-ipconnect.de)
16:43:30 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
16:43:49 <hololeap> bitmapper: I haven't done any extensive testing with it, but we still package it for gentoo-haskell by loosening a bunch of upper bounds of dependencies in the cabal file
16:43:55 <hololeap> https://github.com/gentoo-haskell/gentoo-haskell/blob/master/dev-haskell/snap/snap-1.1.3.1-r5.ebuild#L61-L69
16:44:44 <bitmapper> it's just i really don't like Yesod and would greatly prefer to use Snap
16:45:40 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
16:46:22 <hololeap> anyway it compiles with ghc-9.0.2 and aeson-1.5.6.0 if you just edit the cabal file a bit
16:52:08 econo joins (uid147250@user/econo)
16:52:48 <bitmapper> it's pretty annoying needing to use GHC 9.2.2
16:53:15 × yauhsien quits (~yauhsien@61-231-27-3.dynamic-ip.hinet.net) (Remote host closed the connection)
16:54:12 deadmarshal_ joins (~deadmarsh@95.38.229.55)
16:56:44 <janus> bitmapper: if you annoy mightybite on discord he seems to respond
16:57:04 <janus> bitmapper: i just had the a text-2 revision updated for snap-core like that
16:57:31 <janus> my strategy is to annoy no more than once every month, so i'd recommend making a schedule such that you don't forget to annoy him when it seems socially acceptable
16:58:04 <janus> *mightybyte
16:58:29 ralu1 joins (~ralu@static.211.245.203.116.clients.your-server.de)
16:58:57 × deadmarshal_ quits (~deadmarsh@95.38.229.55) (Ping timeout: 276 seconds)
16:59:08 <janus> i also really deemphasize the urgency of it every time, to make it seem like i am a super cool relaxed person that doesn't really care about version bounds
17:00:39 × MajorBiscuit quits (~MajorBisc@c-001-009-046.client.tudelft.eduvpn.nl) (Quit: WeeChat 3.4)
17:01:37 × merijn quits (~merijn@c-001-001-001.client.esciencecenter.eduvpn.nl) (Ping timeout: 260 seconds)
17:12:04 × thaumavorio quits (~thaumavor@thaumavor.io) (Quit: ZNC 1.8.2 - https://znc.in)
17:12:54 thaumavorio joins (~thaumavor@thaumavor.io)
17:12:58 <janus> > [1 | True]
17:12:59 <lambdabot> [1]
17:13:04 <janus> > [1 | False]
17:13:06 <lambdabot> []
17:13:11 <janus> never saw this syntax before :O
17:13:17 qwedfg joins (~qwedfg@user/qwedfg)
17:13:45 <geekosaur> it's just a minimized list comprehension
17:14:08 <geekosaur> @undo [ 1 | False ]
17:14:08 <lambdabot> if False then [1] else []
17:14:21 × kenran quits (~kenran@200116b82be0c9005f346492206b34b5.dip.versatel-1u1.de) (Quit: WeeChat info:version)
17:19:52 <dminuoso> > [ 1 | otherwise ]
17:19:55 <lambdabot> [1]
17:20:08 <dminuoso> I can see this being useful for random obfuscation tricks.
17:20:27 × pretty_dumm_guy quits (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Ping timeout: 260 seconds)
17:20:31 <dminuoso> singleton x = [ x | otherwise ]
17:20:36 <dminuoso> Just put this into your code for good measure.
17:20:57 <dminuoso> Keeps your coworkers on their toes.
17:23:00 × dut quits (~dut@user/dut) (Ping timeout: 276 seconds)
17:25:26 tzh joins (~tzh@c-24-21-73-154.hsd1.wa.comcast.net)
17:31:21 <opqdonut> dminuoso: lovely
17:32:38 vicfred joins (~vicfred@user/vicfred)
17:32:55 wootehfoot joins (~wootehfoo@user/wootehfoot)
17:35:52 <hololeap> even better if you have MonadComprehensions on
17:37:57 × pagnol quits (~user@014198154145.ctinets.com) (Ping timeout: 276 seconds)
17:38:11 <dminuoso> Okay, now with yahb in the mix, I've created a monster!
17:38:14 <dminuoso> % sing = flip (const id) [ x | otherwise ] [ undefined ]
17:38:14 <yahb> dminuoso:
17:38:18 <dminuoso> % sing
17:38:19 <yahb> dminuoso: [[<<Integer>>,<<[Char]>>,<<Char>>]]
17:38:35 incertia_ joins (~incertia@d47-69-133-171.try.wideopenwest.com)
17:38:44 <dminuoso> Spot this one! :)
17:39:20 <dminuoso> I should maintain a file with all these cute tricks.
17:39:24 × incertia quits (~incertia@207.98.163.88) (Ping timeout: 240 seconds)
17:39:24 incertia_ is now known as incertia
17:42:30 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
17:43:32 <opqdonut> dminuoso: was there a previous definition of x just lying around or is that a useful definition like the lambdabot Expr stuff?
17:43:34 × hololeap quits (~hololeap@user/hololeap) (Ping timeout: 240 seconds)
17:43:43 <dminuoso> The latter. :)
17:44:01 <geekosaur> % :t x
17:44:01 <yahb> geekosaur: [Dynamic]
17:44:15 <opqdonut> % x+1
17:44:15 <yahb> opqdonut: ; <interactive>:150:2: error:; * No instance for (Num [Dynamic]) arising from a use of `+'; * In the expression: x + 1; In an equation for `it': it = x + 1
17:44:49 p_____ joins (~dyeplexer@user/dyeplexer)
17:44:58 × p_____ quits (~dyeplexer@user/dyeplexer) (Remote host closed the connection)
17:46:31 hololeap joins (~hololeap@user/hololeap)
17:47:57 machinedgod joins (~machinedg@24.105.81.50)
17:48:22 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Remote host closed the connection)
17:49:13 neceve joins (~quassel@2.29.116.221)
17:50:10 geekosaur joins (~geekosaur@xmonad/geekosaur)
17:56:20 aman joins (~aman@user/aman)
18:01:00 stackdroid18 joins (14094@user/stackdroid)
18:03:11 jakalx parts (~jakalx@base.jakalx.net) ()
18:03:18 × redb quits (~nmh@136.49.49.211) (Ping timeout: 276 seconds)
18:04:00 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
18:04:59 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
18:05:34 × hololeap quits (~hololeap@user/hololeap) (Ping timeout: 240 seconds)
18:05:52 `2jt joins (~jtomas@175.red-83-36-129.dynamicip.rima-tde.net)
18:05:52 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Client Quit)
18:06:55 × mikoto-chan quits (~mikoto-ch@213.177.151.239) (Quit: mikoto-chan)
18:07:44 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
18:08:59 hololeap joins (~hololeap@user/hololeap)
18:09:30 jakalx joins (~jakalx@base.jakalx.net)
18:09:57 acidjnk joins (~acidjnk@p200300d0c722df612442a13791a64f70.dip0.t-ipconnect.de)
18:13:12 × ec quits (~ec@gateway/tor-sasl/ec) (Quit: ec)
18:16:40 × akegalj quits (~akegalj@141-136-168-234.dsl.iskon.hr) (Quit: leaving)
18:17:04 × littlebobeep quits (~alMalsamo@gateway/tor-sasl/almalsamo) (Ping timeout: 240 seconds)
18:18:04 × hololeap quits (~hololeap@user/hololeap) (Ping timeout: 240 seconds)
18:19:40 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
18:19:57 mikoto-chan joins (~mikoto-ch@213.177.151.239)
18:20:08 × CiaoSen quits (~Jura@p200300c95732ec002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 248 seconds)
18:22:40 hololeap joins (~hololeap@user/hololeap)
18:23:02 tromp joins (~textual@77.249.230.40)
18:24:50 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
18:25:08 × aman quits (~aman@user/aman) (Quit: aman)
18:25:57 × `2jt quits (~jtomas@175.red-83-36-129.dynamicip.rima-tde.net) (Remote host closed the connection)
18:25:58 × dyeplexer quits (~dyeplexer@user/dyeplexer) (Remote host closed the connection)
18:26:35 redb joins (~nmh@136.49.49.211)
18:29:38 coot joins (~coot@213.134.190.95)
18:31:15 × redb quits (~nmh@136.49.49.211) (Ping timeout: 276 seconds)
18:32:24 redb joins (~nmh@136.49.49.211)
18:32:28 xkuru joins (~xkuru@user/xkuru)
18:33:50 jerry99 joins (~330f3999@cerf.good1.com)
18:34:04 × hololeap quits (~hololeap@user/hololeap) (Ping timeout: 240 seconds)
18:37:05 waleee joins (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340)
18:37:12 hololeap joins (~hololeap@user/hololeap)
18:39:37 aman joins (~aman@user/aman)
18:45:16 × redb quits (~nmh@136.49.49.211) (Ping timeout: 246 seconds)
18:46:07 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
18:48:23 <Hecate> dminuoso: you messed up powerdns' description markup :)
18:50:08 <dminuoso> huh what?
18:50:53 <Hecate> https://hackage.haskell.org/package/powerdns-0.4.1
18:50:55 <dminuoso> Mmm. This is surprising, I guess something changed between cabal 1.10 and 3.0
18:50:57 <dminuoso> This is curious
18:51:09 <Hecate> dminuoso: you mean, between three major, breaking releases?
18:51:15 <Hecate> yeah something's bound to change :-P
18:52:54 × aman quits (~aman@user/aman) (Quit: aman)
18:52:58 jhagborg joins (~jhagborg@068-187-237-099.res.spectrum.com)
18:54:24 <dminuoso> Hecate: This is one is curious. I dont quite understand why this would be the case.
18:54:49 × mrosenbe quits (~mrosenbe@4.7.173.100) (Remote host closed the connection)
18:55:29 redb joins (~nmh@136.49.49.211)
18:55:48 bahamas joins (~lucian@93.122.251.130)
18:56:24 <dminuoso> Let me run haddock on this locally
18:58:28 <dminuoso> Could this possibly be a haddock bug?
18:59:21 <dminuoso> The description field hasnt changed, its freeform. It's haddock that interprets this as markup, but apparently not for when the cabal-version is 3.0
18:59:59 × redb quits (~nmh@136.49.49.211) (Ping timeout: 240 seconds)
19:04:10 × dhouthoo quits (~dhouthoo@178-117-36-167.access.telenet.be) (Quit: WeeChat 3.5)
19:05:49 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
19:12:44 jgeerds joins (~jgeerds@d53604b0.access.ecotel.net)
19:12:51 jmdaemon joins (~jmdaemon@user/jmdaemon)
19:19:00 redb joins (~nmh@136.49.49.211)
19:23:54 × redb quits (~nmh@136.49.49.211) (Ping timeout: 276 seconds)
19:24:30 redb joins (~nmh@136.49.49.211)
19:27:42 Guest27 joins (~Guest27@2601:281:d47f:1590:768c:7129:aa80:96d9)
19:29:38 × redb quits (~nmh@136.49.49.211) (Ping timeout: 272 seconds)
19:32:02 × bahamas quits (~lucian@93.122.251.130) (Read error: Connection reset by peer)
19:32:10 <dminuoso> Hecate: Im beginning to suspect this could be a cabal-install bug.
19:32:25 <dminuoso> Presumably hackage ends up invoking `cabal haddock` right?
19:34:21 × tromp quits (~textual@77.249.230.40) (Quit: My iMac has gone to sleep. ZZZzzz…)
19:36:20 MajorBiscuit joins (~MajorBisc@86-88-79-148.fixed.kpn.net)
19:40:21 × stackdroid18 quits (14094@user/stackdroid) (Quit: hasta la vista... tchau!)
19:40:45 redb joins (~nmh@136.49.49.211)
19:40:59 stackdroid18 joins (14094@user/stackdroid)
19:41:16 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
19:45:21 × redb quits (~nmh@136.49.49.211) (Ping timeout: 276 seconds)
19:48:31 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
19:51:01 × tv quits (~tv@user/tv) (Ping timeout: 240 seconds)
19:53:38 anomal joins (~anomal@87.227.196.109)
19:58:04 × jonathanx quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Ping timeout: 246 seconds)
19:58:25 <dminuoso> Hecate: Okay I have a testcase now. Im almost entirely convinced this is a cabal-install bug.
19:58:35 <dminuoso> Phew!
19:58:57 × _ht quits (~quassel@231-169-21-31.ftth.glasoperator.nl) (Remote host closed the connection)
20:00:40 yauhsien joins (~yauhsien@61-231-27-3.dynamic-ip.hinet.net)
20:01:00 <sclv> the description field isn't rendered by cabal-install or by haddock -- its rendered by hackage
20:01:47 <dminuoso> Mmm. I think I understand the reason now. In cabal-version 3.0 it was changed that empty lines are preserved and dots get processed as input now.
20:01:52 <dminuoso> That screwed up the haddock markdown.
20:02:43 redb joins (~nmh@136.49.49.211)
20:03:49 Tuplanolla joins (~Tuplanoll@91-159-69-98.elisa-laajakaista.fi)
20:06:12 <dminuoso> Hecate: Okay, luckily I can simply use a revision here. Thanks for the headsup and sorry for the noise.
20:06:15 × jerry99 quits (~330f3999@cerf.good1.com) (Quit: CGI:IRC (Ping timeout))
20:08:17 × jhagborg quits (~jhagborg@068-187-237-099.res.spectrum.com) (Ping timeout: 256 seconds)
20:08:59 × redb quits (~nmh@136.49.49.211) (Ping timeout: 240 seconds)
20:10:49 tv joins (~tv@user/tv)
20:11:36 × heichro quits (~user@p5495e117.dip0.t-ipconnect.de) (Quit: ERC (IRC client for Emacs 27.2))
20:19:16 redb joins (~nmh@136.49.49.211)
20:21:10 fendor_ joins (~fendor@178.165.175.241.wireless.dyn.drei.com)
20:22:16 jhagborg joins (~jhagborg@068-187-237-099.res.spectrum.com)
20:23:35 × fendor quits (~fendor@178.115.48.2.wireless.dyn.drei.com) (Ping timeout: 256 seconds)
20:23:37 × redb quits (~nmh@136.49.49.211) (Ping timeout: 246 seconds)
20:25:23 × stackdroid18 quits (14094@user/stackdroid) (Quit: hasta la vista... tchau!)
20:26:58 redb joins (~nmh@136.49.49.211)
20:31:19 × redb quits (~nmh@136.49.49.211) (Ping timeout: 246 seconds)
20:32:21 off^ joins (~off@50-192-56-193-static.hfc.comcastbusiness.net)
20:36:19 neurocyte8614492 joins (~neurocyte@IP-046243080005.dynamic.medianet-world.de)
20:36:19 × neurocyte8614492 quits (~neurocyte@IP-046243080005.dynamic.medianet-world.de) (Changing host)
20:36:19 neurocyte8614492 joins (~neurocyte@user/neurocyte)
20:36:55 × slack1256 quits (~slack1256@191.126.99.203) (Ping timeout: 246 seconds)
20:40:50 redb joins (~nmh@136.49.49.211)
20:40:56 Guest91 joins (~Guest91@caliga.eecs.tufts.edu)
20:41:11 × cross_ quits (~cross@spitfire.i.gajendra.net) (Remote host closed the connection)
20:41:14 <Guest91> Guest91: Well, I've managed to get 8.6.5 to build for me.  Took some doing, and two separate edits to the same part of a single conf.py file to fix two different problems with it.  I'll see if that set of bugs persists into 9.2.2 before reporting it.  (Problems are both with LaTeX config in a .py file.  Python's Unicode handling hates the
20:41:15 <Guest91> single \ that LaTeX uses, but changing those to \\ seems to fix it.  And LaTeX bugs out on the font specifications in the same config having spaces in them.)
20:44:58 × redb quits (~nmh@136.49.49.211) (Ping timeout: 246 seconds)
20:46:35 <EvanR> are you sure you're in the right room
20:46:57 deadmarshal_ joins (~deadmarsh@95.38.229.55)
20:48:08 <Guest91> For Haskell 8.6.5?  Yup.  Got some help here yesterday for a custom central build of GHC and several Haskell packages, figured I'd report back on progress in case anyone cared.
20:48:33 <Guest91> Step 1, still in progress, getting 9.2.2 built when all I have to work with initially is 8.2.2.
20:48:50 littlebobeep joins (~alMalsamo@gateway/tor-sasl/almalsamo)
20:49:17 <EvanR> oh ok
20:49:54 <Guest91> I was surprised to see .py files in the GHC source tree, but there they were.
20:50:07 <Rembane> Python 2 or 3?
20:51:03 <EvanR> build system stone soup
20:51:14 <Guest91> Dunno!  They're conf.py files without a shebang at the top.  Let me see what the configurator found.
20:51:48 <geekosaur> the test environment is in python
20:52:01 <geekosaur> s/environment/harness/
20:52:08 <Guest91> Configurator log doesn't say.  Given that, it's probably using the first thing that answers 'python' in my PATH, which is Python 3.
20:52:10 <geekosaur> dunno about anything else
20:52:18 <Rembane> Guest91: Sounds good.
20:52:39 × neceve quits (~quassel@2.29.116.221) (Ping timeout: 240 seconds)
20:52:40 <Rembane> I guess Python is nicer to build a test harness in than bash
20:53:29 <Guest91> geekosaur: this particular conf.py file looks to be part of the documentation build.
20:56:13 redb joins (~nmh@136.49.49.211)
20:57:40 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Killed (NickServ (GHOST command used by allbery_b)))
20:57:40 allbery_b joins (~geekosaur@xmonad/geekosaur)
20:57:43 allbery_b is now known as geekosaur
20:57:55 <monochrom> If you go back 10 years, you would find a perl script, too. >:)
20:58:07 <Guest91> I can go look in the tarballs I have stashed away!
20:58:11 <geekosaur> I gather it's still there, for LLVM
20:58:15 <Guest91> I may even have one that old.
20:58:17 <monochrom> Oh haha
20:59:28 × Guest27 quits (~Guest27@2601:281:d47f:1590:768c:7129:aa80:96d9) (Quit: Client closed)
21:00:20 <Guest91> Hm, nope.  I do have an elderly Haskell Platform build from 2011 -- for RHEL 5 -- but apparently wasn't saving tarballs at the time.  Probably should just delete that; we have no RHEL 5 hosts left.
21:02:42 × MajorBiscuit quits (~MajorBisc@86-88-79-148.fixed.kpn.net) (Ping timeout: 276 seconds)
21:04:38 × redb quits (~nmh@136.49.49.211) (Ping timeout: 272 seconds)
21:05:28 × zer0bitz quits (~zer0bitz@2001:2003:f444:8f00:7182:b1bf:175f:4221) (Ping timeout: 248 seconds)
21:06:33 redb joins (~nmh@136.49.49.211)
21:06:59 × jhagborg quits (~jhagborg@068-187-237-099.res.spectrum.com) (Ping timeout: 240 seconds)
21:07:59 jao joins (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net)
21:08:09 × wootehfoot quits (~wootehfoo@user/wootehfoot) (Quit: Leaving)
21:08:21 × cheategg quits (~Username@user/cheater) (Ping timeout: 256 seconds)
21:08:50 <geekosaur> imagine being able to remove old platforms
21:09:28 <Rembane> In a few thousand years it should be possible.
21:09:31 <geekosaur> I couldn't even remove the pmax_ul4 stuff in 2010, when we'd desupported them in 2000 because the y2k patch didn't come out until late
21:10:14 <Guest91> Hah.  I'm not as confident as I'd like to be that nobody's using this, so I'll have to dig to make sure.  But at a guess, nobody wants Haskell Platform 2011.2.0.1 for anything anymore.
21:10:19 <geekosaur> at least I didn't have to try to build stuff for them any more
21:10:46 <EvanR> if you remove enough platforms is it really the original ship of ghthecius
21:10:52 × redb quits (~nmh@136.49.49.211) (Ping timeout: 246 seconds)
21:11:21 <EvanR> I don't envy the job of software archeologist
21:12:23 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
21:12:35 geekosaur is *almost* tempted to install AFS just to poke and see if pmax support is *still* in the depot tree
21:12:44 zeenk joins (~zeenk@2a02:2f04:a313:d600:8d26:ec9f:3ff6:fc94)
21:13:00 × cosimone` quits (~user@2001:b07:ae5:db26:c24a:d20:4d91:1e20) (Remote host closed the connection)
21:13:04 <Guest91> If you do, make sure to have a good bottle of scotch to hand.
21:13:12 <Guest91> You'll probably need it.
21:13:15 pretty_dumm_guy joins (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655)
21:13:32 redb joins (~nmh@136.49.49.211)
21:15:12 × chele quits (~chele@user/chele) (Remote host closed the connection)
21:16:00 × fendor_ quits (~fendor@178.165.175.241.wireless.dyn.drei.com) (Remote host closed the connection)
21:16:08 aman joins (~aman@user/aman)
21:17:49 cheategg joins (~Username@user/cheater)
21:17:52 × redb quits (~nmh@136.49.49.211) (Ping timeout: 246 seconds)
21:19:02 redb joins (~nmh@136.49.49.211)
21:22:03 × takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection)
21:26:04 × hololeap quits (~hololeap@user/hololeap) (Ping timeout: 240 seconds)
21:26:08 × aman quits (~aman@user/aman) (Quit: aman)
21:26:53 abrantesasf joins (~abrantesa@177.79.126.131)
21:27:40 × redb quits (~nmh@136.49.49.211) (Ping timeout: 246 seconds)
21:28:45 boxscape_ joins (~boxscape_@p4ff0b7be.dip0.t-ipconnect.de)
21:29:04 × abrantesasf quits (~abrantesa@177.79.126.131) (Remote host closed the connection)
21:29:36 × sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Remote host closed the connection)
21:30:23 hololeap joins (~hololeap@user/hololeap)
21:30:42 sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10)
21:31:01 abrantesasf joins (~abrantesa@177.79.126.131)
21:31:17 × abrantesasf quits (~abrantesa@177.79.126.131) (Remote host closed the connection)
21:32:57 redb joins (~nmh@136.49.49.211)
21:33:58 × jao quits (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Ping timeout: 246 seconds)
21:35:18 tvandinther joins (~tvandinth@2406:e002:6815:1801:eda7:b44d:2b93:da27)
21:36:01 jao joins (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net)
21:37:13 <tvandinther> Hi again. I recently got started with Haskell and I'm using VS Code with the language server installed through ghcup. I just started using modules and now the language server doesn't work with the project anymore. It also comes up with an error when I restart the language server: "Multi Cradle: No prefixes matched" I am not sure what the easiest
21:37:14 <tvandinther> solution is and why this happens. Appreciate any pointers :)
21:37:48 × redb quits (~nmh@136.49.49.211) (Ping timeout: 276 seconds)
21:40:16 × Midjak quits (~Midjak@82.66.147.146) (Quit: This computer has gone to sleep)
21:41:47 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
21:42:58 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
21:43:13 <sm> #haskell-language-server:libera.chat knows most tvandinther
21:43:47 <boxscape_> (that's #haskell-language-server if you're not using matrix)
21:44:11 <sm> thanks
21:46:40 × tvandinther quits (~tvandinth@2406:e002:6815:1801:eda7:b44d:2b93:da27) (Quit: Client closed)
21:46:55 tvandinther joins (~tvandinth@2406:e002:6815:1801:eda7:b44d:2b93:da27)
21:47:00 <tvandinther> thanks
21:47:58 × deadmarshal_ quits (~deadmarsh@95.38.229.55) (Ping timeout: 246 seconds)
21:48:59 redb joins (~nmh@136.49.49.211)
21:52:59 × redb quits (~nmh@136.49.49.211) (Ping timeout: 240 seconds)
21:53:41 × joo-_ quits (~joo-_@fsf/member/joo--) (Ping timeout: 256 seconds)
21:53:43 × coot quits (~coot@213.134.190.95) (Quit: coot)
21:54:17 × califax quits (~califax@user/califx) (Remote host closed the connection)
21:54:36 califax joins (~califax@user/califx)
21:55:05 × zeenk quits (~zeenk@2a02:2f04:a313:d600:8d26:ec9f:3ff6:fc94) (Quit: Konversation terminated!)
21:55:18 joo-_ joins (~joo-_@87-49-147-113-mobile.dk.customer.tdc.net)
21:55:19 × joo-_ quits (~joo-_@87-49-147-113-mobile.dk.customer.tdc.net) (Changing host)
21:55:19 joo-_ joins (~joo-_@fsf/member/joo--)
21:58:28 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
21:59:30 × boxscape_ quits (~boxscape_@p4ff0b7be.dip0.t-ipconnect.de) (Quit: Connection closed)
21:59:32 × DNH quits (~DNH@2a02:8109:b740:2c4:11d5:718e:c7c6:4a90) (Quit: Textual IRC Client: www.textualapp.com)
22:00:04 × hololeap quits (~hololeap@user/hololeap) (Ping timeout: 240 seconds)
22:00:43 redb joins (~nmh@136.49.49.211)
22:03:20 hololeap joins (~hololeap@user/hololeap)
22:05:45 × redb quits (~nmh@136.49.49.211) (Ping timeout: 276 seconds)
22:07:34 × mikoto-chan quits (~mikoto-ch@213.177.151.239) (Ping timeout: 246 seconds)
22:11:28 cosimone joins (~user@2001:b07:ae5:db26:c24a:d20:4d91:1e20)
22:12:43 × __monty__ quits (~toonn@user/toonn) (Quit: leaving)
22:12:55 xff0x_ joins (~xff0x@om126194210237.10.openmobile.ne.jp)
22:17:39 DNH joins (~DNH@2a02:8109:b740:2c4:e19c:8cc4:dfdc:657b)
22:21:01 × gehmehgeh quits (~user@user/gehmehgeh) (Quit: Leaving)
22:23:55 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
22:24:43 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
22:32:13 × dextaa quits (~dextaa@user/dextaa) (Ping timeout: 256 seconds)
22:33:40 redb joins (~nmh@136.49.49.211)
22:34:12 × cosimone quits (~user@2001:b07:ae5:db26:c24a:d20:4d91:1e20) (Remote host closed the connection)
22:34:27 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
22:34:53 <tvandinther> Would somebody be able to walk me through some imports and modules and how to make them work in the repl and in a stack project?
22:35:27 <tvandinther> I have a module where I import System.Random, when I load the module the REPL says it cant find the module for System.Random
22:36:02 <geekosaur> if you are using stack to install modules (this is actually not a good idea), you need to use stack ghci to access them
22:36:35 cosimone joins (~user@2001:b07:ae5:db26:c24a:d20:4d91:1e20)
22:36:56 <tvandinther> I read about not using the `stack install` command. Not fully sure why that is but I haven't run it
22:36:57 sander is now known as sndr
22:37:37 <geekosaur> because you don't install libraries with stack (or modern cabal), you let stack or cabal install them as part of a project which produces executables
22:37:39 × redb quits (~nmh@136.49.49.211) (Ping timeout: 240 seconds)
22:37:47 <tvandinther> My project was started using `stack MontyHall new simple`.
22:38:16 <tvandinther> Right, and `stack install` is a global install?
22:38:39 × acidjnk quits (~acidjnk@p200300d0c722df612442a13791a64f70.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
22:38:40 <geekosaur> actually it does nothing useful for a package which only consists of libraries
22:39:09 <geekosaur> anyway use "stack ghci" instead of "ghci", if you have random specified as a dependency, and it should work
22:39:39 <EvanR> cabal for lyfe
22:39:48 jerry99 joins (~330f3999@cerf.good1.com)
22:40:10 <tvandinther> I am using the `cabal repl` at the moment. How does that differ?
22:40:28 <EvanR> eyebrow, you are managing the project with stack but then did cabal repl
22:40:29 <geekosaur> it won't see anything installed by stack
22:40:45 <geekosaur> (contrariwise stack won't see anything installed via cabal)
22:41:08 <EvanR> they are kind of parallel tools instead of complimentary
22:41:30 <tvandinther> Oh okay. I was just told to make a new project with stack and then make a repl with cabal.
22:41:31 <geekosaur> they have some disagreements as to how to do some things
22:41:36 <geekosaur> o.O
22:41:37 <tvandinther> I notice that my stack project has a cabal file in it though
22:42:09 <EvanR> in the beginning there was cabal, and cabal hell, so thus stack was born. Then cabal was fixed
22:42:21 <geekosaur> "cabal" actually stands for two things: there is the Cabal library which everything uses as it's the interface to ghc'spackage databases, and there is cabal-install which is the "cabal" program
22:42:56 <janus> and stack is only compatible with old versions of the cabal library afaik?
22:43:00 <tvandinther> I see. so a cabal file /= cabal cli
22:43:39 <geekosaur> right
22:43:51 <geekosaur> and everything uses cabal files because they're package registration files
22:44:00 <tvandinther> As a beginner is it best to forget about cabal as a command line tool?
22:44:21 <EvanR> As a beginner is it best to forget about stack ?
22:44:46 <tvandinther> Hahaha, I suppose the question is, how do I learn Haskell and not get caught in the holy war :P
22:45:11 <EvanR> it seems to me you have to understand cabal anyway
22:45:18 <EvanR> and stack is optional
22:46:52 <sclv> if you are in a project, then depending on if you are using stack or cabal, you either say `stack ghci` or `cabal repl` to get a ghci session with the libraries the project depends on in scope
22:46:59 <sclv> thats the simplest way to explain it
22:47:20 <tvandinther> To take my question right back to where I first had issues. I had a simple project with my own modules, then I wanted to use functions from the System.Random package. I figured because it was just a system package that the import would just resolve but then the repl had issues loading my module, and also the language server complained about the
22:47:21 <tvandinther> import. What would be the right step to import a system module like this?
22:47:31 <sclv> both tools are project based and manage dependencies of your project for you, but in both cases raw "ghci" doesn't know about those dependencies unless you invoke it _through_ the tool
22:47:58 <sclv> ok, well you need to add random as a dependency to your project
22:48:04 × hololeap quits (~hololeap@user/hololeap) (Ping timeout: 240 seconds)
22:48:24 <tvandinther> by just adding this line to the cabal file? `  build-depends: random`
22:48:28 <sclv> yes
22:48:55 <tvandinther> Is there a list syntax for that or do I make a new key-value pair for each dependency
22:49:06 <sclv> its a list syntax
22:49:40 <sclv> you cn read through some example cabal files from hackage or whatever to get a sense of their syntax https://hackage.haskell.org/package/bytestring-0.11.3.0/bytestring.cabal
22:50:10 <sclv> or read the general docs https://cabal.readthedocs.io/en/3.6/cabal-package.html
22:51:30 × Tuplanolla quits (~Tuplanoll@91-159-69-98.elisa-laajakaista.fi) (Quit: Leaving.)
22:51:36 × yauhsien quits (~yauhsien@61-231-27-3.dynamic-ip.hinet.net) (Remote host closed the connection)
22:51:43 hololeap joins (~hololeap@user/hololeap)
22:54:18 <tvandinther> thank you
22:54:37 gurkenglas joins (~gurkengla@dslb-178-012-018-212.178.012.pools.vodafone-ip.de)
22:55:08 × albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection)
22:55:11 × pretty_dumm_guy quits (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Quit: WeeChat 3.5)
22:56:33 × cosimone quits (~user@2001:b07:ae5:db26:c24a:d20:4d91:1e20) (Quit: ERC 5.4 (IRC client for GNU Emacs 28.1))
23:01:16 albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8)
23:02:40 redb joins (~nmh@136.49.49.211)
23:05:08 × jerry99 quits (~330f3999@cerf.good1.com) (Quit: CGI:IRC)
23:06:12 × haritz quits (~hrtz@user/haritz) (Ping timeout: 276 seconds)
23:08:29 × redb quits (~nmh@136.49.49.211) (Ping timeout: 256 seconds)
23:10:17 redb joins (~nmh@136.49.49.211)
23:11:01 × AkechiShiro quits (~licht@user/akechishiro) (Quit: WeeChat 3.2.1)
23:11:36 × mmhat quits (~mmh@55d4dd86.access.ecotel.net) (Quit: WeeChat 3.5)
23:12:26 haritz joins (~hrtz@82-69-11-11.dsl.in-addr.zen.co.uk)
23:12:26 × haritz quits (~hrtz@82-69-11-11.dsl.in-addr.zen.co.uk) (Changing host)
23:12:26 haritz joins (~hrtz@user/haritz)
23:15:07 × jgeerds quits (~jgeerds@d53604b0.access.ecotel.net) (Ping timeout: 240 seconds)
23:16:26 <sm> System. and other hierarchical module names have no real meaning unfortunately. They can come from any package, sometimes even from more than one
23:16:59 × redb quits (~nmh@136.49.49.211) (Ping timeout: 256 seconds)
23:17:54 teo joins (~teo@user/teo)
23:17:55 × chomwitt quits (~chomwitt@2a02:587:dc1b:da00:e2f9:e987:da5c:6097) (Ping timeout: 260 seconds)
23:18:00 <sm> when you're building, the package names are more important, when coding, the module names are more important.
23:19:21 rekahsoft joins (~rekahsoft@cpe001b21a2fd89-cm64777ddc63a0.cpe.net.cable.rogers.com)
23:20:04 × hololeap quits (~hololeap@user/hololeap) (Ping timeout: 240 seconds)
23:20:19 × rekahsoft quits (~rekahsoft@cpe001b21a2fd89-cm64777ddc63a0.cpe.net.cable.rogers.com) (Remote host closed the connection)
23:20:47 rekahsoft joins (~rekahsoft@cpe001b21a2fd89-cm64777ddc63a0.cpe.net.cable.rogers.com)
23:20:50 × raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 250 seconds)
23:23:04 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
23:24:14 hololeap joins (~hololeap@user/hololeap)
23:26:10 × Guest91 quits (~Guest91@caliga.eecs.tufts.edu) (Quit: Client closed)
23:27:36 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
23:29:20 redb joins (~nmh@136.49.49.211)
23:30:04 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 240 seconds)
23:34:35 Vajb joins (~Vajb@2001:999:504:1dda:267d:6860:bdf7:f68b)
23:35:38 chenqisu1 joins (~chenqisu1@183.217.200.38)
23:35:59 nomagno parts (~nomagno@2001:470:69fc:105::c1f0) ()
23:37:24 × redb quits (~nmh@136.49.49.211) (Ping timeout: 276 seconds)
23:45:27 × foul_owl quits (~kerry@23.82.193.88) (Ping timeout: 260 seconds)
23:45:28 × Vajb quits (~Vajb@2001:999:504:1dda:267d:6860:bdf7:f68b) (Read error: Connection reset by peer)
23:47:23 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
23:47:59 redb joins (~nmh@136.49.49.211)
23:48:22 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
23:49:17 yauhsien joins (~yauhsien@61-231-27-3.dynamic-ip.hinet.net)
23:51:05 × tvandinther quits (~tvandinth@2406:e002:6815:1801:eda7:b44d:2b93:da27) (Quit: Client closed)
23:52:11 stackdroid18 joins (14094@user/stackdroid)
23:52:41 × redb quits (~nmh@136.49.49.211) (Ping timeout: 256 seconds)
23:54:40 tvandinther joins (~tvandinth@2406:e002:6815:1801:f923:49c9:3df2:db52)
23:55:04 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 240 seconds)
23:55:58 jerry99 joins (~330f3999@cerf.good1.com)
23:56:50 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
23:59:23 mvk joins (~mvk@2607:fea8:5ce3:8500::46a8)

All times are in UTC on 2022-04-21.