Home liberachat/#haskell: Logs Calendar

Logs on 2022-01-07 (liberachat/#haskell)

00:03:27 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds)
00:07:43 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
00:07:57 × kupi quits (uid212005@id-212005.hampstead.irccloud.com) (Quit: Connection closed for inactivity)
00:08:08 <[itchyjunk]> https://bpa.st/2WEA
00:08:26 <[itchyjunk]> Here, i want to apply f to the resulting list after applying myTuples
00:08:51 <[itchyjunk]> So apply myTuples to x, take the first element of this list and apply f to it, is how i am thinking
00:09:19 <[itchyjunk]> oh wait i see an issue already
00:09:55 <Axman6> I have two questions for you: what is the type of `x`? what is the type of `ys`?
00:10:03 <[itchyjunk]> Ah, nm. i thought of a different approach
00:10:16 × doyougnu quits (~doyougnu@c-73-25-202-122.hsd1.or.comcast.net) (Ping timeout: 256 seconds)
00:10:33 <[itchyjunk]> x is a list [a], ys is a [(Int,a)] looking list
00:10:43 <[itchyjunk]> i think i have an idea though
00:11:06 <[itchyjunk]> wait, not i don't xD
00:11:39 <Axman6> so you have mapWithIndex f x = f y : mapWithIndex f ys, and based on what you said above, x and ys have different types, yes?
00:12:35 <Axman6> have you ever seen a function with the type (a -> b) -> [a] -> [b]?
00:12:40 <[itchyjunk]> yes in my code, the ys is giving me the problem
00:12:51 <[itchyjunk]> i would need to pass the [a] type instead of ys type there
00:12:57 × pretty_dumm_guy quits (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Quit: WeeChat 3.4)
00:13:04 <[itchyjunk]> yes i have seem map
00:13:13 <[itchyjunk]> i also implementd a myMap with that type earlier
00:13:31 <Axman6> do you think you could use it here?
00:13:45 <[itchyjunk]> Use map itself?
00:13:45 <Axman6> you have a way to turn [a] -> [(Int,a)]
00:14:03 <[itchyjunk]> i thought of using map but not sure if that's cheating or not
00:14:05 <Axman6> and you have myMap :: (a -> b) -> [a] -> [b] right?
00:14:17 <[itchyjunk]> i can map f myTuples(x)
00:14:18 <Axman6> if you wrote the code, it's definitely not cheating
00:14:25 <Axman6> can you?
00:14:35 <[itchyjunk]> hmm
00:14:58 <Axman6> also, it's worth pointing out now that we don't call functions like that in HAskell, myTuples(x) means myTuples (x) which is myTuples x
00:15:10 <Axman6> to pass x to my tuples, you just use a space
00:15:44 <[itchyjunk]> map f (myTuples x)
00:15:46 <Axman6> if you need to ensure that is understood as a single expression, you can use (myTuples x)
00:15:52 <Axman6> does it work?
00:16:00 <[itchyjunk]> i haven't tried, let me try it now
00:17:27 <[itchyjunk]> it compiles but idk how to test it @_@
00:17:39 <[itchyjunk]> mapWithIndex ? [1..10]
00:17:53 <ProfSimm> Actually... why not have mutable local variables/
00:17:54 <Axman6> (\(i,x) -> x*i)
00:18:13 <Axman6> ProfSimm: what does local mean?
00:18:46 <[itchyjunk]> https://bpa.st/YEWA
00:18:48 <jackdk> Axman6: inside of a `runST`? `0:-)`
00:18:53 <ProfSimm> Axman6: that's a good question
00:18:54 <[itchyjunk]> I don't think i understand the problem statement very well :(
00:19:00 <Axman6> ssshhh, we're getting there :P
00:19:08 <[itchyjunk]> i think i have a solution but idk how to test it
00:19:23 <Axman6> [itchyjunk]: I gave you a function above to use for ?
00:19:36 <[itchyjunk]> oh
00:19:50 <jackdk> [itchyjunk]: use ghci? Also the equation at line 18 is redundant, as `myMap` handles empty lists
00:20:04 <Axman6> what result do you expect to get for mapWithIndex (\(i,x) -> x*i) [1..10]?
00:20:51 <[itchyjunk]> [0,2,6,..]
00:20:58 × wyrd quits (~wyrd@gateway/tor-sasl/wyrd) (Quit: Lost terminal)
00:21:03 <[itchyjunk]> 90 as the last element
00:21:57 <[itchyjunk]> ah, right i guess the [] handeling is redundent
00:22:05 <[itchyjunk]> Axman6, i get what i expect
00:22:13 <[itchyjunk]> [0,2,6,12,20,30,42,56,72,90]
00:22:17 <Square> I had a File.hs with instances a,b,c of verbose instances over data types. I found i could generate "a" and "b" of these instances with TH. So i add a $(buildMyInstances ..) to same file. But now i got dependency issues as "a" and "b" depends on "c" and "c" depends on "a".
00:22:49 <Square> I had a File.hs with verbose instances a,b,c. *
00:23:26 <[itchyjunk]> guess my solution works \o/
00:23:41 <Square> is there some trick to enjoy some 2-pass compilation even with TH generation?
00:24:43 <Axman6> ProfSimm: it turns out that you can do what you're asking for, but it's not a straight forward as you might expect. laziness makes this particularly difficult
00:24:49 wyrd joins (~wyrd@gateway/tor-sasl/wyrd)
00:25:35 × Tuplanolla quits (~Tuplanoll@91-159-69-90.elisa-laajakaista.fi) (Quit: Leaving.)
00:26:34 <Axman6> Square: with TH, the order of definitions matters - that looks like it might not be possible if there's a cyclic dep though. can you do all the definitions in TH in the same spot?
00:27:22 <Square> Axman6, im afraid not. I guess i need to change plan
00:31:00 <jackdk> It may be possible to mix TH and .hs-boot files, but that's for a braver soul than I
00:33:37 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
00:34:36 deadmarshal joins (~deadmarsh@95.38.112.110)
00:34:58 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Client Quit)
00:38:37 × deadmarshal quits (~deadmarsh@95.38.112.110) (Ping timeout: 240 seconds)
00:38:37 × justsomeguy quits (~justsomeg@user/justsomeguy) (Ping timeout: 240 seconds)
00:40:47 baltrobob joins (~baltrobob@p200300f03f1e516a1063109df4bd766d.dip0.t-ipconnect.de)
00:40:52 × sonny quits (~sonny@bras-base-london1483w-grc-32-70-52-175-166.dsl.bell.ca) (Ping timeout: 256 seconds)
00:43:16 sonny joins (~sonny@bras-base-london1483w-grc-32-70-52-175-166.dsl.bell.ca)
00:45:21 <dmj`> monochrom: can't a free monad library be written w/o existentials though
00:46:07 <Axman6> or without an existential crisis?
00:46:13 <Axman6> Seems hard
00:46:48 sonny parts (~sonny@bras-base-london1483w-grc-32-70-52-175-166.dsl.bell.ca) ()
00:47:18 × TonyStone quits (~TonyStone@cpe-74-76-51-197.nycap.res.rr.com) (Remote host closed the connection)
00:49:01 × acidjnk quits (~acidjnk@p200300d0c7271e249cd77df40fde183d.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
00:49:01 × acidjnk_new3 quits (~acidjnk@p200300d0c7271e249cd77df40fde183d.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
00:50:32 × jgeerds quits (~jgeerds@55d4ac73.access.ecotel.net) (Ping timeout: 240 seconds)
00:51:41 × baltrobob quits (~baltrobob@p200300f03f1e516a1063109df4bd766d.dip0.t-ipconnect.de) (Quit: Client closed)
00:52:51 <ProfSimm> Axman6: I was thinking what if we could reuse names by basically internally appending counts to them (so if I declare X three times internally it's X1, X2, X3)
00:53:04 <ProfSimm> Axman6: but it becomes weird in some cases
00:55:35 TonyStone joins (~TonyStone@2603-7080-8607-c36a-9cdb-69bc-753b-1e50.res6.spectrum.com)
00:57:36 × ProfSimm quits (~ProfSimm@87.227.196.109) (Remote host closed the connection)
00:57:46 <Axman6> you might want to look a the ST monad, it gives you genuine mutatable variables in a way that guarantees that things are pure from the outside
00:58:13 <geekosaur> they just quit
00:59:13 × ouestbillie quits (~gallup@192-222-138-215.qc.cable.ebox.net) (Remote host closed the connection)
00:59:49 <EvanR> does the word concatenate imply joining two things with discrete pieces, like a string or list
01:00:24 <EvanR> or does it work for solids, shapes
01:01:08 <geekosaur> I think for those you need to say how you;re combining them
01:04:12 mvk joins (~mvk@2607:fea8:5cdd:f000::45db)
01:07:21 × machinedgod quits (~machinedg@24.105.81.50) (Ping timeout: 256 seconds)
01:09:49 × dudek quits (~dudek@185.150.236.156) (Quit: Leaving)
01:12:07 × albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection)
01:14:21 lavaman joins (~lavaman@98.38.249.169)
01:16:59 × kaph quits (~kaph@net-2-38-107-19.cust.vodafonedsl.it) (Ping timeout: 256 seconds)
01:18:14 albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8)
01:18:26 × eastbillie quits (~gallup@192-222-138-215.qc.cable.ebox.net) (Remote host closed the connection)
01:19:00 kaph joins (~kaph@net-2-38-107-19.cust.vodafonedsl.it)
01:21:55 sonny joins (~sonny@bras-base-london1483w-grc-32-70-52-175-166.dsl.bell.ca)
01:22:33 <sonny> [itchyjunk] how is this function used?
01:23:37 cosimone joins (~user@2001:b07:ae5:db26:c24a:d20:4d91:1e20)
01:24:03 <sonny> seems like it's just to transform a single element in the list
01:27:19 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
01:28:32 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection)
01:28:56 FinnElija joins (~finn_elij@user/finn-elija/x-0085643)
01:30:44 wyrd_ joins (~wyrd@gateway/tor-sasl/wyrd)
01:32:06 × wyrd quits (~wyrd@gateway/tor-sasl/wyrd) (Ping timeout: 276 seconds)
01:32:26 × raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 256 seconds)
01:33:09 × wyrd_ quits (~wyrd@gateway/tor-sasl/wyrd) (Client Quit)
01:33:10 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
01:34:55 <sonny> can you list a lambda function parameters in a definition?
01:35:17 wyrd joins (~wyrd@gateway/tor-sasl/wyrd)
01:37:28 <dmj`> sonny: what would that look like
01:38:24 <sonny> mapWithIndex \((idx, elem)) lst = ...
01:38:48 <EvanR> what on earth
01:39:29 <[itchyjunk]> sonny, idk how it's used
01:39:38 <[itchyjunk]> sonny, the one gives to me here to test was
01:39:44 <sonny> not sure how else to interpret "mapWithIndex is just like map, however it takes a function that takes a tuple with the corresponding index of the element in list"
01:40:02 <[itchyjunk]> <Axman6> what result do you expect to get for mapWithIndex (\(i,x) -> x*i) [1..10]?
01:40:59 <sonny> [1..i..10] -> [1..i*x..10]
01:41:18 <[itchyjunk]> hmm?
01:41:45 <[itchyjunk]> [0,2,6,12,20,30,42,56,72,90]
01:41:47 <sonny> I think it just gives you a new list with the element at position i updated
01:41:48 <[itchyjunk]> this is the result
01:42:07 <[itchyjunk]> did you end up writing the function in problem 2?
01:42:14 <sonny> that's just map ...
01:42:22 <sonny> I am trying to understand problem 2 now
01:42:46 <dmj`> sonny: what is the type of elem
01:42:51 <[itchyjunk]> how is it map? map :: (a->b)-> [a] -> [b]
01:43:07 <[itchyjunk]> this one is ((Int,a) -> b) -> [a] -> [b]
01:43:17 × Inst quits (~delicacie@c-98-208-218-119.hsd1.fl.comcast.net) (Ping timeout: 240 seconds)
01:43:17 <[itchyjunk]> so not quite map
01:43:18 <sonny> dmj`: `((Int,a) -> b) -> [a] -> [b]`
01:44:37 <sonny> oh ok
01:44:38 <EvanR> mapWithIndex devolves into map if you choose not to use the Int
01:44:57 <sonny> I think I sorta get what it's asking
01:45:40 vysn joins (~vysn@user/vysn)
01:45:54 jakalx parts (~jakalx@base.jakalx.net) (Error from remote client)
01:46:18 <sonny> nvm, I'm super confused
01:46:22 <[itchyjunk]> sonny, did you mean this is a higher order function?
01:46:26 jakalx joins (~jakalx@base.jakalx.net)
01:46:36 <[itchyjunk]> sonny, i used map as a solution in mine. i wrote my own map and used it
01:46:46 <[itchyjunk]> i helped me understand things better
01:47:02 <sonny> higher order function?
01:47:40 <[itchyjunk]> isn't that what it's called? map take in function as an input so we call it higher order function right?
01:47:49 <sonny> nah
01:47:51 <[itchyjunk]> not sure if i am remembering things properly anymore xD
01:47:54 <sonny> it's just a function
01:48:08 <sonny> unless there is some math terminology
01:48:18 <[itchyjunk]> think i was learning map because it was higher order function
01:48:23 <[itchyjunk]> math calls it functionals i think
01:48:30 <[itchyjunk]> programming calls it higher order functions?
01:48:37 <[itchyjunk]> like (\x.xx) (\x.xx)
01:48:40 <sonny> no?
01:49:20 <[itchyjunk]> https://en.wikipedia.org/wiki/Higher-order_function
01:49:25 <sonny> well, I'm probably not the one to ask
01:49:26 × Gurkenglas quits (~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de) (Ping timeout: 256 seconds)
01:49:45 <sonny> but yeah I don't get what mapWithIndex is supposed to do
01:49:56 <[itchyjunk]> it takes 2 parameter
01:49:59 <[itchyjunk]> a function and a list
01:50:01 <[itchyjunk]> and returns a list
01:50:07 <[itchyjunk]> its a higher order function
01:50:16 <[itchyjunk]> similar to map
01:50:21 <sonny> ok
01:50:35 <[itchyjunk]> thats why i reimplremented map
01:50:48 <[itchyjunk]> to understand a function that can take a function as parameter
01:50:52 <sonny> yeah I don't get what's different
01:51:20 <[itchyjunk]> (a -> b) -> [a] -> [b], (a->b) is a function
01:51:38 <sonny> yes
01:51:54 <EvanR> [itchyjunk], yes, in the old days higher order functions would be this awesome thing
01:52:04 <EvanR> by I mean, javascript can do it, not that special
01:52:07 <EvanR> but*
01:52:22 <EvanR> I mean, C kind of does it
01:52:30 <EvanR> pointer to function
01:52:33 <[itchyjunk]> i saw it in table of contents of a haskell book so i figured its one of those things that you have to learn
01:52:42 <sonny> {(a->b) -> [a]} -> [b]
01:52:48 <[itchyjunk]> i don't have the attention to read a book so making due with table of contents xD
01:53:01 <[itchyjunk]> sonny, idk what that is
01:53:01 <EvanR> map :: (a -> b) -> ([a] -> [b])
01:53:10 <sonny> that nomenclature might be subject to debate
01:53:37 <EvanR> sonny, mapWithIndex just passes the current index along with the value
01:53:50 <sonny> [itchyjunk] I was trying to show the order
01:54:11 <EvanR> {(a -> b) -> [a]} -> [b] doesn't look right at all
01:54:15 <[itchyjunk]> its right associative so it would be (a -> b) -> ([a] -> [b]) i think
01:54:21 <sonny> oh
01:54:24 <[itchyjunk]> you're doing left associativity for some reason?
01:54:30 <sonny> yeah lol
01:54:36 <sonny> mistake
01:54:51 <EvanR> map has 2 args, if you pass just 1, you are left with [a] -> [b], 1 arg to go
01:55:24 <[itchyjunk]> sonny, i make like 6 mini problems and solved it to solve that problem 2
01:55:26 <[itchyjunk]> https://bpa.st/YEWA
01:55:43 <[itchyjunk]> each of the function i wrote there, i thought of a mini problem to solve
01:56:31 <sonny> EvanR ok, so I just need to make sure that I have the current index?
01:56:39 <sonny> otherwise it's the same?
01:56:48 <EvanR> I don't know what the actual question is, sorry
01:56:56 <sonny> one sec
01:57:04 <[itchyjunk]> http://www.cas.mcmaster.ca/~dalvescb/LH_Week05_Exercises.pdf
01:57:07 <[itchyjunk]> problem 2) there
01:57:30 <EvanR> implement mapWithIndex
01:57:51 <EvanR> we've all be repeating the requirements for this function, we're all in agreement, so great xD
01:58:02 <EvanR> been*
01:58:58 sonny scratches head
01:59:25 <[itchyjunk]> :D
01:59:28 <EvanR> 1. understand the question 3. write down the solution
01:59:31 <EvanR> step 2 is overrated
01:59:45 <[itchyjunk]> step 1 is really hard
01:59:48 <EvanR> ^
02:03:37 × Morrow quits (~user@bzq-110-168-31-106.red.bezeqint.net) (Remote host closed the connection)
02:07:12 Morrow joins (~user@bzq-110-168-31-106.red.bezeqint.net)
02:10:00 <EvanR> >write a quickCheck property to test both simultaneously (i.e check one in terms of the other)
02:10:15 <EvanR> does that really succeed in testing both simultaneously
02:11:01 × n8chan quits (~nate@108-233-125-227.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 240 seconds)
02:11:27 spdr joins (~bc8147f2@cerf.good1.com)
02:12:24 ubert1 joins (~Thunderbi@p200300ecdf09947d3ce845fd45b74154.dip0.t-ipconnect.de)
02:13:25 × ubert quits (~Thunderbi@p200300ecdf0994dbb267d7c5a67baed4.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
02:13:25 ubert1 is now known as ubert
02:13:39 n8chan joins (~nate@108-233-125-227.lightspeed.sntcca.sbcglobal.net)
02:14:10 <jackdk> it's a test that exercises both at once
02:14:10 <[itchyjunk]> is that like unit tests?
02:14:37 × Morrow quits (~user@bzq-110-168-31-106.red.bezeqint.net) (Ping timeout: 240 seconds)
02:14:45 <EvanR> yeah... though both could be wrong in such a way that cancels out... two wrongs make a right xD
02:15:12 <EvanR> oh now I see where they are going with it
02:15:33 <EvanR> "who cares as long as *the property* is satisfied"
02:16:41 Morrow joins (~user@147.161.13.151)
02:17:58 califax- joins (~califax@user/califx)
02:18:24 doyougnu joins (~doyougnu@c-73-25-202-122.hsd1.or.comcast.net)
02:19:33 × califax quits (~califax@user/califx) (Ping timeout: 276 seconds)
02:19:33 califax- is now known as califax
02:25:08 × sonny quits (~sonny@bras-base-london1483w-grc-32-70-52-175-166.dsl.bell.ca) (Ping timeout: 256 seconds)
02:28:07 × xkuru quits (~xkuru@user/xkuru) (Read error: Connection reset by peer)
02:28:59 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
02:31:01 × kjak quits (~kjak@pool-108-45-56-21.washdc.fios.verizon.net) (Ping timeout: 240 seconds)
02:31:26 neurocyte0917 joins (~neurocyte@IP-046243081042.dynamic.medianet-world.de)
02:31:26 × neurocyte0917 quits (~neurocyte@IP-046243081042.dynamic.medianet-world.de) (Changing host)
02:31:26 neurocyte0917 joins (~neurocyte@user/neurocyte)
02:33:29 × neurocyte091 quits (~neurocyte@user/neurocyte) (Ping timeout: 256 seconds)
02:33:29 neurocyte0917 is now known as neurocyte091
02:34:35 × hyiltiz quits (~quassel@31.220.5.250) (Quit: hyiltiz)
02:35:25 × xff0x quits (~xff0x@2001:1a81:5223:a300:e304:e5b3:98c9:ca79) (Ping timeout: 240 seconds)
02:37:36 xff0x joins (~xff0x@2001:1a81:525f:5800:748a:2b9d:1b8:40fa)
02:49:24 × jonathanx quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Remote host closed the connection)
02:49:55 × Morrow quits (~user@147.161.13.151) (Ping timeout: 256 seconds)
02:50:07 jonathanx joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
02:50:54 × jonathanx quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Remote host closed the connection)
02:51:33 Morrow joins (~user@bzq-110-168-31-106.red.bezeqint.net)
02:57:29 hyiltiz joins (~quassel@31.220.5.250)
03:01:58 × hyiltiz quits (~quassel@31.220.5.250) (Ping timeout: 256 seconds)
03:04:24 hyiltiz joins (~quassel@31.220.5.250)
03:05:55 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
03:08:57 × Morrow quits (~user@bzq-110-168-31-106.red.bezeqint.net) (Ping timeout: 240 seconds)
03:11:45 finn_elija joins (~finn_elij@user/finn-elija/x-0085643)
03:11:45 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija)))
03:11:45 finn_elija is now known as FinnElija
03:13:43 × geranim0 quits (~geranim0@modemcable242.171-178-173.mc.videotron.ca) (Ping timeout: 256 seconds)
03:15:12 shapr joins (~user@2601:7c0:c202:5190:f139:f199:c0b7:ebd5)
03:22:14 sonny joins (~sonny@bras-base-london1483w-grc-32-70-52-175-166.dsl.bell.ca)
03:33:39 × EvanR quits (~EvanR@user/evanr) (Quit: Leaving)
03:34:31 EvanR joins (~EvanR@user/evanr)
03:34:58 arjun joins (~arjun@user/arjun)
03:36:19 Guest32 joins (~Guest32@115.98.235.146)
03:37:47 <Guest32> hi.. I need to sum all digits of a number till I arrive at a single digit eg 29 = 2+9 =11 =1+1 =2
03:37:56 <Guest32> how to I do it?
03:38:41 <Guest32> I have created a function which splits the numbers into a list
03:38:44 <Guest32> toDigits x
03:38:44 <Guest32>   | x < 1 = []
03:38:45 <Guest32>   | otherwise = toDigits (div x 10) ++ [mod x 10]
03:38:59 <EvanR> nice, see also divMod
03:39:13 × Maxdamantus quits (~Maxdamant@user/maxdamantus) (Ping timeout: 256 seconds)
03:39:15 <EvanR> > divMod 25 7
03:39:16 <lambdabot> (3,4)
03:39:46 <int-e> > divmod (3^2 + 4^2) (3 + 4)
03:39:47 <lambdabot> error:
03:39:47 <lambdabot> • Variable not in scope: divmod :: t0 -> t1 -> t
03:39:47 <lambdabot> • Perhaps you meant one of these:
03:39:55 <int-e> > divMod (3^2 + 4^2) (3 + 4)
03:39:56 <lambdabot> (3,4)
03:40:12 Inst joins (~delicacie@c-98-208-218-119.hsd1.fl.comcast.net)
03:41:14 <Guest32> divMod 23
03:41:22 <Guest32> >divMod 23
03:41:23 <EvanR> :t divMod 23
03:41:24 <lambdabot> Integral a => a -> (a, a)
03:41:40 <Guest32> :t divMod 23
03:41:41 <lambdabot> Integral a => a -> (a, a)
03:44:15 <EvanR> > echo
03:44:16 <lambdabot> echo
03:44:27 <Guest32> @Evanr how do I get to a single digit?
03:44:27 <lambdabot> Unknown command, try @list
03:45:12 <EvanR> you want to just sum all the digits?
03:45:18 <EvanR> or all but the last digit
03:45:34 <EvanR> or just take the last digit
03:45:51 × shapr quits (~user@2601:7c0:c202:5190:f139:f199:c0b7:ebd5) (Remote host closed the connection)
03:46:06 <Guest32> all digits
03:46:14 <Guest32> till the total gets to one digit
03:46:19 <EvanR> > sum [1,2,3,4,5]
03:46:21 <lambdabot> 15
03:46:36 <EvanR> > sum (init [1,2,3,4])
03:46:37 <lambdabot> 6
03:46:44 <EvanR> > last [1,2,3,4,5]
03:46:45 <lambdabot> 5
03:47:09 × td_ quits (~td@94.134.91.33) (Ping timeout: 256 seconds)
03:47:52 Maxdamantus joins (~Maxdamant@user/maxdamantus)
03:47:52 <Guest32> > sum divMod 29
03:47:54 <lambdabot> error:
03:47:54 <lambdabot> • No instance for (Foldable ((->) Integer))
03:47:54 <lambdabot> arising from a use of ‘e_129’
03:48:08 <Guest32> divMod 29
03:48:21 <EvanR> divMod takes a divisor and a dividend, two arguments
03:48:21 <Guest32> > divMod 29
03:48:23 <lambdabot> <Integer -> (Integer,Integer)>
03:48:39 <EvanR> er, dividend, and divisor
03:48:44 <jackdk> whoa, functions with a show instance?
03:48:47 td_ joins (~td@94.134.91.64)
03:49:04 <Guest32> ok
03:49:14 <Guest32> > divMod 29 10
03:49:16 <lambdabot> (2,9)
03:49:30 <Guest32> > sum divMod 29 10
03:49:32 <lambdabot> error:
03:49:32 <lambdabot> • Couldn't match type ‘(t0, t0)’ with ‘t1 -> t’
03:49:32 <lambdabot> Expected type: t0 -> t0 -> t1 -> t
03:49:41 <Guest32> > sum (divMod 29 10)
03:49:43 <lambdabot> 9
03:50:07 <EvanR> \o/
03:50:19 <Guest32> shouldn't this be giving 11?
03:50:35 <EvanR> divMod doesn't give digits
03:51:09 <EvanR> but it does the two things you did to get digits
03:52:29 <Guest32> ok
03:57:39 × sirlensalot quits (~sirlensal@ool-44c5f8c9.dyn.optonline.net) (Quit: sirlensalot)
03:58:37 × waleee quits (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4) (Ping timeout: 240 seconds)
04:00:01 × haasn quits (~nand@haasn.dev) (Quit: ZNC 1.7.5+deb4 - https://znc.in)
04:01:22 haasn joins (~nand@haasn.dev)
04:02:15 × Guest32 quits (~Guest32@115.98.235.146) (Quit: Client closed)
04:04:43 shapr joins (~user@2601:7c0:c202:5190:ca94:a895:80bc:42cf)
04:11:11 abarbu joins (~user@c-66-31-23-28.hsd1.ma.comcast.net)
04:19:29 [_] joins (~itchyjunk@user/itchyjunk/x-7353470)
04:20:05 [itchyjunk] is now known as Guest2700
04:20:05 × Guest2700 quits (~itchyjunk@user/itchyjunk/x-7353470) (Killed (molybdenum.libera.chat (Nickname regained by services)))
04:20:05 [_] is now known as [itchyjunk]
04:26:39 mbuf joins (~Shakthi@122.178.240.232)
04:27:57 <abarbu> How can I avoid type variables leaking out of this code?
04:27:58 <abarbu> I want a phantom that is True if any two other variables are True.
04:27:58 <abarbu>
04:27:58 <abarbu> type family Or (a :: Bool) (b :: Bool) :: Bool where
04:28:01 <abarbu> Or True a = True
04:28:04 <abarbu> Or a True = True
04:28:07 <abarbu> Or False False = False
04:28:09 <abarbu> one :: Proxy a
04:28:12 <abarbu> one = undefined
04:28:15 <abarbu> combine :: Proxy a -> Proxy b -> Proxy (Or a b)
04:28:18 <abarbu> combine _ _ = undefined
04:28:22 <abarbu> fn = combine one one
04:28:25 <abarbu>
04:28:28 <abarbu> The type of fn comes out to be fn :: D (GOr a b)
04:28:31 <abarbu> Everything works, but the more you use this code, the more it leaks out strangely-named type variables in trees of Or whose structure depends on the internals of the code. Seems like a very poor API. How can I avoid this leakage?
04:28:34 <abarbu> Is there some other way to approach this problem?
04:28:38 <abarbu>
04:31:04 deadmarshal joins (~deadmarsh@95.38.112.110)
04:37:25 × arjun quits (~arjun@user/arjun) (Quit: Leaving)
04:41:33 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds)
04:42:07 × bontaq quits (~user@ool-45779fe5.dyn.optonline.net) (Ping timeout: 256 seconds)
04:48:32 × cyphase quits (~cyphase@user/cyphase) (Ping timeout: 240 seconds)
04:56:58 <Axman6> @where paste
04:56:58 <lambdabot> Help us help you: please paste full code, input and/or output at e.g. https://paste.tomsmeding.com
04:57:53 sonny parts (~sonny@bras-base-london1483w-grc-32-70-52-175-166.dsl.bell.ca) (Closing Window)
05:00:03 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
05:01:46 wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com)
05:01:46 × wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host)
05:01:46 wroathe joins (~wroathe@user/wroathe)
05:04:58 jonathanx joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
05:07:03 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds)
05:13:46 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
05:16:05 × jiribenes quits (~jiribenes@rosa.jiribenes.com) (Remote host closed the connection)
05:16:32 jiribenes joins (~jiribenes@rosa.jiribenes.com)
05:25:44 × cosimone quits (~user@2001:b07:ae5:db26:c24a:d20:4d91:1e20) (Remote host closed the connection)
05:26:19 cosimone joins (~user@2001:b07:ae5:db26:c24a:d20:4d91:1e20)
05:27:24 × jonathanx quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Remote host closed the connection)
05:27:44 jonathanx joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
05:28:55 × slowButPresent quits (~slowButPr@user/slowbutpresent) (Quit: leaving)
05:32:50 Jing joins (~hedgehog@2604:a840:3::103c)
05:33:17 × deadmarshal quits (~deadmarsh@95.38.112.110) (Ping timeout: 240 seconds)
05:33:20 × phma quits (phma@2001:5b0:211b:f778:91c:a71f:b4a2:a400) (Read error: Connection reset by peer)
05:35:00 phma joins (phma@2001:5b0:211c:3a48:e7cb:c702:2cb6:39c)
05:43:11 × shapr quits (~user@2601:7c0:c202:5190:ca94:a895:80bc:42cf) (Remote host closed the connection)
05:43:25 shapr joins (~user@2601:7c0:c202:5190:d7e6:1445:a66d:b9b1)
05:46:38 × cods quits (~fred@82-65-232-44.subs.proxad.net) (Ping timeout: 268 seconds)
05:54:19 takuan joins (~takuan@178-116-218-225.access.telenet.be)
05:59:24 × jonathanx quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Remote host closed the connection)
05:59:44 jonathanx joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
06:00:08 nhatanh02 joins (~satori@123.24.172.30)
06:05:24 × jonathanx quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Remote host closed the connection)
06:05:42 jonathanx joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
06:06:43 × johnw quits (~johnw@2607:f6f0:3004:1:c8b4:50ff:fef8:6bf0) (Quit: ZNC - http://znc.in)
06:16:37 × nhatanh02 quits (~satori@123.24.172.30) (Ping timeout: 240 seconds)
06:28:46 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection)
06:29:06 FinnElija joins (~finn_elij@user/finn-elija/x-0085643)
06:39:33 <hyiltiz> Happy New Years and hope a safe new year to all!
06:42:38 nhatanh02 joins (~satori@123.24.172.30)
06:44:06 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 276 seconds)
06:44:49 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
06:47:29 <hyiltiz> When did the channel topic started with a r/haskell link?
06:48:27 cyphase joins (~cyphase@user/cyphase)
06:48:56 cods joins (~fred@82-65-232-44.subs.proxad.net)
07:02:33 wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com)
07:02:33 × wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host)
07:02:33 wroathe joins (~wroathe@user/wroathe)
07:04:07 deadmarshal joins (~deadmarsh@95.38.112.110)
07:07:45 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds)
07:11:35 × spdr quits (~bc8147f2@cerf.good1.com) (Quit: CGI:IRC (Session timeout))
07:11:59 kaph_ joins (~kaph@net-2-38-107-19.cust.vodafonedsl.it)
07:14:33 × kaph quits (~kaph@net-2-38-107-19.cust.vodafonedsl.it) (Ping timeout: 256 seconds)
07:18:54 × jonathanx quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Remote host closed the connection)
07:19:18 jonathanx joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
07:19:37 × zmt01 quits (~zmt00@user/zmt00) (Ping timeout: 240 seconds)
07:28:37 × xff0x quits (~xff0x@2001:1a81:525f:5800:748a:2b9d:1b8:40fa) (Ping timeout: 240 seconds)
07:29:47 xff0x joins (~xff0x@2001:1a81:525f:5800:1882:d375:707:2176)
07:30:15 coolnickname joins (uid531864@user/coolnickname)
07:31:27 mc47 joins (~mc47@xmonad/TheMC47)
07:32:15 × [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Read error: Connection reset by peer)
07:35:16 Codaraxis_ joins (~Codaraxis@user/codaraxis)
07:38:37 × Codaraxis quits (~Codaraxis@user/codaraxis) (Ping timeout: 240 seconds)
07:54:46 simendsjo joins (~user@84.211.91.241)
07:59:57 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
08:00:24 × jonathanx quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Remote host closed the connection)
08:00:47 jonathanx joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
08:07:42 jumper149 joins (~jumper149@base.felixspringer.xyz)
08:14:46 puke joins (~puke@user/puke)
08:18:31 × shriekingnoise quits (~shrieking@186.137.144.80) (Quit: Quit)
08:21:33 × jespada_ quits (~jespada@87.74.32.18) (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:24:36 × Sgeo_ quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer)
08:33:19 × simendsjo quits (~user@84.211.91.241) (Ping timeout: 256 seconds)
08:33:37 × shapr quits (~user@2601:7c0:c202:5190:d7e6:1445:a66d:b9b1) (Ping timeout: 240 seconds)
08:33:38 × econo quits (uid147250@user/econo) (Quit: Connection closed for inactivity)
08:35:19 × zaquest quits (~notzaques@5.130.79.72) (Remote host closed the connection)
08:37:50 zaquest joins (~notzaques@5.130.79.72)
08:43:46 × mc47 quits (~mc47@xmonad/TheMC47) (Remote host closed the connection)
08:43:59 Brumaire joins (~quassel@37.166.249.26)
08:45:53 vpan joins (~0@212.117.1.172)
08:47:34 gehmehgeh joins (~user@user/gehmehgeh)
08:51:01 machinedgod joins (~machinedg@24.105.81.50)
08:53:04 mc47 joins (~mc47@xmonad/TheMC47)
08:53:20 Gurkenglas joins (~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de)
08:53:55 cemguresci joins (~cemguresc@2001:a61:11ff:a001:2dad:6df8:999e:4708)
08:56:12 chele joins (~chele@user/chele)
09:00:08 × inkbottle[m] quits (~inkbottle@2001:470:69fc:105::2ff5) (Quit: You have been kicked for being idle)
09:00:21 acode joins (~acode@dslb-188-100-024-238.188.100.pools.vodafone-ip.de)
09:03:23 wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com)
09:03:23 × wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host)
09:03:23 wroathe joins (~wroathe@user/wroathe)
09:04:30 coot joins (~coot@89-64-85-93.dynamic.chello.pl)
09:05:12 mmhat joins (~mmh@55d459b4.access.ecotel.net)
09:05:58 <juhp> Missing file: /usr/lib64/ghc-8.10.7/lib/settings
09:06:00 <juhp> hmm
09:06:13 × tzh quits (~tzh@c-24-21-73-154.hsd1.or.comcast.net) (Quit: zzz)
09:06:51 <juhp> I am getting this from stack after replacing ~/.stack/programs/x86_64-linux/ghc-tinfo6-8.10.7
09:08:02 <juhp> The problem being that the file exists...
09:08:36 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds)
09:08:40 <juhp> Oops no it doesn't ughhh
09:09:37 Tuplanolla joins (~Tuplanoll@91-159-68-11.elisa-laajakaista.fi)
09:09:56 <juhp> Ok I need to work a bit harder on this hack, sorry
09:16:55 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Read error: Connection reset by peer)
09:17:46 geekosaur joins (~geekosaur@xmonad/geekosaur)
09:18:58 × acode quits (~acode@dslb-188-100-024-238.188.100.pools.vodafone-ip.de) (Quit: Client closed)
09:22:20 <maerwald[m]> Aha
09:23:42 × puke quits (~puke@user/puke) (Remote host closed the connection)
09:23:58 puke joins (~puke@user/puke)
09:24:52 × ubert quits (~Thunderbi@p200300ecdf09947d3ce845fd45b74154.dip0.t-ipconnect.de) (Remote host closed the connection)
09:25:12 <cemguresci> Hi guys, I am trying to learn data types and I am having some trouble. I run this code in ghci. https://paste.tomsmeding.com/aK5GQ3vV
09:25:55 <cemguresci> I wrote the error message in paste as well :D
09:26:44 _ht joins (~quassel@82-169-194-8.biz.kpn.net)
09:26:51 <[exa]> cemguresci: why do you use `data` for TimeStamp when it's an alias?
09:26:54 <cemguresci> My first intention was actually have an object with timestamp automatically but I couldn't figure it out as well
09:26:58 <[exa]> (or looks like you use it as alias to me)
09:27:07 <[exa]> you probably want:
09:27:20 <[exa]> `data TimeStamp = TimeStamp UTCTime deriving Show`
09:27:27 <[exa]> or
09:27:40 <[exa]> `type TimeStamp = UTCTime` (no way to do `deriving` here tho)
09:28:05 <[exa]> the 2nd variant should work with the rest of the code
09:28:54 <[exa]> with the 1st variant you're defining a struct, so you'd need to add a constructor to the use, such as: `test = Test "haskell" (TimeStamp ct)`
09:29:16 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
09:30:21 off^ joins (~off@207.5.21.20)
09:32:34 <cemguresci> exa: whats the difference between `data TimeStamp = TimeStamp UTCTime deriving Show and `data TimeStamp = UTCTime deriving Show ?
09:33:04 <[exa]> the second defines that "UTCTime" is a constructor for your empty structure
09:33:19 <[exa]> which is probably not what you want
09:33:44 <[exa]> the syntax for `data` is: `data TypeName = ConstructorName Content1 Content2 | Constructor2Name Content1 Content2 Content3 | ..."
09:34:20 Codaraxis__ joins (~Codaraxis@user/codaraxis)
09:34:24 <[exa]> it defines the TypeName (as the name for the whole thing) and all ConstructorNames (as kinda "functions" that create the type)
09:35:04 <[exa]> in your case, the "UTCTime" becomes a constructor for a variant of the TypeName type that has no contents
09:35:15 × Brumaire quits (~quassel@37.166.249.26) (Quit: ran away)
09:35:36 Brumaire joins (~quassel@37.166.249.26)
09:35:53 <[exa]> it is a bit confusing for newcomers because in so many other languages the constructor names and type names are forcibly same
09:36:55 <cemguresci> yes, I am really confused :D
09:37:08 <[exa]> Simpler example: `data Bool = False | True`
09:37:27 <[exa]> this gives 2 constructors of the type, `False :: Bool` and `True :: Bool`
09:37:38 <[exa]> and both variants contain nothing
09:37:55 <cemguresci> what do you mean by containing nothing?
09:38:03 <[exa]> there are no data fields in there
09:38:04 × Codaraxis_ quits (~Codaraxis@user/codaraxis) (Ping timeout: 256 seconds)
09:38:19 <[exa]> what's your previous language?
09:38:25 <cemguresci> python
09:39:20 <[exa]> ah okay I'm not good in Python but you can imagine this e.g. as 2 empty classes True and False that share a common "parent", so they can be used interchangeably
09:40:09 <cemguresci> okay, I see
09:40:52 <[exa]> a more useful example: `data MaybeNumber = ActualNumber Int | NoNumber`
09:41:27 <[exa]> defines 1 structure that contains an integer, 1 structure that doesn't contain anything, and both are of the type MaybeNumber
09:41:51 <[exa]> (a more generic parametrized version of this is the standard Maybe, `data Maybe a = Nothing | Just a`
09:41:59 × puke quits (~puke@user/puke) (Quit: puke)
09:42:37 <[exa]> anyway, in your case the `data TimeStamp = UTCTime` translates to basically `class UTCTime: pass`
09:42:40 <cemguresci> awesome, now I understand.
09:42:54 <cemguresci> another question. can we use getCurrentTime function in data definition. I want to have timestamp when its defined
09:43:13 <[exa]> getCurrentTime has type (IO UTCTime) right?
09:43:18 <cemguresci> yes
09:43:45 <[exa]> so it's not a "value", but a description of an IO action that you need to explicitly run at a certain point
09:43:53 Codaraxis_ joins (~Codaraxis@user/codaraxis)
09:44:10 <[exa]> one way is what you did, `<-` in `do` notation is something that "runs" these actions and gets their results as actual values
09:45:00 <[exa]> but there are tools to do that less verbosely, e.g. you can write `Test "haskell" <$> getCurrentTime`, which nicely combines the action with the struct creation
09:45:22 <[exa]> (and you get a thing of type `IO Test`, which is the action that creates your whole structure right away)
09:45:29 max22- joins (~maxime@2a01cb088335980037d8471a1d5e7a78.ipv6.abo.wanadoo.fr)
09:46:11 <[exa]> (`<$>` is like `$`, but "through some kind of <box>", which is the IO action here)
09:46:51 <cemguresci> hmm thats interesting
09:47:12 <[exa]> this is one interesting thing about purity in haskell, it forces you to organize the stuff precisely (e.g., no reliance on argument evaluation order as in C's and pythons)
09:47:42 × Codaraxis__ quits (~Codaraxis@user/codaraxis) (Ping timeout: 256 seconds)
09:47:49 <[exa]> which gets really inconvenient "by default", but there's a lot of the helpers like <$> that magically make it more convenient and safer than in the languages where the action order is kinda implicit
09:48:47 × neurocyte091 quits (~neurocyte@user/neurocyte) (Quit: The Lounge - https://thelounge.chat)
09:49:11 Midjak joins (~Midjak@may53-1-78-226-116-92.fbx.proxad.net)
09:49:18 × polyphem_ quits (~rod@2a02:810d:640:776c:e450:3ca3:b389:687a) (Quit: WeeChat 3.3)
09:49:59 neurocyte0917 joins (~neurocyte@IP-046243081042.dynamic.medianet-world.de)
09:49:59 × neurocyte0917 quits (~neurocyte@IP-046243081042.dynamic.medianet-world.de) (Changing host)
09:49:59 neurocyte0917 joins (~neurocyte@user/neurocyte)
09:50:57 <cemguresci> exa: thank you so much teaching some information in this short time. I will do more research
09:51:25 <[exa]> the main takeaway is that instead of "running commands" here you compose the "program descriptions" (with types such as `IO xxx`) to make larger program descriptions, and haskell runtime takes the program description in `main` and runs it for you
09:52:20 <cemguresci> yes, excatly thats what I feel :D
09:52:48 × Erutuon quits (~Erutuon@user/erutuon) (Ping timeout: 256 seconds)
09:53:19 <[exa]> btw the `do` notation does just this, most commands are connected with >> (basically a semicolon in imperative languages) or >>= (a semicolon that carries the result)
09:53:26 <[exa]> :t putStrLn "a"
09:53:27 <lambdabot> IO ()
09:53:31 polyphem joins (~rod@2a02:810d:640:776c:e450:3ca3:b389:687a)
09:53:47 <[exa]> (IO action that returns "empty type", ie nothing)
09:53:57 <[exa]> :t putStrLn "a" >> putStrLn "b"
09:53:58 <lambdabot> IO ()
09:54:09 <[exa]> (2 IO actions combined into one)
09:54:22 ubert joins (~Thunderbi@2a02:8109:9880:303c:de3b:67d7:83e8:947e)
09:55:16 <[exa]> :t readLn >>= (\x -> print $ 2*x)
09:55:17 <lambdabot> IO ()
09:55:56 user0 joins (~aj@154.0.137.32)
09:56:00 spaceseller joins (~spacesell@31.147.205.13)
09:56:03 <[exa]> (2 actions combined into one with carrying the result, this is what `do x<-readLn; print (2*x);` looks like without the fancy syntax )
09:56:37 user0 parts (~aj@154.0.137.32) ()
09:57:08 <cemguresci> cool stuff :D
09:58:22 <[exa]> and well, eventually someone will tell you that all stuff that can be combined in such way belongs to a wider, infamously named category of composable computations :D
09:58:23 <juhp> okay I made this to create stack program symlinks to Fedora ghc's: https://gist.github.com/juhp/a9c49281a8e478eb9af30a78a87ab0d7
09:59:27 × nhatanh02 quits (~satori@123.24.172.30) (Ping timeout: 256 seconds)
09:59:43 <cemguresci> exa: more theory of everything :D
09:59:58 <cemguresci> abstracting the abstraction :D
10:02:05 × spaceseller quits (~spacesell@31.147.205.13) (Quit: Leaving)
10:02:09 Everything joins (~Everythin@37.115.210.35)
10:10:31 <maerwald[m]> juhp: why
10:11:17 <juhp> maerwald[m]: because I prefer to use the Fedora built ghc on Fedora
10:11:34 <maerwald[m]> juhp: https://docs.haskellstack.org/en/stable/yaml_configuration/#system-ghc
10:12:24 <juhp> maerwald[m]: yes I know but I have multiple Fedora ghc's (ghc8.10, ghc9.0, ghc9.2)
10:13:15 <juhp> Having an extra copy under ~/.stack is just a waste of diskspace :)
10:13:24 <juhp> copies
10:13:30 <maerwald[m]> juhp: then use a patched stack: https://github.com/commercialhaskell/stack/pull/5585
10:14:36 <maerwald[m]> Here are prebuilt binaries https://downloads.haskell.org/~ghcup/unofficial-bindists/stack/2.7.3.1/
10:14:37 × n3rdy1 quits (~n3rdy1@2600:1700:4570:3480:1b88:50f:dae0:9293) (Ping timeout: 240 seconds)
10:15:37 <juhp> maerwald[m]: cool
10:15:47 <juhp> We have stack packaged in fedora too
10:16:05 <maerwald[m]> And?
10:17:31 <juhp> maerwald[m]: happy to use stack hooks once it is merged upstream :)
10:17:49 mastarija joins (~mastarija@2a05:4f46:e0e:5000:e9aa:f35a:429e:f1b8)
10:18:18 <maerwald[m]> juhp: it will never be
10:19:07 wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com)
10:19:07 × wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host)
10:19:07 wroathe joins (~wroathe@user/wroathe)
10:19:18 <juhp> Well maybe I can apply your patch to Fedora stack then - would be nice indeed to automatically prefer or even install the Fedora build
10:20:25 <juhp> (Fedora ghcX.Y build)
10:20:29 <maerwald[m]> Since stack has stagnated, it should be easy to maintain the patch downstream
10:20:41 <juhp> Ya I suppose
10:20:51 acidjnk joins (~acidjnk@p200300d0c7271e249cd77df40fde183d.dip0.t-ipconnect.de)
10:20:51 acidjnk_new3 joins (~acidjnk@p200300d0c7271e249cd77df40fde183d.dip0.t-ipconnect.de)
10:24:23 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds)
10:28:45 <juhp> maerwald[m]: alright I parked your patch in my Fedora stack package directory - I may consider it for Fedora 36, thanks
10:29:46 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
10:33:25 <juhp> Btw for those using Stackage Nightly: the next snapshot should be based on ghc-9.0.2 hopefully (thanks to Adam Bergmark)
10:33:57 × Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 240 seconds)
10:34:35 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 256 seconds)
10:34:42 × mastarija quits (~mastarija@2a05:4f46:e0e:5000:e9aa:f35a:429e:f1b8) (Quit: Leaving)
10:35:10 Lord_of_Life joins (~Lord@user/lord-of-life/x-2819915)
10:38:16 SummerSonw joins (~The_viole@203.77.49.232)
10:39:29 × coot quits (~coot@89-64-85-93.dynamic.chello.pl) (Quit: coot)
10:49:55 wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com)
10:49:55 × wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host)
10:49:55 wroathe joins (~wroathe@user/wroathe)
10:51:17 <[exa]> cemguresci: actually these things are pretty concrete requirements, "do stuff in order based on some defined ordering logic" and "use results from earlier steps"
10:51:17 × Vajb quits (~Vajb@2001:999:50:e6be:1e98:9376:d93e:4506) (Read error: Connection reset by peer)
10:53:06 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
10:54:25 × Brumaire quits (~quassel@37.166.249.26) (Ping timeout: 256 seconds)
10:54:47 Brumaire joins (~quassel@37.172.143.113)
10:54:59 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds)
10:55:33 × Akiva quits (~Akiva@user/Akiva) (Ping timeout: 256 seconds)
10:56:18 sub0 joins (~bc8147f2@cerf.good1.com)
10:58:15 coot joins (~coot@89-64-85-93.dynamic.chello.pl)
11:01:28 alx741 joins (~alx741@157.100.93.160)
11:01:49 burnsidesLlama joins (~burnsides@dhcp168-021.wadham.ox.ac.uk)
11:07:04 kjak joins (~kjak@pool-108-45-56-21.washdc.fios.verizon.net)
11:07:54 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
11:11:00 × benin quits (~benin@183.82.176.241) (Ping timeout: 256 seconds)
11:15:03 × lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection)
11:18:05 puke joins (~puke@user/puke)
11:18:57 benin joins (~benin@183.82.176.241)
11:20:42 wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com)
11:20:42 × wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host)
11:20:42 wroathe joins (~wroathe@user/wroathe)
11:25:44 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds)
11:26:16 jgeerds joins (~jgeerds@55d4bbed.access.ecotel.net)
11:37:37 × Brumaire quits (~quassel@37.172.143.113) (Ping timeout: 240 seconds)
11:38:26 Brumaire joins (~quassel@81-64-14-121.rev.numericable.fr)
11:41:05 kupi joins (uid212005@id-212005.hampstead.irccloud.com)
11:43:35 DNH joins (~DNH@2a02:8108:1100:16d8:ad26:5398:3e1f:d97d)
11:46:02 nhatanh02 joins (~satori@123.24.172.30)
11:48:43 <cemguresci> exa: right that makes sense
11:49:22 <cemguresci> exa: when I define these, `data Recipient = Recipient String | Nothing deriving Show` `data Amount = Amount Double | Nothing deriving Show` , I get this error "Multiple declarations of `Nothing'" Why it happens?
11:49:53 <c_wraith> constructors must be unique (per module)
11:50:10 Hanicef joins (~gustaf@81-229-9-108-no92.tbcn.telia.com)
11:50:14 <c_wraith> But the fact that you're using the name Nothing suggests a misunderstanding
11:50:39 <c_wraith> Those aren't the same Nothing as is defined in the Maybe type
11:50:52 <c_wraith> those are your own value named Nothing
11:50:57 <cemguresci> I am combining these with other data types and I want to construct the latest data type with nullable of this data types
11:51:32 <c_wraith> When you declare a data type, you declare constructors *for that type*
11:51:43 <sub0> your Nothing construct will conflict with Nothing from Maybe
11:51:48 <sub0> constructor*
11:52:16 <sshine> cemguresci, maybe you want: 'type Recipient = String; type Amount = Double' and then in your functions you can write 'Maybe Recipient' and 'Maybe Amount' types to signify values like 'Just "Bob" :: Maybe Recipient' and 'Nothing :: Maybe Recipient' and 'Just 42.0 :: Maybe Amount' and 'Nothing :: Maybe Amount'?
11:52:23 <c_wraith> sub0: not actually true. Maybe is defined in a different module. that error is coming from defining Nothing twice in the same module. There would be an ambiguity error using it, though
11:53:02 <cemguresci> c_wraith: you are right. it is not the same Nothing in Maybe :D
11:53:03 <sshine> cemguresci, it's not that creating your own nullable data type is necessarily bad. but maybe you want to consider using the existing Maybe type to describe whether or not there's a recipient/amount?
11:53:31 <sub0> c_wraith, Nothing is in Prelude. it will conflict with his name unless he took measures to prevent it
11:53:41 <c_wraith> sub0: but that's not what that error was reporting.
11:53:49 <sub0> I didn't comment on the error
11:54:11 <c_wraith> cemguresci: it is a requirement of Haskell's type inference that constructors always are unique to types.
11:54:47 <c_wraith> cemguresci: the fully-qualified names thereof, at least.
11:55:15 <cemguresci> I see, I confused how to use Nothing actually to make it nullable :D
11:55:18 × ubert quits (~Thunderbi@2a02:8109:9880:303c:de3b:67d7:83e8:947e) (Remote host closed the connection)
11:55:31 ubert joins (~Thunderbi@2a02:8109:9880:303c:6bbe:db4a:c5b0:8e19)
11:56:29 <cemguresci> This is actually what I want, data Test = Test {
11:56:29 <cemguresci> amount :: Maybe Amount,
11:56:29 <cemguresci> recipient :: Maybe Recipient
11:56:29 <cemguresci> } deriving (Eq, Show, Generic)
11:56:29 <[exa]> cemguresci: better name it unambiguously as `NoRecipient`
11:56:56 <[exa]> I'd say that there you may go for `Maybe String` right away
11:57:07 <[exa]> or `Maybe Name`
11:57:28 <[exa]> naming the whole thing as Recipient sounds kinda like you also store the whole person there, with all organs etc :D
11:57:39 <cemguresci> haha :D
11:57:46 <[exa]> (hard-learned OOP lesson :D )
11:57:56 <sshine> yea, Recipient does sound like a nested data type :) RecipientName or Name. but meh.
11:58:14 <cemguresci> you are right
11:58:16 <[exa]> `type Name=String` is a pretty common sight in packages
11:58:24 × jonathanx quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Remote host closed the connection)
11:58:27 <[exa]> and yeah, meh. :D
11:58:42 jonathanx joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
12:00:54 × ubert quits (~Thunderbi@2a02:8109:9880:303c:6bbe:db4a:c5b0:8e19) (Remote host closed the connection)
12:01:06 ubert joins (~Thunderbi@2a02:8109:9880:303c:2e0:44f:2ede:1485)
12:01:24 × jonathanx quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Remote host closed the connection)
12:01:42 jonathanx joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
12:06:10 jespada joins (~jespada@87.74.36.188)
12:16:34 slack1256 joins (~slack1256@191.126.99.72)
12:16:37 × slack1256 quits (~slack1256@191.126.99.72) (Remote host closed the connection)
12:25:00 geranim0 joins (~geranim0@modemcable242.171-178-173.mc.videotron.ca)
12:25:47 simendsjo joins (~user@2a02:2121:2c5:187:eedf:c36:9193:ad44)
12:25:47 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Quit: = "")
12:26:11 califax- joins (~califax@user/califx)
12:30:33 × califax quits (~califax@user/califx) (Ping timeout: 276 seconds)
12:30:33 califax- is now known as califax
12:32:30 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
12:34:43 × benin quits (~benin@183.82.176.241) (Ping timeout: 256 seconds)
12:35:37 × mvk quits (~mvk@2607:fea8:5cdd:f000::45db) (Ping timeout: 240 seconds)
12:36:37 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 240 seconds)
12:40:53 <joel135> I just found the word Haskalah. Sounds like haskell :P
12:46:52 Rum joins (~bourbon@user/rum)
12:48:05 <Hecate> Haskallah Al-Rahman Al-Raheem? :P
12:49:09 benin joins (~benin@183.82.176.241)
12:50:34 wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com)
12:50:34 × wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host)
12:50:34 wroathe joins (~wroathe@user/wroathe)
12:51:50 × benin quits (~benin@183.82.176.241) (Client Quit)
12:55:50 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds)
12:56:08 × max22- quits (~maxime@2a01cb088335980037d8471a1d5e7a78.ipv6.abo.wanadoo.fr) (Ping timeout: 252 seconds)
12:57:48 × Everything quits (~Everythin@37.115.210.35) (Quit: leaving)
12:58:51 × Rum quits (~bourbon@user/rum) (Quit: WeeChat 3.4)
13:06:36 × mmhat quits (~mmh@55d459b4.access.ecotel.net) (Ping timeout: 256 seconds)
13:06:41 <absence> can cabal use a "resolver" from stack/stackage to decide which package versions to use?
13:09:29 <geekosaur> not yet
13:10:17 <absence> yet? is it planned or being worked on?
13:10:27 <geekosaur> yes
13:11:28 <absence> cool, is there somewhere i can read about it and/or follow the progress?
13:11:57 × cosimone quits (~user@2001:b07:ae5:db26:c24a:d20:4d91:1e20) (Remote host closed the connection)
13:12:31 cosimone joins (~user@2001:b07:ae5:db26:c24a:d20:4d91:1e20)
13:14:16 <geekosaur> lemme see if I can find the ticket again
13:14:37 × nhatanh02 quits (~satori@123.24.172.30) (Ping timeout: 240 seconds)
13:15:30 × ubert quits (~Thunderbi@2a02:8109:9880:303c:2e0:44f:2ede:1485) (Remote host closed the connection)
13:15:49 ubert joins (~Thunderbi@2a02:8109:9880:303c:816c:2f7:b4df:2063)
13:18:00 <geekosaur> https://github.com/haskell/cabal/issues/7556
13:19:35 mmhat joins (~mmh@55d45069.access.ecotel.net)
13:20:56 <absence> looks promising, thanks!
13:22:37 × acidjnk quits (~acidjnk@p200300d0c7271e249cd77df40fde183d.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
13:22:37 × acidjnk_new3 quits (~acidjnk@p200300d0c7271e249cd77df40fde183d.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
13:24:57 × simendsjo quits (~user@2a02:2121:2c5:187:eedf:c36:9193:ad44) (Ping timeout: 240 seconds)
13:25:04 × vpan quits (~0@212.117.1.172) (Quit: Leaving.)
13:27:30 waleee joins (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4)
13:28:45 × Hanicef quits (~gustaf@81-229-9-108-no92.tbcn.telia.com) (Quit: leaving)
13:31:03 × SummerSonw quits (~The_viole@203.77.49.232) (Remote host closed the connection)
13:31:23 SummerSonw joins (~The_viole@203.77.49.232)
13:43:21 × burnsidesLlama quits (~burnsides@dhcp168-021.wadham.ox.ac.uk) (Remote host closed the connection)
13:43:53 burnsidesLlama joins (~burnsides@client-8-64.eduroam.oxuni.org.uk)
13:44:06 geekosaur wonders how close one could get to this by translating a resolver into an incomplete freeze file
13:44:59 × jgeerds quits (~jgeerds@55d4bbed.access.ecotel.net) (Ping timeout: 256 seconds)
13:45:57 <fendor[m]> iirc, the issue describes how far you can get with freeze files and what the limitations are
13:46:26 lavaman joins (~lavaman@98.38.249.169)
13:48:23 × burnsidesLlama quits (~burnsides@client-8-64.eduroam.oxuni.org.uk) (Ping timeout: 256 seconds)
13:50:48 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 256 seconds)
13:51:54 × jonathanx quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Remote host closed the connection)
13:51:59 mjacob_ is now known as mjacob
13:52:13 jonathanx joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
13:52:13 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
13:55:37 × SummerSonw quits (~The_viole@203.77.49.232) (Ping timeout: 240 seconds)
14:00:04 nhatanh02 joins (~satori@123.24.172.30)
14:00:48 × kupi quits (uid212005@id-212005.hampstead.irccloud.com) (Quit: Connection closed for inactivity)
14:01:27 × coot quits (~coot@89-64-85-93.dynamic.chello.pl) (Quit: coot)
14:05:09 SummerSonw joins (~The_viole@203.77.49.232)
14:09:11 kupi joins (uid212005@id-212005.hampstead.irccloud.com)
14:10:01 alx741 joins (~alx741@157.100.93.160)
14:12:49 xkuru joins (~xkuru@user/xkuru)
14:14:25 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
14:16:13 CiaoSen joins (~Jura@p200300c957347b002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
14:19:47 × DNH quits (~DNH@2a02:8108:1100:16d8:ad26:5398:3e1f:d97d) (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:19:48 × sub0 quits (~bc8147f2@cerf.good1.com) (Quit: CGI:IRC (Ping timeout))
14:20:04 bontaq joins (~user@ool-45779fe5.dyn.optonline.net)
14:22:27 DNH joins (~DNH@2a02:8108:1100:16d8:ad26:5398:3e1f:d97d)
14:27:56 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Remote host closed the connection)
14:29:37 geekosaur joins (~geekosaur@xmonad/geekosaur)
14:30:57 alx741 joins (~alx741@157.100.93.160)
14:31:16 shriekingnoise joins (~shrieking@186.137.144.80)
14:32:24 × jonathanx quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Remote host closed the connection)
14:32:44 jonathanx joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
14:35:56 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
14:37:44 stef204 joins (~stef204@user/stef204)
14:38:23 antony joins (~The_viole@203.77.49.232)
14:38:36 × antony quits (~The_viole@203.77.49.232) (Client Quit)
14:39:23 × cemguresci quits (~cemguresc@2001:a61:11ff:a001:2dad:6df8:999e:4708) (Remote host closed the connection)
14:39:35 cemguresci joins (~cemguresc@2001:a61:11ff:a001:2dad:6df8:999e:4708)
14:43:52 o-90 joins (~o-90@gateway/tor-sasl/o-90)
14:46:30 wroathe joins (~wroathe@user/wroathe)
14:53:42 × Inst quits (~delicacie@c-98-208-218-119.hsd1.fl.comcast.net) (Ping timeout: 256 seconds)
14:54:37 alx741 joins (~alx741@157.100.93.160)
14:54:41 × noddy quits (~user@user/noddy) (Quit: WeeChat 3.4)
14:54:54 × jonathanx quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Remote host closed the connection)
14:55:12 jonathanx joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
14:56:25 noddy joins (~user@user/noddy)
14:57:43 xb0o2 joins (~xb0o2@user/xb0o2)
14:59:22 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
15:00:57 × notzmv quits (~zmv@user/notzmv) (Ping timeout: 240 seconds)
15:00:57 jakalx parts (~jakalx@base.jakalx.net) ()
15:01:20 × SummerSonw quits (~The_viole@203.77.49.232) (Remote host closed the connection)
15:01:42 SummerSonw joins (~The_viole@203.77.49.232)
15:02:33 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Quit: Leaving)
15:03:55 geekosaur joins (~geekosaur@xmonad/geekosaur)
15:04:52 burnsidesLlama joins (~burnsides@dhcp168-021.wadham.ox.ac.uk)
15:05:57 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 240 seconds)
15:06:04 atmunr joins (~atmunr@181.199.145.102)
15:06:06 jakalx joins (~jakalx@base.jakalx.net)
15:07:31 × atmunr quits (~atmunr@181.199.145.102) (Client Quit)
15:07:55 Feuermagier joins (~Feuermagi@user/feuermagier)
15:10:34 × SummerSonw quits (~The_viole@203.77.49.232) (Quit: Leaving)
15:10:41 max22- joins (~maxime@2a01cb088335980011bb54fd9cdf5176.ipv6.abo.wanadoo.fr)
15:12:57 × wyrd quits (~wyrd@gateway/tor-sasl/wyrd) (Quit: leaving)
15:15:21 <sclv> absence, geekosaur stackage already provides those freeze files: https://www.stackage.org/lts-18.5/cabal.config
15:15:45 <geekosaur> so I saw when I read the ticket
15:15:58 <sclv> there's no link anywhere from the stackage page itself (its an "easter egg feature") because they decided they didn't like promoting it, ostensibly because those don't handle revisions
15:16:51 <sclv> the feature i've been working on would let you add a line "import https://foo/cabal.config" directly to a project file
15:17:06 jkaye joins (~jkaye@2601:281:8300:7530:960c:6e00:5eeb:eb5a)
15:17:10 alx741 joins (~alx741@157.100.93.160)
15:17:35 <sclv> and the main issue is merge constraint semantics are not useful right now
15:17:46 <sclv> it just picks up all constraints and applies them all.
15:17:55 <sclv> so you can't ever "override" a resolver
15:18:49 Sgeo joins (~Sgeo@user/sgeo)
15:20:30 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
15:23:24 sirlensalot joins (~sirlensal@ool-44c5f8c9.dyn.optonline.net)
15:24:07 ProfSimm joins (~ProfSimm@87.227.196.109)
15:26:11 × off^ quits (~off@207.5.21.20) (Remote host closed the connection)
15:29:43 coot joins (~coot@89-64-85-93.dynamic.chello.pl)
15:33:08 × DNH quits (~DNH@2a02:8108:1100:16d8:ad26:5398:3e1f:d97d) (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:34:38 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
15:37:24 alx741 joins (~alx741@157.100.93.160)
15:38:54 × jonathanx quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Remote host closed the connection)
15:38:57 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 240 seconds)
15:39:12 jonathanx joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
15:39:24 × stef204 quits (~stef204@user/stef204) (Quit: WeeChat 3.4)
15:40:08 × alx741 quits (~alx741@157.100.93.160) (Client Quit)
15:50:55 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
15:51:48 × mmhat quits (~mmh@55d45069.access.ecotel.net) (Quit: WeeChat 3.4)
15:52:42 DNH joins (~DNH@2a02:8108:1100:16d8:ad26:5398:3e1f:d97d)
15:56:12 × Hafydd quits (~Hafydd@user/hafydd) (Quit: WeeChat 3.3)
15:56:19 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
15:56:27 × nhatanh02 quits (~satori@123.24.172.30) (Ping timeout: 256 seconds)
15:56:58 × Jing quits (~hedgehog@2604:a840:3::103c) (Remote host closed the connection)
15:57:37 Jing joins (~hedgehog@2604:a840:3::103c)
15:57:50 × nf quits (~n@monade.li) (Quit: Fairfarren.)
15:59:16 Hafydd joins (~Hafydd@user/hafydd)
16:00:03 × Hafydd quits (~Hafydd@user/hafydd) (Client Quit)
16:00:47 zmt00 joins (~zmt00@user/zmt00)
16:02:07 × jumper149 quits (~jumper149@base.felixspringer.xyz) (Quit: WeeChat 3.3)
16:04:24 × ubert quits (~Thunderbi@2a02:8109:9880:303c:816c:2f7:b4df:2063) (Remote host closed the connection)
16:05:05 wyrd joins (~wyrd@gateway/tor-sasl/wyrd)
16:07:20 shapr joins (~user@2601:7c0:c202:5190:1c89:9f27:44af:85b3)
16:07:31 nf joins (~n@monade.li)
16:09:01 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
16:11:02 × jkaye quits (~jkaye@2601:281:8300:7530:960c:6e00:5eeb:eb5a) (Ping timeout: 240 seconds)
16:17:15 zebrag joins (~chris@user/zebrag)
16:17:24 × wyrd quits (~wyrd@gateway/tor-sasl/wyrd) (Ping timeout: 276 seconds)
16:18:07 [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470)
16:19:26 wyrd joins (~wyrd@gateway/tor-sasl/wyrd)
16:20:42 jkaye joins (~jkaye@2601:281:8300:7530:89aa:29d4:1f39:3e9)
16:20:55 rekahsoft joins (~rekahsoft@cpe0008a20f982f-cm64777d666260.cpe.net.cable.rogers.com)
16:21:57 × jpds quits (~jpds@gateway/tor-sasl/jpds) (Ping timeout: 276 seconds)
16:23:09 jpds joins (~jpds@gateway/tor-sasl/jpds)
16:24:57 × cheater quits (~Username@user/cheater) (Ping timeout: 240 seconds)
16:30:03 × coolnickname quits (uid531864@user/coolnickname) (Quit: Connection closed for inactivity)
16:30:32 × pavonia quits (~user@user/siracusa) (Quit: Bye!)
16:36:00 × cosimone quits (~user@2001:b07:ae5:db26:c24a:d20:4d91:1e20) (Remote host closed the connection)
16:36:42 cosimone joins (~user@2001:b07:ae5:db26:c24a:d20:4d91:1e20)
16:42:08 × CiaoSen quits (~Jura@p200300c957347b002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 268 seconds)
16:43:24 × o-90 quits (~o-90@gateway/tor-sasl/o-90) (Ping timeout: 276 seconds)
16:43:33 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
16:45:14 <cemguresci> Hi guys, why this function errors stack overfow, i dont understand. ppow abc a = xx
16:45:14 <cemguresci> where fd = read (take 4 . reverse $ show(hashWithSalt a abc)) :: Integer
16:45:14 <cemguresci> xx = if fd < 5999
16:45:14 <cemguresci> then a
16:45:14 <cemguresci> else (ppow abc a+1)
16:45:20 slowButPresent joins (~slowButPr@user/slowbutpresent)
16:45:23 <EvanR> @where paste
16:45:23 <lambdabot> Help us help you: please paste full code, input and/or output at e.g. https://paste.tomsmeding.com
16:45:27 <EvanR> dang that's handy
16:46:21 <cemguresci> all right. https://paste.tomsmeding.com/xrs11gGJ
16:46:40 <cemguresci> this works, *Main Data.Hashable Data.Hashable.Time Data.Int> ppow z 33
16:46:40 <cemguresci> 33
16:46:50 <EvanR> did you want to do (ppow abc (a + 1)) at the end
16:47:12 Akiva joins (~Akiva@user/Akiva)
16:47:12 <EvanR> or (ppow abc a) + 1
16:47:15 <cemguresci> *Main Data.Hashable Data.Hashable.Time Data.Int> ppow z 32
16:47:15 <cemguresci> *** Exception: stack overflow
16:47:15 <cemguresci> this doesnt
16:48:09 <EvanR> note how the second understanding leads to an infinite loop
16:48:24 × jonathanx quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Remote host closed the connection)
16:48:28 <cemguresci> now it owkrs :D
16:48:35 <cemguresci> works :D
16:48:46 jonathanx joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
16:49:34 <EvanR> rather if fd starts < 5999 it remains so forever because the same question gets repeated infinitely
16:50:21 <cemguresci> i thought making a+1 will act like (a + 1), never assume that, right
16:50:45 Inst joins (~delicacie@c-98-208-218-119.hsd1.fl.comcast.net)
16:50:51 × chele quits (~chele@user/chele) (Remote host closed the connection)
16:50:55 <EvanR> + just has lower parsing precedence than the space in 'f x'
16:51:10 <EvanR> function application binds tighter
16:51:43 <EvanR> similar to 'times' in algebra xy + ab
16:52:10 <EvanR> but it also binds tighter than *
16:52:45 nhatanh02 joins (~satori@123.24.172.30)
16:53:29 × stefan-_ quits (~cri@42dots.de) (Ping timeout: 250 seconds)
16:56:39 <Hecate> Hello, I'm doing user research regarding a feature I'm hoping to get into Cabal, that would allow people to seamlessly integrate native compiled languages (read: rust/zig/C) in their Cabal project
16:56:46 <Hecate> Based on the ideas in https://gist.github.com/Kleidukos/729fd6a091307e0929f7519126b4a6c8
16:56:57 × mbuf quits (~Shakthi@122.178.240.232) (Quit: Leaving)
16:57:17 stefan-_ joins (~cri@42dots.de)
16:58:28 <Hecate> long story short I'm gathering your testimonials in order to know how I can best serve you
16:58:38 <sclv> Hecate: i don't understand your reference to hackage builders there at all
16:58:39 <Hecate> the idea is to provide an alternative to custom Setup.hs
16:58:58 <cemguresci> thanks EvanR
16:59:00 nunggu joins (~q@gateway/tor-sasl/nunggu)
16:59:04 <Hecate> sclv: When you upload a library to Hackage, isn't it impossible to specify a custom command to have them run?
16:59:12 cemguresci is now known as cemg
16:59:17 <sclv> no hackage uses a standard cabal build
16:59:37 × Inst quits (~delicacie@c-98-208-218-119.hsd1.fl.comcast.net) (Ping timeout: 240 seconds)
16:59:42 <sclv> but standard cabal builds can use custom setup.hs
17:00:01 × waleee quits (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4) (Ping timeout: 268 seconds)
17:00:09 <Hecate> yes but we're actively trying to get rid of those ;)
17:00:14 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
17:00:23 <sclv> right but the reference to hackage makes no sense
17:00:27 <EvanR> cemguresci, worth understanding precedence in haskell because 1. it's relevant to stuff like a -> b -> c, which is understood as a -> (b -> c), 2. people sprinkle $ everywhere, often gratuitously, to adjust precedence and 3. you can define the precedence of custom operators
17:00:30 <sclv> its just one of many systems that uses cabal build
17:00:31 <Hecate> wait wait let me finish
17:00:34 <sclv> there's nothing special about it
17:01:04 <Hecate> one of the critics I've received is: Why don't you use $other_tool or just run commands in the right order?
17:01:16 <Hecate> and my answer was "there are systems that only run standard cabal builds"
17:01:19 <Hecate> like Hackage runners
17:01:28 <sclv> you can make that argument more generally
17:01:30 <Hecate> where you can't specify a custom command to run
17:01:40 <Hecate> yup' but I thought an example would be more speaking?
17:01:44 <sclv> any time package X wants to depend on package Y then cabal will build package Y with a standard cabal build
17:01:49 <Hecate> but yes it's more general than just Hackage
17:01:56 <Hecate> great, thank you :)
17:02:26 <sclv> that said, I think you can do 95% of this with build-tool-depends and not needing any changes to cabal grammar
17:03:19 <sclv> you _might_ not be able to do it with custom stanzas per tool in the cabal grammar (not sure about nested syntax of x-fields) but you could just put that config in a distinct file
17:03:43 <sclv> so i really would encourage you to try build-tool-depends for this, and document what if any limitations that has
17:03:50 <sclv> and maybe that could just be mildly fixed or extended
17:04:41 <Hecate> sclv: I have a hard time understanding the operational semantics of build-tool-depends, does it run anything? Does it add anything to the pipeline?
17:05:02 × vysn quits (~vysn@user/vysn) (Ping timeout: 240 seconds)
17:05:40 <Hecate> I'm understanding that it provides executables in the scope (PATH?) during the duration of the component
17:06:56 <Hecate> sclv: you're right in that I can declare the necssity of having the cargo-driver (for instance) in the $PATH, this does the majority of the job I think
17:07:14 <sclv> fair point it doesn't actually run it
17:07:22 <Hecate> but then I'd have to register the driver to run before the component is built
17:07:46 <Hecate> sclv: that being said the code behind build-tool-depends can absolutely be reused! :)
17:08:12 <sclv> actually wait, i have an open pr that almost does this: https://github.com/haskell/cabal/pull/7688
17:08:18 <sclv> its just limited to test suites only now
17:08:48 <sclv> i think i didn't want it in main stanzas because it can generate new hs modules and we want the cabal file to have a manifest of all exposed cabal modules
17:08:58 tzh joins (~tzh@c-24-21-73-154.hsd1.wa.comcast.net)
17:08:58 <sclv> so i don't think we want that
17:08:59 × Akiva quits (~Akiva@user/Akiva) (Ping timeout: 256 seconds)
17:09:39 <sclv> but arguably i'd just want one new field, "build-tools-pipeline" that runs a list of executables in order
17:09:47 <sclv> (with build-tools-depends used to bring them into scope)
17:10:36 <sclv> which is almost exactly your build-drivers field, but i'm leaning against having the x- fields in the cabal file get passed in
17:10:39 <Hecate> sclv: don't we have autogen-modules for those?
17:10:44 <sclv> i think it confuses the grammar to make that extensible
17:11:14 <Hecate> sclv: when you say "get passed in" I'm not sure to fully understand
17:11:57 <sclv> well i'm given to understand if you say build-driver: cargo-driver then the x-cargo-driver stanza somehow gets passed to cargo-driver
17:12:14 <sclv> i'd rather you just call "cargo-driver" and it finds its settings like in some other file or something
17:12:38 <Hecate> sclv: oh no it doesn't get passed-in to the driver
17:12:45 <sclv> ok then what does it do
17:12:47 <Hecate> I'd have the cargo-driver parse the Cabal file
17:12:51 <Hecate> get its stanza
17:12:57 <Hecate> this is low-tech enough
17:13:10 <sclv> as i said idk if we can have x-stanzas or just x-fields
17:13:22 <Hecate> aaaah ok I understand now
17:13:39 notzmv joins (~zmv@user/notzmv)
17:14:06 <sclv> the minimal proposal i'd support would be just build-drivers (but i'd prefer it called build-tools-pipeline or the like for uniformity, though that's totally something people can argue about on a ticket, etc)
17:15:06 <Hecate> > Notice that you can create custom stanzas in your foo.cabal. I have provided the code to support a stanza something like:
17:15:07 <lambdabot> <hint>:1:43: error: parse error on input ‘in’
17:15:09 <Hecate> https://webcache.googleusercontent.com/search?q=cache:ug9swepTVJoJ:https://www.py4u.net/discuss/1985295+&cd=19&hl=fr&ct=clnk&gl=fr&client=firefox-b-d
17:16:19 <sclv> not sure that's accurate let me check
17:17:06 <geekosaur> iirc it at least used to be possible
17:17:50 <sclv> yeah, it works as is
17:18:06 <Hecate> hurray :D
17:18:19 <Hecate> this saves the x-$driver stanza
17:18:22 <sclv> ok, so drivers can read custom stanzas or other files or whatever its up to them :-)
17:18:29 <Hecate> sclv: :D yes!
17:18:47 <Hecate> ah man this makes me so happy
17:18:48 <sclv> again this means the minimal proposal is just a single new field that adds executables to a preprocessor pipeline
17:19:18 <sclv> there might be some prior tickets on this lying around, but imho it makes a lot of sense
17:19:19 <Hecate> yup', as advertised in the FAQ I want this to be minimally invasive for Cabal
17:19:50 <Hecate> And this is a step forward getting rid of a legitimate usage of Setup.hs
17:19:52 <sclv> it might be worth trying to figure out how many current uses of custom Setup.hs can be obviated by this
17:19:53 <sclv> yep
17:20:23 <Hecate> sclv: speaking of which, I've been contacted with someone that has quite a horrific situation: https://twitter.com/marunarh/status/1479496482063589376
17:20:46 <Hecate> you said that generated .hs modules in Setup.hs are Not Good™, would it be better if they were registered in autogen-modules?
17:20:46 × Jing quits (~hedgehog@2604:a840:3::103c) (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:20:49 CiaoSen joins (~Jura@p200300c957347b002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
17:21:37 <sclv> right, we really want the cabal file to statically list all modules a package can provide
17:21:42 waleee joins (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4)
17:22:19 <Hecate> perfect, so I can tell people to do this then
17:22:23 <Hecate> 👍*
17:27:04 econo joins (uid147250@user/econo)
17:28:50 <[itchyjunk]> When it says "define your own list type", am i supposed to create a new datastructure somehow?
17:29:16 <[itchyjunk]> "define your own list type and then implement your own version of the following functions : " it says
17:30:03 <geekosaur> yes
17:30:14 <geekosaur> it's not even particularly difficult
17:30:24 × jonathanx quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Remote host closed the connection)
17:30:41 <[itchyjunk]> hmmmmm
17:31:00 Hafydd joins (~Hafydd@user/hafydd)
17:31:10 jonathanx joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
17:33:37 <geekosaur> the one thing you can't readily do is use [x,y,z] syntax with it
17:34:07 <geekosaur> (there's a way around that but I'm pretty sure they don't want you to do that now)
17:35:24 × jonathanx quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Remote host closed the connection)
17:35:41 jonathanx joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
17:42:59 × doyougnu quits (~doyougnu@c-73-25-202-122.hsd1.or.comcast.net) (Ping timeout: 256 seconds)
17:44:53 × cemg quits (~cemguresc@2001:a61:11ff:a001:2dad:6df8:999e:4708) (Ping timeout: 252 seconds)
17:48:06 <[itchyjunk]> hmm
17:48:13 lavaman joins (~lavaman@98.38.249.169)
17:48:35 <EvanR> remind me why it would be a bad idea to have a default instance of some class that select types "reimplement" OOP style
17:48:56 <EvanR> it breaks separate compilation or
17:49:30 <geekosaur> separate compilation has to be able to find instances by fixed names
17:49:45 <geekosaur> which then become global across the entire program
17:49:57 <[itchyjunk]> I want a `data List a = someConstructorHere variable | someOtherCons moreVariables
17:49:58 <[itchyjunk]> `
17:50:27 <geekosaur> that said, you can do this with default implementations in the class head, depending on what you really need
17:50:48 <EvanR> just curious, don't need it!
17:52:35 <[itchyjunk]> I suppose i want my type to be deriving Num
17:52:37 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 256 seconds)
17:52:56 <geekosaur> [itchyjunk], not if you're reimplementing a list, no
17:52:58 <EvanR> [itchyjunk], are you throwing spaghetti at a wall now
17:53:22 <[itchyjunk]> Always have been!
17:53:26 Erutuon joins (~Erutuon@user/erutuon)
17:53:54 <[itchyjunk]> yeah i am trying to implement list where i can define a mySum and sum all the elements of the list
17:54:24 × jonathanx quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Read error: Connection reset by peer)
17:54:29 <EvanR> that requires Num support on elements and not the list
17:54:42 <[itchyjunk]> hmm right
17:55:33 jonathanx joins (~jonathan@h-178-174-176-109.a357.priv.bahnhof.se)
17:55:46 <[itchyjunk]> define a list containing a, where a is constrained to the Num interface like thingy
17:55:59 <[itchyjunk]> `data List a = ?`
17:56:48 × coot quits (~coot@89-64-85-93.dynamic.chello.pl) (Quit: coot)
17:56:57 <[itchyjunk]> not the `a` either, apparently
17:57:02 <c_wraith> GHC has disabled the functionality that used to allow that, because.. it turned out to not be useful.
17:57:18 <c_wraith> Just put constraints on the places that need them. the data constructor does not need them
17:58:09 <geekosaur> is there anything else you're supposed to define?
17:58:22 Hayek joins (~xxx@rrcs-173-196-3-254.west.biz.rr.com)
17:58:27 <geekosaur> :t sum -- note we put the constraint on the function, not the list
17:58:27 <lambdabot> (Foldable t, Num a) => t a -> a
17:58:34 <geekosaur> meh
17:58:42 <geekosaur> % :t sum @[]
17:58:42 <yahb> geekosaur: Num a => [a] -> a
17:58:43 <Hayek> src sum
17:58:47 <[itchyjunk]> the full problem is here :http://www.cas.mcmaster.ca/~dalvescb/LH_Week05_Exercises.pdf
17:58:58 <Hayek> % :t sum
17:58:58 <yahb> Hayek: (Foldable t, Num a) => t a -> a
17:59:00 <[itchyjunk]> problem 3), mySum, ++, myReverse
17:59:20 <geekosaur> right, I'd put the Num part on mySum because the others don't need it
17:59:55 <geekosaur> and myReverse would be pretty limited if it only worked on lists of numbers
18:00:12 × nurupo quits (~nurupo.ga@user/nurupo) (Quit: nurupo.ga)
18:00:25 nurupo joins (~nurupo.ga@user/nurupo)
18:00:28 <[itchyjunk]> i see what you mean. i only want it to be numbers when i need to add then, not always.
18:01:04 <c_wraith> The problem even gives you types for each - only one of which has a constraint
18:01:32 <[itchyjunk]> Right :x
18:01:41 × waleee quits (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4) (Ping timeout: 268 seconds)
18:01:57 <[itchyjunk]> I don't grasp the purpose of type constructors
18:02:01 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
18:02:23 <[itchyjunk]> here they say data FightMove = Punch | Kick | Block
18:02:24 <[itchyjunk]> https://mmhaskell.com/blog/2016/12/17/making-your-own-data-types-in-haskell
18:02:31 <[itchyjunk]> So it's the things that type can do
18:02:51 <monochrom> But you need a parametrized type now.
18:02:53 <[itchyjunk]> so for my list, would the constructors be the type of things the list can do like produce of sum of elements?
18:02:56 <geekosaur> those are data constructors, not type constructors
18:02:57 <[itchyjunk]> hmm
18:03:05 <geekosaur> consider data Bool = False | True
18:03:05 [itchyjunk] scrolls down to parametrized types to read
18:03:16 <glguy> [itchyjunk]: In your data FightMove ... , FightMove was the type constructor
18:03:19 <[itchyjunk]> ah
18:03:27 <geekosaur> Bool is the type constructor, False and True are the data constructors
18:03:28 waleee joins (~waleee@h-98-128-229-110.na.cust.bahnhof.se)
18:03:40 <geekosaur> they are values just like 1 or "foo"
18:07:32 <geekosaur> in data Maybe a = Nothing | Just a, Maybe is a type constructor which takes a type parameter; Nothing is a value, Just is a data constructor which takes a value of the type you specified with the type constructor
18:07:36 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
18:07:51 <geekosaur> so Just 'a' is a value whose type is Maybe Char
18:08:36 <glguy> [itchyjunk]: the cool thing about data constructors is that you can case on them. When you see capitalized identifiers in patterns you know they only match values created with that constructor
18:08:44 cheater joins (~Username@user/cheater)
18:09:22 <[itchyjunk]> I get the Maybe being a type constructor but why isn't Just a type constructor but a data constructor?
18:09:33 <[itchyjunk]> because of its appearence in RHS there?
18:09:41 <geekosaur> because it constructs data instead of constructing types
18:10:12 <glguy> [itchyjunk]: there are two distinct levels. Type-level and value-level.
18:10:20 <[itchyjunk]> so `Just a` is a value whose type is `Maybe` ?
18:10:25 <[itchyjunk]> Why is it `Maybe Char` ?
18:10:34 <geekosaur> because I applied Just to a Char
18:10:42 <geekosaur> :t 'a'
18:10:43 <lambdabot> Char
18:10:43 <[itchyjunk]> ahh Just 'a' right
18:11:25 <[itchyjunk]> Why is it `Nothing` and not `Nothing a` ?
18:11:47 <monochrom> Because "Nothing 5" makes no sense.
18:11:49 <Michal[m]> the type is 'Maybe a' not Maybe
18:11:50 <[itchyjunk]> Nothing represents when the parameter is left empty right?
18:11:59 <geekosaur> because it doesn't take a parameter
18:12:00 <[itchyjunk]> Michal[m], oh
18:12:03 <geekosaur> :t Just
18:12:03 <lambdabot> a -> Maybe a
18:12:12 <geekosaur> :t Nothing
18:12:13 <lambdabot> Maybe a
18:12:25 <geekosaur> this is like the empty list, which can be of any list type
18:12:27 <geekosaur> :t []
18:12:28 <lambdabot> [a]
18:12:44 <geekosaur> but a list ['c'] is necessarily a list of Char
18:12:51 <[itchyjunk]> `data List a = Nothing | ?` so here, i have accounted for my type `List a` to be empty ?
18:13:12 <geekosaur> you can't reuse Nothing, unfortunately, it's already associated with Maybe
18:13:20 <[itchyjunk]> ah
18:13:42 <geekosaur> for historical reasons we often call that Nil
18:13:46 <[itchyjunk]> `data List a = EmptyList | ? `
18:13:55 <[itchyjunk]> oh i see `data List a = Nil | ? `
18:14:25 <geekosaur> now think about how a list works. not the [x,y,z] form but the other one which you'll mostly have seen as (x:xs)
18:14:40 × DNH quits (~DNH@2a02:8108:1100:16d8:ad26:5398:3e1f:d97d) (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:15:26 <[itchyjunk]> a : data List xs 'ish
18:15:32 <[itchyjunk]> oops
18:15:39 <[itchyjunk]> x : data List xs, maybe?
18:15:52 <[itchyjunk]> Wait no, idk what i am saying
18:16:09 <Michal[m]> you can construct a list by taking an existing list and adding an element to it
18:16:19 × mikko quits (~mikko@2a02:7b40:d418:6a61::1) (Quit: WeeChat 2.7.1)
18:16:20 <geekosaur> you can't reuse : for the same reason you can't reuse Nothing
18:16:28 <Michal[m]> this should give you the second constructor, beside Nil
18:16:29 <[itchyjunk]> Oh :<
18:16:34 <int-e> @src []
18:16:34 <lambdabot> data [] a = [] | a : [a]
18:17:00 <geekosaur> I was hoping not to give them the answer right out :)
18:17:34 <int-e> (this is a lie, you can't actually write that in Haskell (except that's literally how GHC.Types does it))
18:17:36 <geekosaur> should be able to figure that out from how theyve been recursing on the RHS of a list
18:18:33 <int-e> we seemed to be a little too far off the correct syntax though :-/
18:18:54 <geekosaur> they're supposed to be building their own list type and defining some functions on it
18:19:19 <int-e> (And we still have to figure out what that looks like with different type and constructor names)
18:19:28 <[itchyjunk]> hmm
18:19:36 × gehmehgeh quits (~user@user/gehmehgeh) (Ping timeout: 276 seconds)
18:20:00 × ProfSimm quits (~ProfSimm@87.227.196.109) (Remote host closed the connection)
18:21:40 <[itchyjunk]> i need to recursively define it as first element plus rest of List xs and it does down all the way to Nil condition.. i think that is the idea?
18:22:08 dyeplexer joins (~dyeplexer@user/dyeplexer)
18:22:26 <geekosaur> yes
18:22:41 <geekosaur> the same way you've been recursing on real lists
18:23:54 × jonathanx quits (~jonathan@h-178-174-176-109.a357.priv.bahnhof.se) (Remote host closed the connection)
18:24:12 ProfSimm joins (~ProfSimm@87.227.196.109)
18:24:17 jonathanx joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
18:24:59 <geekosaur> I was hoping I could coach you through using how you had been recursing on real lists to realize how they must be defined, and thereby how you would need to define your own
18:25:18 <geekosaur> since understanding this is key to understanding how lists work
18:25:28 <[itchyjunk]> `data List a = Nil | List a` ish ..
18:25:44 <geekosaur> not quite. remember (x:xs)
18:25:53 <geekosaur> you only have xs there
18:26:28 <[itchyjunk]> `data List a = Nil | a along with List a`
18:26:40 <geekosaur> well, actually as written you have x with a data constructor name List
18:27:03 <geekosaur> right, now you need to work out how to write that "along with"
18:27:08 <monochrom> I happen to think that this is a poor exercise. Be it unpopular opinion.
18:27:23 gehmehgeh joins (~user@user/gehmehgeh)
18:27:31 <monochrom> Case 1. If you have taught the [] type properly, then this exercise is too trivial.
18:27:47 <geekosaur> you have a better idea for an introduction to recursive data types?
18:28:06 <monochrom> Case 2. If you have taught the [] type improperly, then this exercise punishes the good students and rewards the bad students. Here is why:
18:28:12 × jrm quits (~jrm@156.34.249.199) (Read error: Connection reset by peer)
18:28:32 jrm joins (~jrm@156.34.249.199)
18:29:12 <monochrom> For student who want to understand: Since you taught [] improperly, they don't know where to start for understanding, hell, you probably taught them wrong ideas to start. There is nothing to chew on.
18:29:55 <monochrom> For student who want to cargo-cult: They can just look at "data [a] = [] | a : [a]" and change syntax. This still does not need understanding.
18:30:05 <[itchyjunk]> How does the : look like without sugar syntax?
18:30:25 <geekosaur> it's not sugar, it's just an operator-style data constructor
18:30:45 <geekosaur> these all start with : which is arbitrarily considered an "uppercase" symbol character
18:31:02 enikar suggest renamed : as cons
18:31:15 <c_wraith> the [] case is sugar though. That one is a totally special case.
18:31:49 <c_wraith> monochrom: I think there's value in showing people they can reimplement what [] does - the only magical things are the names.
18:31:58 lavaman joins (~lavaman@98.38.249.169)
18:32:01 <geekosaur> we also have data NonEmpty a = a :| [a]
18:32:02 <[itchyjunk]> `data List (x:xs) = Nil| x : List xs` conceptually but i don't get to use : because it's already used ?
18:32:22 <geekosaur> where :| is the constructor
18:32:30 <monochrom> Yes, therefore I don't pose it as an exercise, I give it as an example.
18:32:57 × raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 240 seconds)
18:33:03 <[itchyjunk]> hmm
18:33:21 <monochrom> A good exercise is not to ask students to reinvent list but to design variations.
18:33:40 zer0bitz joins (~zer0bitz@196.244.192.57)
18:36:13 <EvanR> reinventing the let wheel = "roll... " : wheel in wheel
18:39:00 jgeerds joins (~jgeerds@55d4bbed.access.ecotel.net)
18:40:24 × jonathanx quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Remote host closed the connection)
18:42:30 <[itchyjunk]> I don't think i've managed to reinvent this wheel yet though. hopefully this clicks soon..
18:42:37 × dyeplexer quits (~dyeplexer@user/dyeplexer) (Remote host closed the connection)
18:44:17 × jrm quits (~jrm@156.34.249.199) (Ping timeout: 240 seconds)
18:47:01 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
18:47:03 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
18:51:38 <geekosaur> all you need to do is pick some other operator name that starts with a colon. :| and :+ are taken, and comma is reserved so :, won't work
18:51:58 <geekosaur> or you can define it with a prefix name instead of an infix operator
18:52:58 <c_wraith> oh, huh. It never occurred to me that , is too reserved to use in an operator. I guess [ and ] are, too.
18:53:23 <geekosaur> I thought it might work until I considered (:,)
18:56:27 DNH joins (~DNH@2a02:8108:1100:16d8:ad26:5398:3e1f:d97d)
18:56:38 <geekosaur> it does raise an interesting parse error if you attempt it
18:59:09 <[itchyjunk]> Right, i think i solved the mystery. When you said pick an operator, that was a strong hint that i wasn't internalizing
18:59:19 <[itchyjunk]> data constructor is an actual operator
18:59:35 <[itchyjunk]> `data List a = Nil | Cons a (List a)`
19:00:59 <geekosaur> there you go
19:01:19 <geekosaur> you could also choose an operator like ::: although it'd be a PITA
19:01:25 <EvanR> data I'mCool a = Shade :~!#$? Shade
19:01:29 <geekosaur> (:: is taken)
19:02:14 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
19:02:17 eastbillie joins (~gallup@192-222-138-215.qc.cable.ebox.net)
19:02:18 × abarbu quits (~user@c-66-31-23-28.hsd1.ma.comcast.net) (Read error: Connection reset by peer)
19:02:23 × eastbillie quits (~gallup@192-222-138-215.qc.cable.ebox.net) (Client Quit)
19:02:51 <c_wraith> I'd probably pretend I don't know Cofree exists and just use :<
19:02:52 ouestbillie joins (~gallup@192-222-138-215.qc.cable.ebox.net)
19:03:09 <monochrom> I use :>
19:03:16 <[itchyjunk]> so `I'mCool` is a type constructor and `a` is a parameter. this only has one data constructor called `Shade` that takes 2 parameter `:~!#$?` and `Shade` ?
19:03:28 <geekosaur> nope
19:03:32 <EvanR> no :~!#$? is the constructor
19:03:33 <[itchyjunk]> :(
19:03:44 <EvanR> just like in []
19:03:47 <geekosaur> remember iniitial : is an operator-style constructor
19:03:49 <EvanR> starts with a colon
19:04:23 <EvanR> haskell is cool for having this but now I'm questioning if it's quite counterintuitive xD
19:04:25 <geekosaur> so you have a constructor :-!#$? with two Shade parameters
19:04:31 <c_wraith> and since no one else has called it out, I will. you can be cool if you have a pair of shades
19:04:51 simendsjo joins (~user@84.211.91.241)
19:05:34 <monochrom> BTW if you have "data List a = Nil | a `Cons` List a deriving Show" or "data I'mCool a = (:~!#$?) Shade Shade deriving Show", the derived Show instances will actually respect your non-default choice of fixity.
19:06:04 <EvanR> did not know that
19:06:19 qwertyasda joins (~Qwerty@wsip-174-71-193-82.lv.lv.cox.net)
19:07:00 justsomeguy joins (~justsomeg@user/justsomeguy)
19:07:19 <EvanR> @let data Int2 = Int `I2` Int
19:07:20 <lambdabot> Defined.
19:07:26 <EvanR> > I2 1 2
19:07:28 <lambdabot> error:
19:07:28 <lambdabot> • No instance for (Show Int2)
19:07:28 <lambdabot> arising from a use of ‘show_M59481879713528625638’
19:07:33 <EvanR> @undefined
19:07:33 <lambdabot> Undefined.
19:07:36 <EvanR> @let data Int2 = Int `I2` Int deriving Show
19:07:37 <lambdabot> Defined.
19:07:38 <EvanR> > I2 1 2
19:07:40 <lambdabot> 1 `I2` 2
19:07:41 × qwertyasda quits (~Qwerty@wsip-174-71-193-82.lv.lv.cox.net) (Quit: Leaving)
19:08:32 <EvanR> next time I'm at a loss at a party I'll bring that up
19:09:46 <c_wraith> I seem to recall derived show not respecting fixity declarations on punctuation operator constructors, though
19:11:06 <geekosaur> I recall thatr being raised as a bug several years ago but don't know if it's been fixed
19:11:49 × jgeerds quits (~jgeerds@55d4bbed.access.ecotel.net) (Ping timeout: 240 seconds)
19:16:45 <glguy> @let data Example = Int :* Example | End deriving Show; infixr 5 :*
19:16:46 <lambdabot> Defined.
19:16:46 <glguy> 1 :* 2 :* 3 :* End
19:16:51 <glguy> > 1 :* 2 :* 3 :* End
19:16:52 <lambdabot> 1 :* (2 :* (3 :* End))
19:17:29 <geekosaur> mm, the one I recall is where it omits necessary parens, such that the result isn't parsable
19:17:45 <geekosaur> that one's just a little unfortunate but still works
19:18:06 <glguy> > Just (1 :* 2 :* 3 :* End)
19:18:07 <lambdabot> Just (1 :* (2 :* (3 :* End)))
19:18:33 <glguy> I don't know about the unparsable issue
19:19:04 <geekosaur> I didn't find it on a quick search so that one may have been fixed already
19:24:40 × justsomeguy quits (~justsomeg@user/justsomeguy) (Quit: WeeChat 3.3)
19:31:24 × burnsidesLlama quits (~burnsides@dhcp168-021.wadham.ox.ac.uk) (Remote host closed the connection)
19:33:57 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 240 seconds)
19:35:56 <c_wraith> what's odd is that showsPrec is so mechanical to implement respecting fixity, it seems like it would be feasible to have the deriving mechanism do it.
19:36:42 <glguy> I think the trouble is that showsPrec doesn't know about fixity, only precedence, so it has to make a worst case assumption
19:37:55 coot joins (~coot@89-64-85-93.dynamic.chello.pl)
19:44:23 johnw joins (~johnw@2607:f6f0:3004:1:c8b4:50ff:fef8:6bf0)
19:48:52 × cosimone quits (~user@2001:b07:ae5:db26:c24a:d20:4d91:1e20) (Remote host closed the connection)
19:49:10 mvk joins (~mvk@2607:fea8:5cdd:f000::45db)
19:51:21 doyougnu joins (~doyougnu@c-73-25-202-122.hsd1.or.comcast.net)
19:51:45 cosimone joins (~user@2001:b07:ae5:db26:c24a:d20:4d91:1e20)
19:53:17 jgeerds joins (~jgeerds@55d4bbed.access.ecotel.net)
19:53:30 xmyst joins (~xmyst@ip5f5ac363.dynamic.kabel-deutschland.de)
19:54:28 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
19:54:57 × Feuermagier quits (~Feuermagi@user/feuermagier) (Ping timeout: 240 seconds)
19:55:17 × jgeerds quits (~jgeerds@55d4bbed.access.ecotel.net) (Remote host closed the connection)
19:57:55 × cheater quits (~Username@user/cheater) (Quit: (BitchX) Bob Barker uses BitchX. Have your BitchX spayed or neutered.)
20:04:35 cheater joins (~Username@user/cheater)
20:05:13 × juhp quits (~juhp@128.106.188.82) (Ping timeout: 256 seconds)
20:05:42 jrm joins (~jrm@156.34.249.199)
20:08:04 juhp joins (~juhp@128.106.188.82)
20:09:15 burnsidesLlama joins (~burnsides@dhcp168-021.wadham.ox.ac.uk)
20:14:51 × burnsidesLlama quits (~burnsides@dhcp168-021.wadham.ox.ac.uk) (Ping timeout: 256 seconds)
20:16:19 coolnickname joins (uid531864@user/coolnickname)
20:36:28 × motherfsck quits (~motherfsc@user/motherfsck) (Remote host closed the connection)
20:37:33 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
20:38:39 × Hayek quits (~xxx@rrcs-173-196-3-254.west.biz.rr.com) (Ping timeout: 256 seconds)
20:46:35 × ouestbillie quits (~gallup@192-222-138-215.qc.cable.ebox.net) (Ping timeout: 256 seconds)
20:46:59 <dmj`> almost started funding the wrong haskell foundation https://www.haskellfoundation.org/donate/
20:47:21 vysn joins (~vysn@user/vysn)
20:49:36 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
20:49:56 <Hecate> hahahahahaha
20:51:21 burnsidesLlama joins (~burnsides@dhcp168-021.wadham.ox.ac.uk)
20:51:50 <dmj`> saw "tribal affiliation" and was like "Is this related to the burning bridges proposal?"
20:53:02 jonathanx joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
20:55:12 Shiranai joins (~Shiranai@190.237.13.79)
20:55:39 × burnsidesLlama quits (~burnsides@dhcp168-021.wadham.ox.ac.uk) (Ping timeout: 256 seconds)
20:55:57 pavonia joins (~user@user/siracusa)
21:01:13 Inst joins (~delicacie@c-98-208-218-119.hsd1.fl.comcast.net)
21:02:32 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
21:02:44 <Shiranai> Hello, I'm writing a function with signature `(Int, Bool) -> Command -> Just (Int, Bool)` for use in a foldM. I want Bool to be used as a flag for shortcircuiting the loop, I tried `myFunc (val, True)=Just (val, True)` but does not seem to shortcircuit as I expected
21:03:26 × cosimone quits (~user@2001:b07:ae5:db26:c24a:d20:4d91:1e20) (Ping timeout: 252 seconds)
21:03:31 <Shiranai> I meant `myFunc (val, True) _ = Just (val, True)`
21:03:38 × takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection)
21:04:07 <xerox> @src foldM
21:04:07 <lambdabot> foldM _ a [] = return a
21:04:07 <lambdabot> foldM f a (x:xs) = f a x >>= \fax -> foldM f fax xs
21:04:07 <Shiranai> how do shortcircuit correctly?
21:04:21 <xerox> looks like f can't decide to shortcut
21:04:22 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
21:05:01 <xerox> >>= is happening no matter what f uses of its arguments
21:05:24 × jonathanx quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Remote host closed the connection)
21:05:44 jonathanx joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
21:05:51 <Shiranai> hmmm thanks, any idea how to shortcut through other means?
21:06:16 <xerox> @src foldr
21:06:16 <lambdabot> foldr f z [] = z
21:06:16 <lambdabot> foldr f z (x:xs) = f x (foldr f z xs)
21:06:27 <xerox> this one can because f can ignore the rest of the fold, it's second argument
21:06:43 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
21:07:06 <Shiranai> is there a monadic version though? I need to use Maybe
21:08:02 <sshine> use Maybe where?
21:09:28 <dmj`> why use Bool to short circuit when Maybe automatically short circuits
21:09:29 <Shiranai> I'm parsing a list of commands so I need to use something like foldM and Maybe
21:10:18 <Shiranai> because I want to rescue the other value in the pair (Int, Maybe)
21:10:19 <EvanR> you can also use direct recursion to short circuit
21:11:18 <Shiranai> (Int, Bool)* I meant
21:11:19 <EvanR> I suspect there is a more elegant way for you to write it without the Bool flag in a pair
21:11:27 <Shiranai> agree
21:11:31 <xerox> what does the fold do?
21:11:48 <Shiranai> I have no idea what it may be though
21:12:14 <EvanR> what is the Just for
21:12:20 <EvanR> I mean, Maybe
21:12:37 <EvanR> that also can short circuit
21:13:16 <c_wraith> You probably want Either instead of Maybe, in this case
21:13:35 <c_wraith> Either Int Int short-circuits and actually returns the result. :)
21:14:02 <xerox> ah nice the left interrupts >>= !
21:14:13 <c_wraith> yes it does!
21:15:04 <Shiranai> the fold parses a list of comments, most of the commands change the value of an Int, but the return command implies that there is no need for keep reading the rest of the commands, so that's why I thought of using (Int, Bool) as the accumulator
21:15:06 <EvanR> then there's the awkward use of Either ErrorMsg () which is like reversed use of Maybe
21:17:11 × simendsjo quits (~user@84.211.91.241) (Ping timeout: 256 seconds)
21:17:49 <dmj`> Shiranai: can you paste your code?
21:17:52 <EvanR> when it comes to "complicated" monadic loops, I often write the loop logic as a new combinator and use that
21:18:07 <EvanR> instead of trying to use a premade loop (from a package) or foldM
21:18:17 × nhatanh02 quits (~satori@123.24.172.30) (Ping timeout: 240 seconds)
21:18:28 <EvanR> Control.Monad.Loops has like 30 loops and often none of them fit
21:18:48 <Shiranai> dmj` I probably shouldn't since it's some kind of assignment, that's why I'm being vague, sorry about that
21:19:17 × raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 240 seconds)
21:19:40 <Shiranai> yeah I think doing a custom loop is the way to go without refactoring a lot of a code, thanks!
21:20:21 <EvanR> but c_wraith idea sounded likely
21:21:09 × _ht quits (~quassel@82-169-194-8.biz.kpn.net) (Remote host closed the connection)
21:21:42 Franciman joins (~Franciman@mx1.fracta.dev)
21:21:54 Franciman parts (~Franciman@mx1.fracta.dev) (haskell is cringe)
21:23:57 × Inst quits (~delicacie@c-98-208-218-119.hsd1.fl.comcast.net) (Ping timeout: 240 seconds)
21:25:24 × jonathanx quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Remote host closed the connection)
21:25:46 Franciman joins (~Franciman@mx1.fracta.dev)
21:25:49 jonathanx joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
21:25:57 <Franciman> hello, what's the difference between the native code generator of haskell
21:26:01 <Franciman> and the llvm based one?
21:26:10 <Franciman> and why is the llvm based one known to be better even if slower?
21:26:17 <Franciman> what's the use of a native code generator of haskell?
21:26:22 <Franciman> why would i need it?
21:26:23 f-a joins (f2a@f2a.jujube.ircnow.org)
21:26:35 <Franciman> is it to have a sort of autarchy?
21:26:39 <Franciman> having a self contained system?
21:26:49 <geekosaur> llvm is slower because we can't pass it information it needs to optimize and they have no interest in adding ghc-specific support that would be needed
21:27:24 <geekosaur> you can get significantly better code natively
21:27:36 <Franciman> yet i seem to understand it produce at least as good code as the native code generator
21:27:40 <Franciman> that's what the docs report
21:27:51 <Franciman> i suppose
21:28:33 <geekosaur> ghc itself does, but llvm's optimizer defaults to doing as little as possible of its own optimization because it doesn't really understand the IR ghc generates
21:29:00 <geekosaur> and never will because it's all CPSed and llvm won't add support for ghc's CPS transforms
21:29:23 <Franciman> makes total sense to me
21:29:58 <geekosaur> and ghc needs all the optimization help it can get because graph reduction is inherently less performant than direct code
21:30:34 <Franciman> makes sense i see. Do you think LLVM backend can help soothe this problem, tho? https://gitlab.haskell.org/ghc/ghc/-/issues/20445
21:31:01 n3rdy1 joins (~n3rdy1@2600:1700:4570:3480::41)
21:31:03 <Franciman> that's why i was asking what's the need of a native backend when it's bugged
21:31:09 <Franciman> but the fact that it supports special needs
21:31:13 <Franciman> is more than better answer
21:31:15 <Franciman> thanks geekosaur
21:31:43 <geekosaur> 9.0.2 should hopefully fix that one
21:32:03 <geekosaur> it's not unusual that .1 point releases are buggy, that's why there are later releases
21:32:36 <geekosaur> we actually went through the same thing with m1 llvm support, but the ".1" release was 8.10.5
21:32:44 <geekosaur> wasn't stable until 8.10.7
21:32:54 × jonathanx quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Remote host closed the connection)
21:33:06 <geekosaur> so it's not like llvm is always better codegen-wise
21:33:15 jonathanx joins (~jonathan@h-178-174-176-109.a357.priv.bahnhof.se)
21:34:50 <Franciman> i just quoted the docs
21:35:16 <dmj`> If GHC went from STG to LLVM directly it'd probably be faster than the current approach of Cmm to LLVM.
21:36:29 <Franciman> dmj`: faster but maybe produce worse code
21:36:56 <EvanR> clarification please, the LLVM backend is slower... meaning it takes longer to produce code, or the resulting code is slower
21:37:17 <Franciman> takes longer to produce code
21:38:01 <EvanR> and resulting code is about the same performance?
21:39:06 <dmj`> Franciman: it actually took longer to produce ARM code before we got the native ARM backend, since LLVM was just being used as an additional translation layer to get to ARM by way of Cmm.
21:39:07 burnsidesLlama joins (~burnsides@dhcp168-021.wadham.ox.ac.uk)
21:42:43 <geekosaur> the code is also generally less performant although this depends on the exact code
21:42:57 <geekosaur> numeric operations are often as fast or faster
21:43:24 × burnsidesLlama quits (~burnsides@dhcp168-021.wadham.ox.ac.uk) (Ping timeout: 256 seconds)
21:48:00 <dmj`> geekosaur: do we have any benchmarks to compare STG -> LLVM vs. Cmm -> LLVM? I think that would be super interesting.
21:48:27 × Shiranai quits (~Shiranai@190.237.13.79) (Quit: Connection closed)
21:50:03 <geekosaur> no, there is currently no way for ghc to go directly stg -> llvm
21:50:29 <geekosaur> and little interest in doing so since the llvm folks aren't interested either
21:51:08 × mc47 quits (~mc47@xmonad/TheMC47) (Remote host closed the connection)
21:51:19 <geekosaur> you might wan tto talk to the folks in #ghc about it but this is my understanding of the situation
21:51:33 <geekosaur> (I think you want moritz angermann)
21:51:54 × jonathanx quits (~jonathan@h-178-174-176-109.a357.priv.bahnhof.se) (Remote host closed the connection)
21:52:06 Franciman parts (~Franciman@mx1.fracta.dev) (long live telescope)
21:52:12 jonathanx joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
21:53:11 <geekosaur> llvm is currently something of a bastard child because doing anything significant over what ghc already does requires teaching llvm about ghc's cps-ed code
21:53:57 <geekosaur> so almost all effort has gone into the native backends, with the exception of m1 support because it required such radical changes
21:55:41 <geekosaur> (basically, apple decided to get rid of C-style type promotion, everything is its native size. which had to be reflected everywhere, so for example in 9.2.x Char# is 32 bits and Word8# is 8 bits)
21:56:05 OscarZ_ joins (~oscarz@95.175.104.170)
21:57:46 <dmj`> geekosaur: Interesting, I know compiling HOFs isn't feasible, which I imagine a CPS pass would create a lot of. GRIN can handle those (HOFs) through a defunctionalization pass. This could also be done in Core before you even get to STG / Cmm. I've wondered why GHC doesn't completely monomorphize up front, then CPS transform, defunctionalize, optimize, then codegen to LLVM. MLTon does this more or less.
21:58:20 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
21:58:23 <geekosaur> you'd have to ask them
21:58:25 <dmj`> well, you'd have to lambda lift and closure convert before defunctionalizing too
21:58:52 <dmj`> geekosaur: I think its because you can't encode existentials when you monomorphize, but maybe I'm wrong
21:59:26 f-a parts (f2a@f2a.jujube.ircnow.org) ()
21:59:27 <geekosaur> afaik existentials as such cease to exist as distinct entities past the typechecker
22:00:05 × DNH quits (~DNH@2a02:8108:1100:16d8:ad26:5398:3e1f:d97d) (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:00:25 <monochrom> My understanding is that STG moves support for HOFs to the RTS and it is a very direct form of support, i.e., without encoding it by defunctionalization.
22:02:42 <monochrom> For example if you look at generated Cmm code you can see it calling functions with names like "ap1_fast", which are functions provided by the RTS.
22:03:15 sub0 joins (~bc8147f2@cerf.good1.com)
22:03:17 Pickchea joins (~private@user/pickchea)
22:03:54 × jonathanx quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Remote host closed the connection)
22:04:14 <dmj`> monochrom: interesting, I know defunctionalization requires a whole program pass, so maybe GHC being incremental makes it a non-starter.
22:04:20 jonathanx joins (~jonathan@h-178-174-176-109.a357.priv.bahnhof.se)
22:04:49 <monochrom> I would describe STG as thunk-passing style instead of continuation-passing style. :)
22:04:51 <geekosaur> that was one of the changes grin had to make to ghc, yeh
22:05:03 <monochrom> Or s/thunk/closure/ if you will.
22:05:10 × glguy quits (x@libera/staff/glguy) (Quit: Quit)
22:05:23 glguy joins (x@libera/staff/glguy)
22:05:24 × jonathanx quits (~jonathan@h-178-174-176-109.a357.priv.bahnhof.se) (Remote host closed the connection)
22:05:43 jonathanx joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
22:05:58 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
22:06:14 <dmj`> geekosaur: hmm, yea the modpak files got merged iirc. I wonder if a ghc-plugin would have been more appropriate, or if that is even possible with the plugin architecture.
22:08:03 <dmj`> monochrom: One of the arguments I've heard against GHC going whole program optimizing is that cross module inlining is good enough. I wonder how well this holds up in practice, because I'm pretty sure GHC will generate code that does a blind JMP to some function pointer address for all unknown calls, which are probably a lot I imagine.
22:09:20 <geekosaur> I find myself wondering of there are some other barriers to it
22:09:30 <int-e> memory usage?
22:10:03 wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com)
22:10:03 × wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host)
22:10:03 wroathe joins (~wroathe@user/wroathe)
22:10:15 <geekosaur> like, the inlinePerformIO hullabaloo suggests to me that ghc relies on *not* doing inlining in some cases to prevent lifting things that shouldn't be lifted
22:10:48 × kupi quits (uid212005@id-212005.hampstead.irccloud.com) (Quit: Connection closed for inactivity)
22:11:02 <geekosaur> and of WPC exposes IO definitions for inlining then that barrier might be hard to maintain
22:11:18 <geekosaur> *if WPC
22:12:07 jackhill is now known as KM4MBG
22:12:35 KM4MBG is now known as jackhill
22:16:31 <dmj`> seems like Lennart has done it and thinks its ok https://twitter.com/Augustsson/status/1104924762499768320
22:16:46 coot parts (~coot@89-64-85-93.dynamic.chello.pl) ()
22:17:11 coot joins (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827)
22:17:36 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
22:17:57 × n3rdy1 quits (~n3rdy1@2600:1700:4570:3480::41) (Ping timeout: 240 seconds)
22:18:22 <EvanR> monochrom, you just changed from thunk to closure. I'm not sure which one is more vague (outside context of GHC guts)
22:18:28 <geekosaur> the question I have there, as above, is whether *ghc* can do this or if it'd require significant rearchitecting to the point of writing a whole new compiler as lennart did
22:21:32 × xff0x quits (~xff0x@2001:1a81:525f:5800:1882:d375:707:2176) (Ping timeout: 240 seconds)
22:21:57 × coot quits (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827) (Ping timeout: 240 seconds)
22:21:58 acidjnk_new3 joins (~acidjnk@p200300d0c7271e73e4c690103e77be5f.dip0.t-ipconnect.de)
22:21:58 acidjnk joins (~acidjnk@p200300d0c7271e73e4c690103e77be5f.dip0.t-ipconnect.de)
22:22:08 <monochrom> EvanR, the good news and bad news is that STG finds that it can use closures for thunks (and a lot of other things) so "everything is a closure". In this context, "closure" is not vague.
22:22:32 <EvanR> everything is a closure, great
22:22:35 <EvanR> so it's like a box
22:22:43 xff0x joins (~xff0x@2001:1a81:525f:5800:6161:847e:32a5:3ca7)
22:24:32 <dmj`> geekosaur: that's a good question, I don't know. Not many optimizations happen in STG (afaik), GRIN is its supposed successor, yet it performs all the optimizations. So if GRIN is to be included in GHC why do the optimizations in Core at all? Unless there is a way to combine GRIN and Core. GRIN being first-order makes me lean no.
22:25:19 <dmj`> If you keep the compiler frontend is it considered a rewrite ? :)
22:25:45 <geekosaur> you might ask the grin folks that question :)
22:26:09 <geekosaur> I'd also be interested in finding out as above if they had any issues with IO escaping its boundaries
22:26:38 <geekosaur> although I guess that part lives in the frontend, so probably no unless they didn;t do due diligence with the WPC part
22:30:47 evocatus joins (~evocatus@62.182.77.224)
22:31:01 n3rdy1 joins (~n3rdy1@2600:1700:4570:3480:1b88:50f:dae0:9293)
22:31:24 × evocatus quits (~evocatus@62.182.77.224) (Remote host closed the connection)
22:33:55 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
22:35:44 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
22:39:15 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
22:39:30 <dmj`> geekosaur: sure, will see what I can find out about IO escaping boundaries
22:44:26 motherfsck joins (~motherfsc@user/motherfsck)
22:46:08 DNH joins (~DNH@2a02:8108:1100:16d8:ad26:5398:3e1f:d97d)
22:47:17 × raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 240 seconds)
22:48:17 × Pickchea quits (~private@user/pickchea) (Ping timeout: 240 seconds)
22:51:37 × shapr quits (~user@2601:7c0:c202:5190:1c89:9f27:44af:85b3) (Ping timeout: 240 seconds)
22:52:06 × wyrd quits (~wyrd@gateway/tor-sasl/wyrd) (Quit: leaving)
22:52:08 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
22:52:36 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
22:53:02 cemg joins (~cemguresc@2001:a61:11ff:a001:9318:98d4:c6f5:3049)
22:54:33 <geekosaur> I'm not absolutely certain that it's a problem, but like I said the inlinePerformIO thing seems strongly suggestive
22:54:36 × vysn quits (~vysn@user/vysn) (Ping timeout: 268 seconds)
22:55:03 <geekosaur> just inlining unsafePerformIO wouldn't be expected to have that severe an effect on how ghc treats IO-using code
22:56:36 × gehmehgeh quits (~user@user/gehmehgeh) (Quit: Leaving)
22:56:55 OscarZ- joins (~oscarz@95.175.104.170)
22:59:17 × deadmarshal quits (~deadmarsh@95.38.112.110) (Ping timeout: 240 seconds)
23:00:19 × OscarZ_ quits (~oscarz@95.175.104.170) (Ping timeout: 256 seconds)
23:02:37 × notzmv quits (~zmv@user/notzmv) (Ping timeout: 268 seconds)
23:05:53 burnsidesLlama joins (~burnsides@dhcp168-021.wadham.ox.ac.uk)
23:07:24 × jonathanx quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Remote host closed the connection)
23:07:41 jonathanx joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
23:07:49 × tzh quits (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) (Ping timeout: 240 seconds)
23:08:37 × n3rdy1 quits (~n3rdy1@2600:1700:4570:3480:1b88:50f:dae0:9293) (Ping timeout: 240 seconds)
23:09:39 <c_wraith> remember, inlinePerformIO breaks everything. :)
23:12:37 × jkaye quits (~jkaye@2601:281:8300:7530:89aa:29d4:1f39:3e9) (Ping timeout: 240 seconds)
23:15:03 × machinedgod quits (~machinedg@24.105.81.50) (Ping timeout: 256 seconds)
23:16:54 × OscarZ- quits (~oscarz@95.175.104.170) (Quit: Leaving)
23:17:07 cosimone joins (~user@93-47-228-11.ip115.fastwebnet.it)
23:19:17 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
23:21:08 Inst joins (~delicacie@c-98-208-218-119.hsd1.fl.comcast.net)
23:23:43 <EvanR> it breaks all my totally justified not justified uses of unsafePerformIO
23:23:57 <EvanR> like globalllllllls!
23:25:12 <hpc> this is why i always use unsafeCoerce instead
23:25:45 <c_wraith> remember, if you try hard enough unsafeCoerce can be used as unsafePerformIO!
23:26:38 <hpc> this is why agda is the best language, its intermediate haskell representation is nothing but unsafeCoerce
23:27:03 dka joins (~code-is-a@193.70.33.83)
23:28:05 × zer0bitz quits (~zer0bitz@196.244.192.57) (Ping timeout: 256 seconds)
23:30:45 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
23:30:51 AlexNoo_ joins (~AlexNoo@178.34.162.219)
23:32:37 × AlexZenon quits (~alzenon@94.233.240.16) (Ping timeout: 256 seconds)
23:32:46 × Alex_test quits (~al_test@94.233.240.16) (Ping timeout: 256 seconds)
23:33:49 × xmyst quits (~xmyst@ip5f5ac363.dynamic.kabel-deutschland.de) (Ping timeout: 240 seconds)
23:34:28 × AlexNoo quits (~AlexNoo@94.233.240.16) (Ping timeout: 256 seconds)
23:34:56 tzh joins (~tzh@c-24-21-73-154.hsd1.or.comcast.net)
23:36:02 <[itchyjunk]> hmm
23:36:28 AlexZenon joins (~alzenon@178.34.162.219)
23:36:36 Alex_test joins (~al_test@178.34.162.219)
23:36:54 × jonathanx quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Remote host closed the connection)
23:37:16 jonathanx joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
23:37:17 <[itchyjunk]> so if my type has a data constructor of type
23:37:23 <[itchyjunk]> err
23:41:49 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
23:41:53 pretty_dumm_guy joins (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655)
23:41:54 <[itchyjunk]> My type can have 2 types of data, either Nil or the other thing, right?
23:41:54 <[itchyjunk]> https://bpa.st/W6RQ
23:42:20 <[itchyjunk]> So in case it's Nil, i want the value to be 0. `mySum Nil = 0` makes sense?
23:42:52 <EvanR> mySum Nil could not really be anything else!
23:43:10 <EvanR> process of elimination oriented programming
23:43:49 <[itchyjunk]> so then, if it's not Nil, the only other data type it could be is something of the form Cons a (ItchyList a), right?
23:43:53 <sub0> you need parens around Cons x (ItchyList xs)
23:43:58 × cosimone quits (~user@93-47-228-11.ip115.fastwebnet.it) (Read error: Connection reset by peer)
23:44:04 <geekosaur> think about how the recursive case works. it bottoms out at Nil, so that has to be 0 otherwise your sum has some other value added to it
23:44:05 <sub0> mySum (Cons x (ItchyList xs)) = x + mySum xs
23:44:08 <[itchyjunk]> ohh
23:45:05 <sub0> and remove ItchyList, that is not a constructor
23:45:24 × jonathanx quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Remote host closed the connection)
23:45:30 <sub0> (neither is Cons for that matter. you named it Con)
23:45:45 <[itchyjunk]> oops :(
23:45:46 jonathanx joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
23:46:19 <sub0> after you fix all that, consider making it an instance of Foldable
23:46:26 <sub0> then you could use regular sum, and length
23:46:28 <sub0> :t sum
23:46:29 <lambdabot> (Foldable t, Num a) => t a -> a
23:46:30 flupe joins (~baboum@radon.sbi.re)
23:46:31 <sub0> :t length
23:46:32 <lambdabot> Foldable t => t a -> Int
23:46:39 <geekosaur> writing those is part of the exercise iirc
23:46:48 <[itchyjunk]> yes part of exercise
23:47:48 <[itchyjunk]> I can't figure out how to make a ItchyList to test my code. `ItchyList testList = blah`
23:47:54 × jonathanx quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Remote host closed the connection)
23:48:11 <flupe> on the doc about -XRebindableSyntax, it says for most construct GHC will now use whatever is in scope, *except* for the arrow notation, where you must "match the Prelude types very closely". What does this mean?
23:48:14 jonathanx joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
23:48:19 <EvanR> constructors is literally how you make whatever
23:48:25 sebau1995 joins (~sebau1995@138.117.21.68)
23:48:30 <EvanR> use the constructors
23:48:36 <geekosaur> an ItchyList is either Nil, or (Con someItem anItchyList)
23:48:37 <flupe> I want to implement constrained arrows (much like contrained monads or whatever), but this seems to suggest I cannot
23:48:46 <geekosaur> recurse as needed to build a list
23:49:54 × jonathanx quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Remote host closed the connection)
23:50:03 × coolnickname quits (uid531864@user/coolnickname) (Quit: Connection closed for inactivity)
23:50:12 jonathanx joins (~jonathan@h-178-174-176-109.a357.priv.bahnhof.se)
23:51:19 × raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 256 seconds)
23:51:42 <sub0> [itchyjunk], you have two constructors, Cons and Nil. look at the types, and use them to create a list
23:51:58 cosimone joins (~user@2001:b07:ae5:db26:c24a:d20:4d91:1e20)
23:52:19 <[itchyjunk]> I am trying to do something like myList = Cons 1 Nil to create a list with 1 item
23:52:34 <sub0> that should work
23:52:44 × Brumaire quits (~quassel@81-64-14-121.rev.numericable.fr) (Quit: ran away)
23:53:18 <[itchyjunk]> It gives no error but I can check it like regular lists because i need to apparently implement my own `Show` command
23:53:22 <[itchyjunk]> maybe print? hmm
23:53:29 <[itchyjunk]> can't*
23:53:38 <EvanR> do deriving Show
23:53:50 <geekosaur> go back up to your definition and add `deriving Show` to the end
23:54:19 <[itchyjunk]> oh neat!
23:54:33 <[itchyjunk]> it all works /o\
23:55:24 <lechner> Hi, knowing that Semver is controversial, what is everyone's favorite implementation on hackage, please?
23:56:14 × sebau1995 quits (~sebau1995@138.117.21.68) (Quit: Client closed)
23:56:21 <sshine> lechner, what does an implementation of SemVer feature?
23:57:56 <lechner> a type, presumably?
23:58:08 <sshine> lechner, Data.Version in base has a partial ordering, so you can use it to express all semantic versions.
23:58:17 <sshine> https://hackage.haskell.org/package/base-4.16.0.0/docs/Data-Version.html
23:59:19 <lechner> that's what i thought. i had been using 'semver' but 'versions' is a lot more popular
23:59:31 <lechner> oh wait
23:59:36 <lechner> this is in base?
23:59:49 <sshine> yes, the Data.Version module is in base.

All times are in UTC on 2022-01-07.