Home liberachat/#haskell: Logs Calendar

Logs on 2021-12-15 (liberachat/#haskell)

00:00:02 <yuyua32> so which part of the code returns the index?
00:00:19 <snake> yuyua32, if its not in the list tho then you will get the length of the string which is wrong
00:00:26 <snake> i did this yesterday trying to look for commas
00:00:32 <hpc> there's no "returning", the entire right hand expression is the index
00:00:42 × max22- quits (~maxime@2a01cb088335980077ae04132abb6848.ipv6.abo.wanadoo.fr) (Remote host closed the connection)
00:00:59 <hpc> index n xs = the actual index, as whatever computation it happens to be
00:01:23 <hpc> ^ is how all functions are written
00:01:47 <yuyua32> oh right yeah thats right]
00:01:54 <snake> i dont mean to brag but i have a huge ego, i got a 20/20 on my recursion quiz the other day
00:01:58 <yuyua32> jheez
00:02:04 <yuyua32> so you'll be handy for this question
00:02:06 <yuyua32> xp
00:02:12 <snake> im trying
00:02:55 <yuyua32> index n (x:xs)
00:02:56 <yuyua32>   | n == x = 0
00:02:56 <yuyua32>   | otherwise = 1 + index (n xs)
00:03:07 <hpc> no parens around (n xs)
00:03:08 <yuyua32> thats not right but what would go instead of the 0
00:03:14 <yuyua32> oh right
00:03:25 <snake> that's right
00:03:30 <snake> besides the parens
00:03:35 <yuyua32> why is there a 1 +?
00:03:41 <yuyua32> because of 0 start?
00:03:43 <snake> each recursion adds 1
00:03:59 <snake> if it wasn't at zero it might be +1 from 0 (relatively)
00:04:11 <hpc> yuyua32: if 'b' is at index 1 in "abc", it's at index 2 in "*abc" no matter what '*' is
00:04:32 <yuyua32> ah got it
00:04:37 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
00:05:01 <hpc> you can pop that definition into ghci and try it out
00:05:03 <hpc> :{
00:05:04 <hpc> paste code
00:05:05 <snake> recursion is basically: "let's check if the first character matches, and if it doesn't, well we'll ask someone else to look for it. oh look this function does that, lets call it" and it's the same function you're in
00:05:05 <hpc> :}
00:05:09 <yuyua32> yep just about to try it
00:05:29 <snake> when the recursion unwinds it just adds 1 each stack frame that gets freed
00:06:09 <yuyua32> oh shit beautiful
00:06:21 <EvanR> haskell lets you use equational reasoning to see why a function works: given your code above you can be sure that e.g. index 4 [4,6,7,8] = index 4 (4:6:7:8:[]) = 0
00:06:34 × emf_ quits (~emf@2620:10d:c091:480::1:9cd9) (Read error: Connection reset by peer)
00:06:37 × epolanski quits (uid312403@id-312403.helmsley.irccloud.com) (Quit: Connection closed for inactivity)
00:06:47 emf joins (~emf@2603-6080-9403-11bf-0000-0000-0000-0009.res6.spectrum.com)
00:06:52 <yuyua32> haskell is so elegant
00:06:55 <EvanR> and index 6 (4:6:7:8:[]) = 1 + index 6 (6:7:8:[]) = 1 + 0 = 1
00:07:07 <hpc> there's one possibility that's missing from your code though, unless i missed it
00:07:09 <snake> is it really?
00:07:41 <yuyua32> @hpc if the element isnt in the list?
00:07:41 <lambdabot> Maybe you meant: src rc pl ghc
00:07:45 <hpc> yep
00:08:05 <yuyua32> would that just be y `notElem xs =
00:08:08 <EvanR> if you squint, you can also see how your function will perform kind of bad on a long list
00:08:18 <hpc> try stepping through index '*' "abc" in your head
00:08:31 <EvanR> index 99 [0..99] = 1+1+1+1+...+0
00:08:34 <yuyua32> whats '*' ?
00:08:40 <hpc> just the character *
00:08:44 <hpc> > '*'
00:08:46 <lambdabot> '*'
00:08:46 <hpc> > 'a'
00:08:48 <lambdabot> 'a'
00:08:48 <yuyua32> ah right
00:09:06 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:158b:cfc1:e7b3:d4ac)
00:09:07 <snake> > '\x41'
00:09:08 <lambdabot> 'A'
00:09:15 <snake> sorry showing off
00:09:42 <yuyua32> hpc what do you mean stepping through * in abc?
00:10:07 × pfurla_ quits (~pfurla@177.79.126.48) (Read error: No route to host)
00:10:11 <hpc> just take the expression (index '*' "abc") and think through what it would calculate without actually putting it in your computer
00:10:13 <snake> yuyua32, he meant search for the index of * in the string "abc"
00:10:49 <hpc> it's a good exercise, and this is a perfect problem to try it out on
00:10:50 <snake> i think the function should throw an exception
00:11:05 <yuyua32> yeah
00:11:06 <EvanR> index '*' ('a':'b':'c':[])
00:11:10 <EvanR> =
00:11:11 <yuyua32> thats it
00:11:12 <EvanR> ?
00:11:14 <snake> it's an exceptional circumstance, the star isn't in the list
00:11:28 <yuyua32> so some error will be thrown
00:11:39 <snake> yup just crash when that happens
00:11:42 pfurla joins (~pfurla@185.81.136.21)
00:11:47 <yuyua32> I was thinking to fix that I could just do y `notElemen` xs
00:12:12 <EvanR> that's not the whole story
00:12:29 <snake> yup programmers will never use your function before checking if y is an element of the list so you can be sure it will never crash when used properly
00:12:37 <hpc> what error does it produce, and what line does it happen on?
00:13:03 <yuyua32> Non-exhaustive patterns in function index
00:13:19 <EvanR> if the list is very long or infinite, then sticking a containment test in front is kind of silly
00:13:28 <yuyua32> its not gonna be long
00:13:32 <EvanR> in the infinite case, it's just wrong
00:13:41 <yuyua32> im guessing it happends at 1 + index n xs
00:13:43 <yuyua32> when xs is empty
00:13:49 <yuyua32> so
00:13:54 <snake> maybe you can return a tuple (Bool, index)
00:13:56 <yuyua32> | index n [] = 0
00:14:01 <yuyua32> would that work?
00:14:11 <snake> idk
00:14:15 <snake> gonna shut up now
00:14:22 <EvanR> 0 sounds like a false positive
00:14:32 <yuyua32> shit true
00:14:35 <nosewings> Probably not, because then you wouldn't be able to tell the difference between an element at the front and one not in it at all
00:14:39 <nosewings> You could return -1
00:14:44 <yuyua32> got it
00:14:45 <hpc> depends on what you want index to return - maybe you decide that if (index n xs) > length xs, that means "not found"
00:14:49 <EvanR> -1, classic
00:14:55 <hpc> FILE_NOT_FOUND
00:14:56 <snake> yeah good ol -1
00:14:57 <nosewings> The "real" solution is to use Maybe
00:15:02 × kranius_ quits (~kranius@222.186.245.213.rev.sfr.net) (Ping timeout: 265 seconds)
00:15:03 <geekosaur> ^
00:15:09 <hpc> but yeah, Maybe is the way here
00:15:21 <snake> is Maybe like Some or std::optional ?
00:15:25 <hpc> yes
00:15:27 <hpc> @src Maybe
00:15:28 <lambdabot> data Maybe a = Nothing | Just a
00:15:35 <yuyua32> as in maybe its there maybe its not XD
00:15:43 <nosewings> Maybe is exactly std::optional
00:16:05 <nosewings> (or, rather, std::optional is Maybe)
00:16:21 machinedgod joins (~machinedg@24.105.81.50)
00:16:33 <hpc> your index function gets a bit uglier, when you recursively call index you don't get a simple number anymore
00:16:51 <yuyua32> im gonna be calling this index in another recursive function
00:16:58 <hpc> but maybe there are some other nice functions in scope that could make that easier
00:16:59 <yuyua32> so index is gonna be called multiple times til the end
00:17:37 <yuyua32> so I cant return -1
00:17:39 <geekosaur> had you given any thought to how that function deals with "not found"?
00:17:59 <EvanR> ah that's a great reason to not use -1
00:18:00 <hpc> geekosaur: that's what we're currently discussing :P
00:18:06 <yuyua32> ye
00:18:11 <glguy> is the answer "set errno"?
00:18:29 <EvanR> do whatever division by zero does
00:18:32 <EvanR> (don't do that)
00:18:37 jkaye joins (~jkaye@2601:281:8300:7530:e7c5:c36d:91ad:b90f)
00:18:38 <yuyua32> funnny
00:18:53 <yuyua32> i might just return the length of the list
00:19:04 <hpc> drop down to pointer manipulation, make the list how /you/ want it!
00:19:13 <hpc> mutate the immutable
00:19:16 <glguy> hpc: it adds the element to the end of the list
00:19:19 <hpc> maximum evil
00:19:24 <glguy> found it!
00:19:28 <EvanR> lol
00:19:35 <EvanR> very convenient
00:20:26 abhixec joins (~abhixec@c-67-169-139-16.hsd1.ca.comcast.net)
00:20:29 <hpc> this is how you end up with acme-php's "notElem x xs = elem (not x) xs"
00:20:33 <snake> glguy, lmao
00:20:40 <snake> oh man you guys are funny
00:21:06 <EvanR> use principle of most surprise
00:22:21 × madjestic quits (~madjestic@88-159-247-120.fixed.kpn.net) (Ping timeout: 250 seconds)
00:26:10 <yuyua32> this is just for testing
00:26:14 <yuyua32> but whats wrong this
00:26:16 <yuyua32> with*
00:26:17 <yuyua32> nsplit xs x
00:26:18 <yuyua32>   | x `notElem` xs = [length xs]
00:26:18 <yuyua32>   | otherwise = index xs x
00:26:25 <yuyua32> the last line
00:26:26 × emf quits (~emf@2603-6080-9403-11bf-0000-0000-0000-0009.res6.spectrum.com) (Quit: emf)
00:26:32 <yuyua32> giving me some sort of error
00:27:35 <hpc> what's the type of nsplit?
00:27:40 <geekosaur> try putting a type signature on the definition of nsplit
00:28:18 <yuyua32> list -> int -> int
00:28:22 <yuyua32> ohh
00:28:23 <yuyua32> I see
00:29:10 <snake> ooh i got it
00:29:22 × Tuplanolla quits (~Tuplanoll@91-159-68-169.elisa-laajakaista.fi) (Quit: Leaving.)
00:31:00 <yuyua32> i swear if I stay here any longer ill get too good and be employed by some haskell company
00:31:25 <snake> follow your dreams
00:31:45 <snake> not sure why you'd dream of writing haskell but you do you
00:32:24 <hpc> i mostly just dream of falling asleep
00:32:27 <hpc> recursion is dangerous, folks
00:32:36 <snake> hahaha
00:33:19 × __monty__ quits (~toonn@user/toonn) (Quit: leaving)
00:33:25 <monochrom> My dream is to retire from some haskell company!
00:33:34 × burnsidesLlama quits (~burnsides@dhcp168-019.wadham.ox.ac.uk) (Remote host closed the connection)
00:33:53 <EvanR> you have a problem with our company?
00:34:07 burnsidesLlama joins (~burnsides@client-8-91.eduroam.oxuni.org.uk)
00:34:25 <hpc> it sounds like he has a solution for our company
00:34:42 <monochrom> No, I just mean dreaming for enjoying retirement life and pension etc.
00:34:46 <hpc> :P
00:35:37 <monochrom> Aim high. Dream lazy. Don't just dream of employment. Dream of all the benefit after!
00:36:51 <hpc> it's an inspiring tale
00:37:04 <hpc> if you work very hard, someday you too might be able to life the good life in weak head normal form
00:37:24 <monochrom> haha
00:37:32 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
00:38:35 × burnsidesLlama quits (~burnsides@client-8-91.eduroam.oxuni.org.uk) (Ping timeout: 256 seconds)
00:39:37 pfurla_ joins (~pfurla@2804:18:5804:c94c:6161:1466:1870:aecb)
00:39:56 emf joins (~emf@2603-6080-9403-11bf-0000-0000-0000-0009.res6.spectrum.com)
00:40:53 × waleee quits (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4) (Ping timeout: 252 seconds)
00:41:10 euandreh joins (~euandreh@2804:14c:33:9fe5:297c:42b:53ca:ec88)
00:42:21 notzmv joins (~zmv@user/notzmv)
00:43:02 × pfurla quits (~pfurla@185.81.136.21) (Ping timeout: 240 seconds)
00:43:51 emf_ joins (~emf@2620:10d:c091:480::1:305b)
00:45:08 × emf quits (~emf@2603-6080-9403-11bf-0000-0000-0000-0009.res6.spectrum.com) (Ping timeout: 268 seconds)
00:46:01 <yuyua32> ive developed my function a bit more
00:46:02 <yuyua32> index (x:xs) n
00:46:03 <yuyua32>   | n == x = 0
00:46:03 <yuyua32>   | otherwise = 1 + index xs n
00:46:04 <yuyua32> -- nsplit [] _ = ([1],[2])
00:46:04 <yuyua32> nsplit xs x
00:46:05 <yuyua32>   | x `notElem` xs = 1
00:46:05 <yuyua32>   | otherwise = length (fst(splitAt (index xs x) xs)) :
00:46:27 <yuyua32> so basically it finds a certain character and splits everything before it and returns the length of before list
00:47:08 <yuyua32> but I want it to keep going to next n in the list if it exists and find the length i.e
00:47:31 <yuyua32>  [1,2,3,3,4,2,4,5] 0
00:47:44 justsomeguy joins (~justsomeg@user/justsomeguy)
00:47:55 <yuyua32>  [1,2,3,3,4,2,4,5] 2 would return [1,3,2]
00:48:54 <yuyua32> so how should I access the after of splitAt so I can recurse through it
00:48:56 <yuyua32> if that makes sense?
00:48:58 mvk joins (~mvk@2607:fea8:5cdd:f000::9788)
00:49:13 × megaTherion quits (~therion@unix.io) (Quit: ZNC 1.8.2 - https://znc.in)
00:49:13 <yuyua32> so snd splitAt?
00:49:38 <yuyua32> but that wouldnt work either
00:53:08 × dsrt^ quits (~dsrt@wsip-98-188-240-142.mc.at.cox.net) (Remote host closed the connection)
00:53:37 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
00:54:38 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
00:57:10 × acidjnk quits (~acidjnk@p200300d0c7271e736483cc3bf5018c54.dip0.t-ipconnect.de) (Ping timeout: 260 seconds)
00:58:55 × pretty_dumm_guy quits (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Quit: WeeChat 3.3)
00:59:00 <snake> yuyua32, i dont understand any of that possibly because im sleep deprived for a few weeks now, cicadian rhythm is out of whack but im ok. anyways do you want to see how i did it?
00:59:02 <snake> https://dpaste.com/H2V2P3M75
00:59:22 <EvanR> is this like, a computer class that you're both in
00:59:39 pretty_dumm_guy joins (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655)
00:59:41 <snake> no if this was a class i'd hate my life
00:59:48 × pretty_dumm_guy quits (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Client Quit)
00:59:56 <snake> how will i get to japan if i needed to get a good grade on this
01:00:44 Guest19 joins (~Guest19@n110-33-34-202.hum1.act.optusnet.com.au)
01:00:48 <yuyua32> I wrote it
01:00:57 <yuyua32> but its the ugliest code ive ever seen
01:01:08 <yuyua32> and has about 20 flaws
01:01:36 <yuyua32> EvanR its not a class just excersices to learn haskell
01:01:57 <snake> EvanR, did you see my commented out code? idk what was wrong with it but the compiler complaint
01:02:18 <snake> i probably jsut need to crack open one of those books, "learn you a haskell for great good" has nice pictures
01:03:26 <EvanR> if I don't feel like I understand some code, I go back and see if I can break it down into more functions, smaller functions that make sense in isolation
01:03:47 <snake> oop i forgot the pretty print function, it basically just did if isJust then print else print none
01:03:54 <EvanR> and then test those functions for sanity check
01:04:00 <snake> EvanR, ah
01:04:16 <EvanR> then I can start to put the pieces together into something more grandiose
01:06:10 × Jing quits (~hedgehog@2604:a840:3::10c8) (Remote host closed the connection)
01:06:30 × abhixec quits (~abhixec@c-67-169-139-16.hsd1.ca.comcast.net) (Ping timeout: 260 seconds)
01:06:45 Jing joins (~hedgehog@2604:a840:3::10c8)
01:06:46 <snake> yeah i've been a bit distracted from aoc2021 because im just wanting to understand haskell, it's so different
01:06:57 × yuyua32 quits (~yuyua32@wireless-student-pt3-247-143.lut.ac.uk) (Quit: Client closed)
01:06:58 <snake> i guess aoc2021 is more grandiose than i'm ready for
01:07:09 <snake> (at least in haskell)
01:07:23 <EvanR> as long as you can read a file you can do the first few AoCs
01:07:54 <EvanR> and if you can't, you paste in their example data in string literals
01:08:05 <EvanR> you can*
01:08:37 <EvanR> I heard some people paste the test data into their code somehow and skip reading a file
01:09:00 <snake> its just a lot, that's all, not just getting to the object of the problem, but instead ok, how does do differ from let while in etc
01:09:06 <snake> why is whitespace syntax etc
01:09:19 <snake> who's idea was this, etc
01:09:29 <snake> what is a monad
01:09:32 <EvanR> python made whitespace syntax normative, haskell's not weird anymore
01:09:38 <snake> haha yeah i suppose
01:10:24 <monochrom> If you ban "do" and use >>= directly, it is very clear why it is not "let" or "where".
01:10:36 <monochrom> Especially after respecting the type of >>=
01:10:44 <snake> what is >>=
01:11:07 <monochrom> As opposed to using "intuition" to ignore the exact type and handwave your way around.
01:11:07 <EvanR> the operator do syntax is sugar for
01:11:12 <snake> i was just dropping a bunch of haskell-babble i didnt think that line actually made sense
01:11:35 <snake> oh ok
01:11:41 <EvanR> [1,2,3] is sugar right, so is do syntax
01:11:44 <monochrom> geekosaur linked you to my tutorial so you should study it. Here it is again: http://www.vex.net/~trebla/haskell/IO.xhtml
01:11:49 <nosewings> "m1 >>= \x -> m2" is the same thing as "do x <- m1; m2"
01:12:12 <snake> ok thanks, not sure if i should start there or perhaps the learn you a haskell book
01:12:43 <monochrom> When I teach Haskell I teach >>=, no "do". It works great.
01:12:53 <EvanR> a gentle introduction is great, I don't care what anyone says https://www.haskell.org/tutorial/goodies.html
01:13:32 <EvanR> if it had modern css maybe people would not have forgotten about it
01:13:42 <monochrom> And this is not out of a one-sided bias. I once taught "do". Flopped. Students and TAs commented "yeah if you omit 'do' it's much better".
01:14:16 <monochrom> And yeah I learned from the Gentle Introduction too.
01:14:19 yuyua32 joins (~yuyua32@wireless-student-pt3-247-143.lut.ac.uk)
01:15:16 <yuyua32> EvanR how would you make this functio work on strings as well
01:15:18 <yuyua32> index (x:xs) n
01:15:19 <yuyua32>   | n == x = 0
01:15:19 <yuyua32>   | otherwise = 1 + index xs n
01:15:20 <yuyua32> -- nsplit [] _ = ([1],[2])
01:15:20 <yuyua32> nsplit xs x
01:15:21 <yuyua32>   | x `notElem` xs = [1]
01:15:21 <yuyua32>   | (length (fst (splitAt (index xs x) xs))) == 0 = nsplit (tail (snd(splitAt (index xs x) xs))) x
01:15:22 <yuyua32>   | otherwise = length (fst(splitAt (index xs x) xs)) : nsplit (tail (snd(splitAt (index xs x) xs))) x
01:15:24 <int-e> bind, hmm. You've got to learn the ropes (bind?) before getting your hands dirty with do-ing stuff with monads
01:15:34 <int-e> @where paste
01:15:34 <lambdabot> Help us help you: please paste full code, input and/or output at e.g. https://paste.tomsmeding.com
01:15:38 <EvanR> aaaaaaah use a paste site
01:15:46 <yuyua32> sorry will do
01:16:01 <yuyua32> https://paste.tomsmeding.com/wvb51sup
01:16:02 <yuyua32> here
01:16:07 <EvanR> strings are actually lists
01:16:11 <EvanR> so it should work?
01:16:22 <yuyua32> gives me this error
01:16:23 <yuyua32> 2:18: error: Variable not in scope: a :: Char
01:16:29 <int-e> I *do* like the syntactic sugar. But it's a bit too magical for beginners.
01:16:30 <snake> are String list or do you mean [Char]
01:16:39 <yuyua32> I mean "aabbaa" "a"
01:16:44 <EvanR> String = [Char]
01:16:49 <snake> oh
01:16:54 <yuyua32> sorry this was the error
01:16:55 <yuyua32> Couldn't match expected type ‘Char’ with actual type ‘[Char]’
01:17:06 <EvanR> 'c' is a char, "c" is a string
01:17:14 <EvanR> see if that is the problem
01:17:31 <yuyua32> that was it
01:17:36 × ChaiTRex quits (~ChaiTRex@user/chaitrex) (Quit: ChaiTRex)
01:17:36 <yuyua32> amazin
01:17:38 <yuyua32> thanks
01:18:07 <int-e> :t span
01:18:08 <lambdabot> (a -> Bool) -> [a] -> ([a], [a])
01:18:17 ChaiTRex joins (~ChaiTRex@user/chaitrex)
01:18:32 × euandreh quits (~euandreh@2804:14c:33:9fe5:297c:42b:53ca:ec88) (Ping timeout: 240 seconds)
01:18:50 <int-e> > span (/= ',') "abc,def,ghi"
01:18:51 <lambdabot> ("abc",",def,ghi")
01:19:40 × bjobjo quits (~bjobjo@user/bjobjo) (Ping timeout: 268 seconds)
01:20:18 × Jing quits (~hedgehog@2604:a840:3::10c8) (Remote host closed the connection)
01:20:50 × justsomeguy quits (~justsomeg@user/justsomeguy) (Quit: WeeChat 3.3)
01:20:56 Jing joins (~hedgehog@2604:a840:3::10c8)
01:23:39 × yuyua32 quits (~yuyua32@wireless-student-pt3-247-143.lut.ac.uk) (Quit: Client closed)
01:25:32 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
01:25:32 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
01:25:32 wroathe joins (~wroathe@user/wroathe)
01:25:34 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
01:26:30 × acidsys quits (~LSD@2.lsd.systems) (Excess Flood)
01:26:33 yuyua32 joins (~yuyua32@wireless-student-pt3-247-143.lut.ac.uk)
01:27:02 acidsys joins (~LSD@2.lsd.systems)
01:27:27 × machinedgod quits (~machinedg@24.105.81.50) (Ping timeout: 252 seconds)
01:29:37 <Cale> janus, monochrom, jackdk: my idea about using ST/some monad there is just to set something up where you can't refer to the linear thing directly at all, and all the linear things either turn into operations that secretly update a reference, or something which is implicitly carried around by the monad.
01:32:04 × Guest19 quits (~Guest19@n110-33-34-202.hum1.act.optusnet.com.au) (Quit: Client closed)
01:32:53 euandreh joins (~euandreh@2804:14c:33:9fe5:80ee:faa6:7302:e610)
01:33:38 × lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection)
01:38:05 × bontaq quits (~user@ool-45779fe5.dyn.optonline.net) (Ping timeout: 256 seconds)
01:50:28 × yuyua32 quits (~yuyua32@wireless-student-pt3-247-143.lut.ac.uk) (Quit: Client closed)
01:56:39 × lbseale quits (~ep1ctetus@user/ep1ctetus) (Quit: Leaving)
02:01:06 × [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Ping timeout: 260 seconds)
02:01:36 bitmapper joins (uid464869@id-464869.lymington.irccloud.com)
02:02:56 epolanski joins (uid312403@id-312403.helmsley.irccloud.com)
02:04:13 × img quits (~img@user/img) (Quit: ZNC 1.8.2 - https://znc.in)
02:04:16 lavaman joins (~lavaman@98.38.249.169)
02:04:50 × xff0x quits (~xff0x@2001:1a81:5283:7b00:fc6:4766:ca7:9337) (Ping timeout: 260 seconds)
02:05:01 [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470)
02:05:40 img joins (~img@user/img)
02:06:20 xff0x joins (~xff0x@2001:1a81:52c4:9100:e535:171:40b4:8c54)
02:07:20 × pfurla_ quits (~pfurla@2804:18:5804:c94c:6161:1466:1870:aecb) (Quit: gone to sleep. ZZZzzz…)
02:08:18 × nvmd quits (~nvmd@user/nvmd) (Quit: Later, nerds.)
02:09:36 TonyStone joins (~TonyStone@2603-7080-8607-c36a-9cdb-69bc-753b-1e50.res6.spectrum.com)
02:09:38 × Megant_ quits (megant@user/megant) (Ping timeout: 268 seconds)
02:10:49 Megant joins (megant@user/megant)
02:19:46 × neurocyte0132889 quits (~neurocyte@user/neurocyte) (Ping timeout: 260 seconds)
02:19:59 × mmhat quits (~mmh@55d46318.access.ecotel.net) (Ping timeout: 250 seconds)
02:20:59 × DNH quits (~DNH@2a02:8108:1100:16d8:f5a3:3a61:fbe9:f021) (Ping timeout: 252 seconds)
02:23:12 Guest64873 joins (~bot@172-220-180-248.res.spectrum.com)
02:24:37 × Guest64873 quits (~bot@172-220-180-248.res.spectrum.com) (Read error: Connection reset by peer)
02:26:32 <snake> "There are a few exceptions: a few things in the library perform lazy I/O. But I have not covered them, and I will not cover them. They are very hard to explain and understand correctly. They are also rarely used in practice, since they are hard to use correctly. You are not missing out. But their names are readFile, getContents, hGetContents, and interact."'
02:26:34 <snake> oop
02:26:58 <snake> thanks dr. monochrom that was a good read
02:27:08 <snake> i think i understand IO a little more now
02:27:12 <nosewings> There's nothing wrong with getContents for toy projects and experiments, imo
02:28:14 SummerSonw joins (~The_viole@203.77.49.232)
02:29:09 <snake> someone mentioned readFile earlier it looked ez
02:30:06 <snake> % readFile "/etc/passwd"
02:30:07 <yahb> snake: *** Exception: /etc/passwd: openFile: does not exist (No such file or directory)
02:30:42 × TonyStone quits (~TonyStone@2603-7080-8607-c36a-9cdb-69bc-753b-1e50.res6.spectrum.com) (Quit: Leaving)
02:31:02 <snake> % readFile "/etc/fstab"
02:31:02 <yahb> snake: *** Exception: /etc/fstab: openFile: does not exist (No such file or directory)
02:31:57 abhixec joins (~abhixec@c-67-169-139-16.hsd1.ca.comcast.net)
02:33:56 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
02:34:32 <snake> is withFile preferable?
02:34:47 ubert1 joins (~Thunderbi@p200300ecdf1abb0650b4610a52e3eab2.dip0.t-ipconnect.de)
02:35:02 × ubert quits (~Thunderbi@p200300ecdf1abbee60b6487a781d8af1.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
02:35:02 ubert1 is now known as ubert
02:35:50 TonyStone joins (~TonyStone@2603-7080-8607-c36a-9cdb-69bc-753b-1e50.res6.spectrum.com)
02:35:51 <snake> oh no that uses hHetContents
02:36:42 aliosablack joins (~chomwitt@94.66.63.187)
02:38:14 <EvanR> so * has precedence 7 and + has precedence 6. So there's no way to make an operator between them xD
02:38:23 × TonyStone quits (~TonyStone@2603-7080-8607-c36a-9cdb-69bc-753b-1e50.res6.spectrum.com) (Remote host closed the connection)
02:38:37 × chomwitt quits (~chomwitt@2a02:587:dc0d:3700:12c3:7bff:fe6d:d374) (Ping timeout: 250 seconds)
02:38:50 TonyStone joins (~TonyStone@2603-7080-8607-c36a-9cdb-69bc-753b-1e50.res6.spectrum.com)
02:39:58 <snake> let 7 = 8
02:40:03 <snake> BOOM
02:40:06 <snake> saved your life
02:40:53 <EvanR> > let 7 = 8 in 7
02:40:54 <lambdabot> 7
02:40:59 <EvanR> didn't work
02:41:19 <EvanR> equational reasoning is a lie
02:41:29 <oats> https://github.com/oatberry/aoc2021-haskell/blob/main/src/Day9.hs
02:41:33 <oats> I've fallen into doing AoC in spurts
02:41:46 <oats> I'm ok with this 😊
02:45:56 <oats> I got to explore indexed optics, that was fun
02:48:17 <oats> EvanR, oh, and Optics By Example uses good ol' lens
02:48:23 <EvanR> i see
02:49:12 yuyua32 joins (~yuyua32@wireless-student-pt3-247-143.lut.ac.uk)
02:49:31 <yuyua32> throughOut :: Int -> Int -> String
02:49:32 <yuyua32> throughOut n 0 = ""
02:49:33 <yuyua32> with this function
02:49:39 <yuyua32> how would you add an if statement like
02:49:47 <yuyua32> | m == 0 = ""
02:49:53 <yuyua32> but without guards? is that possible
02:50:15 <snake> oats, nice i can read about 20% of that code, looks good tho
02:50:25 <snake> (guesstimating)
02:50:40 <oats> uh, is that an indictment of my code or of you lol
02:50:55 × yuyua32 quits (~yuyua32@wireless-student-pt3-247-143.lut.ac.uk) (Client Quit)
02:51:02 <EvanR> yuyua32, there's no if statement, but there's an if expression of the form
02:51:07 <EvanR> if _ then _ else _
02:51:12 <oats> they gone
02:51:18 <EvanR> blast
02:51:38 <snake> oats, im a newbie
02:51:43 <oats> oh haha
02:51:58 <oats> if you have any specific questions I'd love to try and answer them :P
02:52:28 <snake> how did you get printf
02:52:37 × nosewings quits (~ngpc@2603-8081-3e05-e2d0-f324-1a41-5d30-c2c5.res6.spectrum.com) (Remote host closed the connection)
02:52:38 <oats> hmm?
02:52:49 <snake> https://github.com/oatberry/aoc2021-haskell/blob/main/src/Common.hs#L70
02:53:06 <oats> snake, line 25
02:53:06 <snake> oh its imported
02:55:05 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 252 seconds)
02:57:19 <dsal> oats: what's this sum/map stuff? sumOf folded to succ
02:58:04 <oats> which line?
02:58:14 <dsal> part1
02:58:28 <dsal> If you're going to use lens, obscure harder!
02:58:55 <oats> hmm yes may as well
02:59:05 <oats> :P
02:59:10 <dsal> Oh, there's a _2 in there. I'm on a phone
03:00:05 <snake> oats, is the C.readFile the best way to read a file, i heard that readFile is rarely used
03:00:16 <snake> and getCOntents etc
03:00:49 × TonyStone quits (~TonyStone@2603-7080-8607-c36a-9cdb-69bc-753b-1e50.res6.spectrum.com) (Quit: Leaving)
03:00:55 <oats> I used readFile because it was easy ¯\_(ツ)_/¯
03:00:59 <dsal> > sumOf (folded . _2 . to succ) [('a', 3), ('b', 4)]
03:01:01 <oats> there may be good reasons to use something else
03:01:01 <lambdabot> 9
03:01:07 <dsal> Wow, first try
03:01:15 <oats> TIL of `to`
03:02:09 <dsal> It makes it easy for your code to succ
03:02:17 <oats> I was just giggling about "to succ"
03:02:27 × xff0x quits (~xff0x@2001:1a81:52c4:9100:e535:171:40b4:8c54) (Ping timeout: 250 seconds)
03:04:32 xff0x joins (~xff0x@2001:1a81:52ce:1300:ffd2:54e0:463d:d772)
03:04:56 TonyStone joins (~TonyStone@2603-7080-8607-c36a-9cdb-69bc-753b-1e50.res6.spectrum.com)
03:05:29 sleblanc joins (~sleblanc@user/sleblanc)
03:08:11 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds)
03:10:02 × xkuru quits (~xkuru@user/xkuru) (Read error: Connection reset by peer)
03:10:54 <EvanR> I used readFile for each day so far
03:10:56 <EvanR> works
03:11:04 bollu joins (uid233390@id-233390.helmsley.irccloud.com)
03:12:45 × nunggu quits (~q@gateway/tor-sasl/nunggu) (Ping timeout: 276 seconds)
03:13:30 <sleblanc> EvanR, aoc?
03:13:37 <EvanR> yeah
03:13:53 <sleblanc> have you heard of the Big Boy™ inputs?
03:13:57 <EvanR> yeah
03:14:06 <EvanR> I made a few myself for stress testing
03:14:31 <sleblanc> ok
03:14:38 <sleblanc> i'm way behind
03:14:45 <sleblanc> still on day4
03:15:04 <EvanR> oof
03:15:13 <EvanR> well, I'm still on day 2 in any previous year
03:15:35 <sleblanc> I don't think those count
03:15:42 <EvanR> lol
03:15:49 <sleblanc> I did a bunch in the previous years
03:16:39 <sleblanc> 2020 from 1 to 9
03:16:48 <sleblanc> oh, actually 1-14
03:17:34 <sleblanc> it really made me learn about monadic parsers
03:18:48 <sleblanc> can we define data constructors in lambdabot?
03:19:23 <EvanR> so far I only used a basic split function lol
03:19:36 <sleblanc> > data Direction = Forward | Up | Down
03:19:38 <lambdabot> <hint>:1:1: error: parse error on input ‘data’
03:19:55 <EvanR> @let data Direction = Forward | Up | Down deriving Show
03:19:56 <lambdabot> Defined.
03:20:02 <sleblanc> o
03:20:03 <EvanR> :t Up
03:20:05 <lambdabot> Direction
03:20:41 <sleblanc> @let data Move = Move Direction Int
03:20:42 <lambdabot> Defined.
03:20:55 <sleblanc> @let instance Default Move where def = Forward
03:20:56 <lambdabot> .L.hs:166:10: error:
03:20:56 <lambdabot> Not in scope: type constructor or class ‘Default’
03:20:56 <lambdabot> |
03:21:07 <sleblanc> @let import Data.Default (Default)
03:21:08 <lambdabot> Defined.
03:21:11 <sleblanc> @let instance Default Move where def = Forward
03:21:12 <EvanR> Default...
03:21:12 <lambdabot> .L.hs:168:9: error:
03:21:12 <lambdabot> ‘def’ is not a (visible) method of class ‘Default’
03:21:12 <lambdabot> |
03:21:23 <sleblanc> @let import Data.Default (Default(def))
03:21:24 <lambdabot> Defined.
03:21:26 <sleblanc> @let instance Default Move where def = Forward
03:21:27 <lambdabot> .L.hs:169:15: error:
03:21:27 <lambdabot> • Couldn't match expected type ‘Move’ with actual type ‘Direction’
03:21:27 <lambdabot> • In the expression: Forward
03:21:40 <sleblanc> @let instance Default Direction where def = Forward
03:21:41 <lambdabot> Defined.
03:21:42 <EvanR> the thrust to weight ratio of Default is not great
03:21:54 <sleblanc> :t (Move <$>)
03:21:55 <lambdabot> error:
03:21:55 <lambdabot> Data constructor not in scope: Move :: a -> b
03:22:00 <oats> sleblanc, if you do much more we're gonna ask you to spin up your own ghci repl :)
03:22:28 <sleblanc> Sorry about the noise, I'm trying to set it up for something that I found interesting
03:22:33 <pragma-> you can /msg it.
03:22:36 <sleblanc> ohhh
03:23:59 <sleblanc> is it sharing the same environment when I privmsg lambdabot? I can't find the definitions I just created
03:25:29 × td__ quits (~td@muedsl-82-207-238-255.citykom.de) (Ping timeout: 268 seconds)
03:26:11 <EvanR> maybe someone undefined everything out of spite
03:26:17 <sleblanc> I wrote ":t (Move <$>)" in my GHCi and it said "f Direction -> f (Integer -> Move)" as I expected, but then I typed ":t flip (Move <$>)" and I don't understand the type signature
03:26:47 td_ joins (~td@94.134.91.159)
03:26:47 <sleblanc> flip (Move <$>) :: b -> (b -> Direction) -> Integer -> Move
03:26:47 <EvanR> :t (Identity <*>)
03:26:48 <lambdabot> error:
03:26:48 <lambdabot> Data constructor not in scope: Identity :: f (a -> b)
03:26:52 <sleblanc> the Functor has disappeared
03:26:59 × mvk quits (~mvk@2607:fea8:5cdd:f000::9788) (Ping timeout: 252 seconds)
03:26:59 × jkaye quits (~jkaye@2601:281:8300:7530:e7c5:c36d:91ad:b90f) (Ping timeout: 252 seconds)
03:27:05 <EvanR> :t (Identity <$>)
03:27:06 <lambdabot> error:
03:27:06 <lambdabot> Data constructor not in scope: Identity :: a -> b
03:27:27 <EvanR> suffering from a lack of Identity
03:27:57 <sleblanc> identity theft
03:36:24 <monochrom> identity theft: fmap id = id
03:37:13 <monochrom> I guess that's fmap theft.
03:38:02 <monochrom> identity theft take 2: s <> mempty = s. s stole the identity!
03:38:27 <dsal> On HDK, Identity steals you.
03:38:35 <monochrom> haha
03:38:38 <dsal> Damnit, I spelled HKD wrong
03:39:05 <dsal> And in. My phone should know what dumb thing I was trying to say.
03:40:11 <dsal> sleblanc: Data.Default is quite out of fashion
03:40:49 <byorgey> sleblanc: since flip expects a two-argument function, the only way to make f Direction -> f (Integer -> Move) into a 2-argument function is to instantiate f to (b ->)
03:41:03 <dsal> Closest I get in code is mempty
03:41:51 <byorgey> f Direction -> f (Integer -> Move) becomes (b -> Direction) -> b -> Integer -> Move
03:42:19 × Jing quits (~hedgehog@2604:a840:3::10c8) (Remote host closed the connection)
03:43:09 Jing joins (~hedgehog@2604:a840:3::10c8)
03:43:46 mikoto-chan joins (~mikoto-ch@esm-84-240-99-143.netplaza.fi)
03:44:37 <dsal> I wonder if Move could be a monoid. You'd need to model it as a more general transformation, I'd think.
03:57:35 <EvanR> Integer -> Integer monoid
04:00:15 <dsal> Yeah, but in two dimensions.
04:00:28 <dsal> I really liked the paper folding thing.
04:00:49 <dsal> :t foldl1 (.) . reverse
04:00:50 <lambdabot> [a -> a] -> a -> a
04:05:38 <EvanR> product of two monoids monoid
04:06:53 <sleblanc> Thanks byorgey, it makes a lot of sense
04:07:05 <int-e> @let import qualified Data.Default
04:07:06 <lambdabot> Defined.
04:07:08 <int-e> meh
04:07:11 <int-e> @undef
04:07:11 <lambdabot> Undefined.
04:09:45 × lambdabot quits (~lambdabot@haskell/bot/lambdabot) (Remote host closed the connection)
04:11:38 lambdabot joins (~lambdabot@haskell/bot/lambdabot)
04:11:39 × lambdabot quits (~lambdabot@haskell/bot/lambdabot) (Remote host closed the connection)
04:11:46 <int-e> oops, that was terrible timing.
04:11:54 lambdabot joins (~lambdabot@silicon.int-e.eu)
04:11:54 × lambdabot quits (~lambdabot@silicon.int-e.eu) (Changing host)
04:11:54 lambdabot joins (~lambdabot@haskell/bot/lambdabot)
04:13:34 <int-e> @let import Data.Default
04:13:34 <lambdabot> .L.hs:85:1: error:
04:13:34 <lambdabot> Could not find module ‘Data.Default’
04:13:35 <lambdabot> Use -v (or `:set -v` in ghci) to see a list of the files searched for.
04:13:58 <int-e> Okay. Better; before this, the @let would work but > would then fail.
04:15:22 <int-e> (because these were done in two different package environments)
04:21:12 pavonia joins (~user@user/siracusa)
04:24:38 <int-e> if you're curious what exactly lambdabot has and what not, https://silicon.int-e.eu/lambdabot/State/packages.txt should be accurate
04:26:05 × [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Read error: Connection reset by peer)
04:27:27 <int-e> And I can add packages. I'm just not eager to :-P But the situation is nicer than the previous "whatever lambdabot happens to depend on plus a couple others" which looked like https://silicon.int-e.eu/lambdabot/tmp/packages-host.txt
04:28:39 <int-e> (don't ask me why stuff like wai is in there... maybe hoogle drags that in?)
04:29:37 <int-e> *checks* yeah it does
04:30:55 × bliminse quits (~bliminse@host86-162-147-196.range86-162.btcentralplus.com) (Ping timeout: 256 seconds)
04:32:23 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Ping timeout: 250 seconds)
04:32:25 × darkstarx quits (~darkstard@50.39.115.145) (Read error: Connection reset by peer)
04:32:46 bliminse joins (~bliminse@host86-186-4-210.range86-186.btcentralplus.com)
04:33:25 geekosaur joins (~geekosaur@xmonad/geekosaur)
04:37:18 darkstardevx joins (~darkstard@50.39.115.145)
04:38:33 × darkstardevx quits (~darkstard@50.39.115.145) (Remote host closed the connection)
04:38:57 darkstardevx joins (~darkstard@50.39.115.145)
04:43:22 × darkstardevx quits (~darkstard@50.39.115.145) (Read error: Connection reset by peer)
04:47:11 <Axman6> We don;t have some sort of efficient type for an array of Maybe's right? I'm surrently using a smallarray of Maybe but it would be nice if we had a maybeArray which had a bit vector of positions which contained values
04:48:55 <Axman6> really what I want is an array of.... promises or something? I'm going to write to each position exactly once
04:49:47 <EvanR> an array of IVars heh
04:49:59 <EvanR> or, the array of reading a bunch of IVars
04:51:22 × bitmapper quits (uid464869@id-464869.lymington.irccloud.com) (Quit: Connection closed for inactivity)
04:52:58 dyeplexer joins (~dyeplexer@user/dyeplexer)
04:56:11 <int-e> EvanR: maybe an array of thunks works? (aka knot-tying)
04:57:42 <energizer> is there a name for a type that's like an enum but open to extension?
04:57:44 <EvanR> yeah
04:57:53 <EvanR> (int-e)
04:58:01 <EvanR> energizer, extensible variant?
04:58:48 <EvanR> I have a paper on it around here somewhere, explaining how polymorphism works
04:59:18 <energizer> EvanR: papers please
04:59:24 <int-e> ... cue half an hour of deafening silence
04:59:30 <EvanR> yeah, AoC
05:01:28 <Axman6> int-e: it would if I didn't need to fill the contents of the array in a PrimMonad
05:04:42 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
05:11:58 × mstksg quits (~jle`@cpe-23-240-75-236.socal.res.rr.com) (Quit: WeeChat 3.3)
05:12:10 jle` joins (~jle`@cpe-23-240-75-236.socal.res.rr.com)
05:12:29 <EvanR> energizer, https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/scopedlabels.pdf this paper has a section on extensible variants
05:12:44 <energizer> thanks EvanR
05:22:43 × epolanski quits (uid312403@id-312403.helmsley.irccloud.com) (Quit: Connection closed for inactivity)
05:22:46 darkstardevx joins (~darkstard@50.39.115.145)
05:23:36 × darkstardevx quits (~darkstard@50.39.115.145) (Remote host closed the connection)
05:24:01 darkstardevx joins (~darkstard@50.39.115.145)
05:24:44 jz99 joins (~jz99@150.203.2.53)
05:27:01 × deadmarshal quits (~deadmarsh@95.38.230.166) (Ping timeout: 256 seconds)
05:29:14 × zebrag quits (~chris@user/zebrag) (Quit: Konversation terminated!)
05:29:29 deadmarshal joins (~deadmarsh@95.38.231.95)
05:33:05 mbuf joins (~Shakthi@122.178.199.206)
05:33:16 × darkstardevx quits (~darkstard@50.39.115.145) (Remote host closed the connection)
05:33:33 × curiousgay quits (~curiousga@77-120-141-90.kha.volia.net) (Ping timeout: 265 seconds)
05:34:05 × Jing quits (~hedgehog@2604:a840:3::10c8) (Remote host closed the connection)
05:34:43 Jing joins (~hedgehog@2604:a840:3::10c8)
05:38:55 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds)
05:40:42 × bollu quits (uid233390@id-233390.helmsley.irccloud.com) (Quit: Connection closed for inactivity)
05:46:58 <dsal> This is another "Gets the right answer for the sample but wrong answer for my own input" problem.
05:47:02 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Remote host closed the connection)
05:47:47 geekosaur joins (~geekosaur@xmonad/geekosaur)
05:49:13 <int-e> dsal: me too
05:53:46 × earendel quits (uid498179@user/earendel) (Quit: Connection closed for inactivity)
05:54:22 kayvank joins (~user@52-119-115-185.PUBLIC.monkeybrains.net)
05:54:32 × kayvank quits (~user@52-119-115-185.PUBLIC.monkeybrains.net) (Remote host closed the connection)
05:56:00 <int-e> dsal: But it's by design, so I expect that *all* the inputs have that property so it's fair.
05:57:55 altern joins (~Sergii@altern.corbina.com.ua)
06:02:52 × mikoto-chan quits (~mikoto-ch@esm-84-240-99-143.netplaza.fi) (Quit: mikoto-chan)
06:04:24 × jonathanx_ quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Remote host closed the connection)
06:04:43 jonathanx_ joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
06:07:55 × johnjay quits (~pi@154.6.152.74) (Ping timeout: 250 seconds)
06:08:50 × Erutuon quits (~Erutuon@user/erutuon) (Quit: WeeChat 2.8)
06:20:48 johnjay joins (~pi@154.6.152.74)
06:23:30 dsrt^ joins (~dsrt@wsip-98-188-240-142.mc.at.cox.net)
06:23:53 × slowButPresent quits (~slowButPr@user/slowbutpresent) (Quit: leaving)
06:24:03 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Remote host closed the connection)
06:24:22 geekosaur joins (~geekosaur@xmonad/geekosaur)
06:29:04 <int-e> > unwords $ map (\x -> printf "%.2f" (195-x/30)) [5759,5744,5688,5606,5580,5527,5481,5458,5419,5407] -- the missing star is counted as rank 195
06:29:06 <lambdabot> "3.03 3.53 5.40 8.13 9.00 10.77 12.30 13.07 14.37 14.77"
06:29:08 darkstardevx joins (~darkstard@50.39.115.145)
06:29:55 × darkstardevx quits (~darkstard@50.39.115.145) (Remote host closed the connection)
06:30:19 darkstardevx joins (~darkstard@50.39.115.145)
06:30:33 <EvanR> this is why I never test the example
06:30:41 <EvanR> just kidding
06:32:27 takuan joins (~takuan@178-116-218-225.access.telenet.be)
06:37:10 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:158b:cfc1:e7b3:d4ac) (Remote host closed the connection)
06:44:58 <EvanR> what's the significance of 3.03, 14.77 etc
06:45:57 <int-e> it's average ranks so far on glguy's list
06:46:24 <EvanR> 195 is people on the list, what's 30
06:46:51 <int-e> number of parts so far. (also the 195 is number of people plus 1)
06:47:16 <int-e> (because with 194 people, rank 1 gives 195 points)
06:47:21 <int-e> err
06:47:27 <int-e> 194 points, ugh
06:47:30 <g> I should probably prune again, but doing so can mess with standings
06:47:46 <g> So... I've been putting it off
06:47:48 <EvanR> lol g
06:47:55 <c_wraith> did you optimize your username for coding speed?
06:48:04 <int-e> pruning the people with no stars won't affect the order
06:48:16 <int-e> it'll just make the numbers smaller
06:48:30 <g> Oh, good point
06:48:48 × zaquest quits (~notzaques@5.130.79.72) (Remote host closed the connection)
06:48:50 <g> Removes the same number of points from everyone
06:50:07 zaquest joins (~notzaques@5.130.79.72)
06:50:54 <int-e> but it can affect old leaderboards where those people may have participated, if you care about that
06:51:17 × glebg quits (~user@85-192-130-19.dsl.esoo.ru) (Quit: ERC (IRC client for Emacs 27.2))
06:51:32 Erutuon joins (~Erutuon@user/erutuon)
06:51:57 <g> Last time I pruned I only took people off who hadn't participated in a couple years
06:52:13 <g> I forget how far back I looked but maybe 3 years
06:55:25 <g> c_wraith: yeah, I need every advantage I can get. I'm getting old
06:55:35 <c_wraith> fancy tricks!
06:56:10 EvanR is now known as e
06:56:11 e is now known as Guest4358
06:56:18 <Guest4358> :sunglasses:
06:56:22 <Guest4358> drat
06:56:28 Guest4358 is now known as EvanR
06:56:39 <c_wraith> someone else got there before you
06:57:16 <g> He was the first one on the network
06:58:04 <glguy> so that would be a hard race to win :3
07:01:13 bjobjo joins (~bjobjo@user/bjobjo)
07:01:22 <EvanR> I bet no one has registered empty string yet
07:03:01 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:158b:cfc1:e7b3:d4ac)
07:06:02 × notzmv quits (~zmv@user/notzmv) (Ping timeout: 240 seconds)
07:10:01 <int-e> glguy: Oh wait, what I said isn't quite true: for people who don't have all stars, removing people without stars makes things easier.
07:11:20 <glguy> well, if we get a few more to join I'll clean 10 off
07:12:04 <int-e> is there a size limit for private lists?
07:12:10 <glguy> 200
07:12:28 <int-e> I see. Yeah we're close to that.
07:15:31 chele joins (~chele@user/chele)
07:16:06 × dyeplexer quits (~dyeplexer@user/dyeplexer) (Ping timeout: 260 seconds)
07:17:29 whatif joins (~whatif@2400:8902::f03c:92ff:fe60:98d8)
07:18:32 topbloke joins (~textual@27-33-31-40.tpgi.com.au)
07:18:53 × topbloke quits (~textual@27-33-31-40.tpgi.com.au) (Client Quit)
07:19:29 michalz joins (~michalz@185.246.204.121)
07:20:21 × deadmarshal quits (~deadmarsh@95.38.231.95) (Ping timeout: 256 seconds)
07:23:57 deadmarshal joins (~deadmarsh@95.38.231.95)
07:27:12 topbloke joins (~textual@27-33-31-40.tpgi.com.au)
07:28:04 <int-e> Of course if you really want to you can do a far more detailed analysis of the JSON file: https://int-e.eu/~bf3/tmp/aoc_haskell.txt
07:28:34 <xerox> 11 :(
07:28:44 fr33domlover joins (~fr33@2.55.142.29)
07:29:53 × darkstardevx quits (~darkstard@50.39.115.145) (Read error: Connection reset by peer)
07:31:02 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
07:35:07 darkstardevx joins (~darkstard@50.39.115.145)
07:35:20 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
07:35:59 × darkstardevx quits (~darkstard@50.39.115.145) (Remote host closed the connection)
07:36:46 darkstardevx joins (~darkstard@50.39.115.145)
07:38:09 <g> Is there existing work for ranking something like this in a sensible way?
07:41:10 Bob_Esponja joins (~Bob_Espon@240.red-176-83-54.dynamicip.rima-tde.net)
07:41:30 pfurla joins (~pfurla@2804:18:5804:c94c:6161:1466:1870:aecb)
07:41:35 × darkstardevx quits (~darkstard@50.39.115.145) (Read error: Connection reset by peer)
07:41:52 × topbloke quits (~textual@27-33-31-40.tpgi.com.au) (Quit: Textual IRC Client: www.textualapp.com)
07:42:34 Gurkenglas joins (~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de)
07:45:36 × Bob_Esponja quits (~Bob_Espon@240.red-176-83-54.dynamicip.rima-tde.net) (Read error: Connection reset by peer)
07:48:07 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Ping timeout: 256 seconds)
07:48:15 × dfg quits (~dfg@user/dfg) (Ping timeout: 250 seconds)
07:48:31 dfg joins (dfg@2600:3c00::f03c:92ff:feb4:be75)
07:48:31 × dfg quits (dfg@2600:3c00::f03c:92ff:feb4:be75) (Changing host)
07:48:31 dfg joins (dfg@user/dfg)
07:48:41 × Clint quits (~Clint@user/clint) (Ping timeout: 250 seconds)
07:49:50 Bob_Esponja joins (~Bob_Espon@240.red-176-83-54.dynamicip.rima-tde.net)
07:50:28 Clint joins (~Clint@user/clint)
07:52:04 × Bob_Esponja quits (~Bob_Espon@240.red-176-83-54.dynamicip.rima-tde.net) (Read error: Connection reset by peer)
07:52:50 Bob_Esponja joins (~Bob_Espon@240.red-176-83-54.dynamicip.rima-tde.net)
07:53:36 × Bob_Esponja quits (~Bob_Espon@240.red-176-83-54.dynamicip.rima-tde.net) (Read error: Connection reset by peer)
07:56:11 geekosaur joins (~geekosaur@xmonad/geekosaur)
07:56:26 × Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer)
08:00:30 Bob_Esponja joins (~Bob_Espon@240.red-176-83-54.dynamicip.rima-tde.net)
08:04:16 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
08:04:52 chele_ joins (~chele@user/chele)
08:05:02 × xsperry quits (~xs@user/xsperry) (Ping timeout: 240 seconds)
08:05:07 × chele quits (~chele@user/chele) (Ping timeout: 256 seconds)
08:05:28 lortabac joins (~lortabac@2a01:e0a:541:b8f0:1b1:ff3c:2e88:391a)
08:05:54 × hololeap_ quits (~hololeap@user/hololeap) (Ping timeout: 276 seconds)
08:06:06 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:158b:cfc1:e7b3:d4ac) (Remote host closed the connection)
08:06:07 × Bob_Esponja quits (~Bob_Espon@240.red-176-83-54.dynamicip.rima-tde.net) (Read error: Connection reset by peer)
08:06:20 hololeap_ joins (~hololeap@user/hololeap)
08:06:30 × altern quits (~Sergii@altern.corbina.com.ua) (Ping timeout: 260 seconds)
08:06:50 gehmehgeh joins (~user@user/gehmehgeh)
08:09:34 enyc joins (~enyc@user/enyc)
08:09:40 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
08:16:35 chele_ is now known as chele
08:17:43 <int-e> c_wraith: final octopodes update: https://gist.github.com/int-e/27962eb9a9d1980cc5b4ba8baad59a42#file-flash-cc-L22-L44
08:18:19 <c_wraith> those are both quite large numbers
08:18:38 <int-e> imagine going for 66 steps and then entering a 2 million step cycle
08:19:38 <int-e> I find the length of those cycles mind-boggling even if they're rare (average cycle length is about 72.3 for the 53.9% of configurations that do not synchronize)
08:20:29 <int-e> c_wraith: I didn't track how many configurations I tested; I think it's about 20 billion.
08:22:05 bahamas joins (~lucian@86.120.77.115)
08:22:25 × abhixec quits (~abhixec@c-67-169-139-16.hsd1.ca.comcast.net) (Remote host closed the connection)
08:22:33 <bahamas> hello! how do I convert a string/text that represents a number into the corresponding number?
08:22:50 <c_wraith> > read "123" :: Int
08:22:52 <lambdabot> 123
08:23:02 <c_wraith> assuming that's what you mean by "represents"
08:23:44 <bahamas> c_wraith: that's what I mean. is there a different meaning (just curious)?
08:24:16 <c_wraith> sure. Maybe you mean the english phrase corresponding to a number, such that f "twenty-three" = 23
08:24:28 <c_wraith> Or any number of other representations :)
08:24:36 <bahamas> c_wraith: ah, I see :)
08:25:59 <int-e> c_wraith: The strange thing is... I'd expect the trails towards a cycle to be about half as long as the cycle for a random function. So this... feels decicively non-random.
08:27:08 <c_wraith> well, the problem had a lot of structure. I'd agree it's non-random. :)
08:28:27 <int-e> but then how can there be long cycles at all? it's a mystery :)
08:28:38 <dminuoso> bahamas: You should really use `readMaybe` though.
08:28:49 <dminuoso> `read` is one of those things I wish we didn't have.
08:29:18 <dminuoso> It must be the number #1 source of bottoms causing crashes and misbehaviors, usually even from some transitive dependency..
08:29:23 <bahamas> dminuoso: yeah. I was about to ask how I handle the exception
08:29:39 <int-e> c_wraith: this is the kind of thing that one can /easily/ put a thesis' equivalent of work into without getting any benefit at all :)
08:30:24 <c_wraith> Ok, but what function do you use when you've already validated the characters are numeric and don't want to do a lot of Maybe wrapping and unwrapping?
08:30:42 <c_wraith> That's the majority of cases I use read
08:31:48 Bob_Esponja joins (~Bob_Espon@240.red-176-83-54.dynamicip.rima-tde.net)
08:32:48 <c_wraith> wow, my part 2 today is shockingly slow. Is PSQueue doing some sort of O(n) crap?
08:33:12 <kritzefitz> I guess that is a valid use case for `read`. But I am a bit surprised. I usually use `readMaybe` to determine if something is numeric in the first place. Why bother checking beforehand if you're gonna need the result of `read` anyway?
08:33:27 <kritzefitz> *need the result of "readMaybe" anway
08:33:34 cfricke joins (~cfricke@user/cfricke)
08:34:03 machinedgod joins (~machinedg@24.105.81.50)
08:34:04 × Bob_Esponja quits (~Bob_Espon@240.red-176-83-54.dynamicip.rima-tde.net) (Read error: Connection reset by peer)
08:34:05 <c_wraith> because I write a lot of parsers where it's really easy to say read <$> some (satisfy isDigit)
08:34:10 <int-e> c_wraith: I did wonder about that, but I guess 500x500 is not exactly small
08:35:03 <kritzefitz> Makes sense. I guess I don't write parsers that often.
08:35:05 max22- joins (~maxime@2a01cb08833598009a038ff51315adf9.ipv6.abo.wanadoo.fr)
08:36:21 × ph88 quits (~ph88@2a02:8109:9e00:71d0:943d:5b05:e9f7:79b5) (Ping timeout: 250 seconds)
08:36:26 <int-e> c_wraith: that said, I didn't use psqueue (maybe I should try...) so I can't really answer that question.
08:37:40 <c_wraith> I'm seeing 4 seconds on my system. That's shockingly slow for only a quarter of a million nodes with at most 4 edges from them
08:37:53 × jz99 quits (~jz99@150.203.2.53) (Ping timeout: 256 seconds)
08:38:39 <int-e> do you track visited nodes in a Data.Set or differently?
08:38:57 <c_wraith> in the keys of a separate Data.Map
08:39:07 <c_wraith> so basically the same
08:40:09 <c_wraith> ok, it's not doing anything O(n), at least.
08:40:18 <c_wraith> I just have high constant factors around here.
08:43:24 <c_wraith> ugh. less than 50% productivity. that'd be the problem.
08:45:27 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
08:50:03 <int-e> Hmm. So psqueue performs worse for me than the S.Set (p, k) that I used as an alternative.
08:51:15 <int-e> Unless I'm missing a better alternative to P.insertWith min k p psq to insert or update the priority of a key.
08:52:43 jgeerds joins (~jgeerds@55d4ac73.access.ecotel.net)
08:54:26 <int-e> (not *much* slower; PSQueue is at 2.3 seconds; Set is at 1.5)
08:54:30 coot joins (~coot@89-64-85-93.dynamic.chello.pl)
08:57:11 <c_wraith> Oh, mine is somewhat slower because I'm doing a lot more work than necessary for just this problem. Actually, come to think of it, I could find a much more efficient solution for one part.
08:57:19 earendel joins (uid498179@user/earendel)
08:58:38 dhouthoo joins (~dhouthoo@178-117-36-167.access.telenet.be)
08:59:05 <int-e> And that's despite the fact that using a PSQueue reduces the number of items taken from the queue from 916486 to 586012
08:59:45 <int-e> > 916486/586012
08:59:47 <lambdabot> 1.5639372572575305
09:00:12 teo joins (~teo@user/teo)
09:00:14 × whatif quits (~whatif@2400:8902::f03c:92ff:fe60:98d8) (Quit: Client closed)
09:00:15 <c_wraith> I never understood the data structure it uses anyway...
09:00:22 <int-e> > 916486/586012 * 2.3/1.4 -- PSQueue overhead peroperation?
09:00:23 <lambdabot> 2.569325494065943
09:00:24 × teo quits (~teo@user/teo) (Read error: Connection reset by peer)
09:01:00 <int-e> (the 2.3/1.4 is to be taken with a huge grain of salt; I'm dividing total runtimes here)
09:02:22 <int-e> and of course the `containers` library has seen an insane amount of effort put into optimization
09:03:10 <int-e> c_wraith: in any case, the times are close enough that I don't think PSQueue is doing anything bad in terms of asymptotic behavior
09:03:29 × tzh quits (~tzh@c-24-21-73-154.hsd1.or.comcast.net) (Quit: zzz)
09:03:38 <int-e> Oh, hmm. Maybe I should check how big these things grow
09:03:39 YoungFrog joins (~youngfrog@39.129-180-91.adsl-dyn.isp.belgacom.be)
09:04:04 acidjnk joins (~acidjnk@p200300d0c7271e736483cc3bf5018c54.dip0.t-ipconnect.de)
09:04:09 <c_wraith> yeah, I came to the conclusion that bad asymptotics would perform way worse
09:04:16 <peddie> https://hackage.haskell.org/package/psqueues looks like a faster implementation in their microbenchmarks
09:05:19 <c_wraith> that's a good find
09:06:39 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:158b:cfc1:e7b3:d4ac)
09:06:58 <int-e> set grows to 3356 elements, the PSQueue grows to 1951 elements (plus a few because I'm accounting where it's convenient, rather where it's the most accurate)
09:08:04 <c_wraith> though... I see some oddities in that API. Like. Its version of "alter" is actually "alterF" but specialized to ((,) a), and providing no real alterF or alter without that overhead...
09:08:28 × dsrt^ quits (~dsrt@wsip-98-188-240-142.mc.at.cox.net) (Remote host closed the connection)
09:11:22 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:158b:cfc1:e7b3:d4ac) (Ping timeout: 260 seconds)
09:12:33 × cheater quits (~Username@user/cheater) (Ping timeout: 256 seconds)
09:12:37 cheater1__ joins (~Username@user/cheater)
09:12:40 cheater1__ is now known as cheater
09:13:44 gensyst joins (gensyst@user/gensyst)
09:14:00 <gensyst> data MyType :: [Nat] -> * -> * where
09:14:14 <gensyst> How can I change that so that it's not [Nat] but [1 + Nat] ?
09:14:27 <gensyst> (Only positive integers allowed at the type level.)
09:15:06 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
09:16:12 notzmv joins (~zmv@user/notzmv)
09:16:27 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
09:17:40 <dminuoso> Mmm, is there even a difference between nat and nat-sans-zero?
09:17:53 allbery_b joins (~geekosaur@xmonad/geekosaur)
09:17:53 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Killed (NickServ (GHOST command used by allbery_b)))
09:17:56 allbery_b is now known as geekosaur
09:17:57 <int-e> c_wraith: hmm, in my adaptation it's slower than PSQueue. It looks awful too: insert m (k, p) = snd $ P.alter (maybe ((), Just (p, ())) (\(q, _) -> ((), Just (min p q, ())))) k m
09:18:41 <int-e> (that's for OrdPSQ)
09:19:15 <int-e> Oh, HashPSQ is actually faster
09:19:44 jgeerds_ joins (~jgeerds@55d4ac73.access.ecotel.net)
09:20:05 <int-e> (on part with Data.Set in this case)
09:22:00 × shriekingnoise quits (~shrieking@186.137.144.80) (Quit: Quit)
09:22:27 <int-e> So maybe "for priority search queues use HashPSQ from psqueues unless you deal with adverserial input" is the right conclusion here.
09:22:39 × jgeerds quits (~jgeerds@55d4ac73.access.ecotel.net) (Ping timeout: 265 seconds)
09:22:40 mncheck joins (~mncheck@193.224.205.254)
09:23:00 <int-e> It's a pity that there's no easier way to decrease-key-or-insert though.
09:23:17 <int-e> s/key/priority/
09:24:03 <YoungFrog> I'm new to Haskell, and wanted to try Debug.Hood.Observe but "cabal install hood" fails (with [__2] rejecting: FPretty-1.1 (conflict: base==4.14.3.0/installed-4.14.3.0, FPretty => base>=4.5 && <4.11)) -- I also tried intalling Hoed instead, but that fails while compiling Text.PrettyPrint.FPretty (Ambiguous occurrence ‘<>’). am I doing something wrong ?
09:24:09 <c_wraith> I don't really understand why that isn't alterF with a separate alter function
09:24:14 <int-e> (well, it is easy enough, it's just ugly because of the extra associated values and the extra result from `alter`)
09:25:01 × bahamas quits (~lucian@86.120.77.115) (Ping timeout: 256 seconds)
09:25:17 <int-e> Did we do that in 2014?
09:27:06 × econo quits (uid147250@user/econo) (Quit: Connection closed for inactivity)
09:27:16 <gensyst> dminuoso, well Nat can include 0 as you may know
09:27:41 <int-e> (That's when the package was first uploaded to hackage, and the API has only changed minimally since then; new functions are: deleteMin, atMostView, unsafeMapMonotonic)
09:28:07 <dminuoso> gensyst: out of curiosity, what's the goal?
09:28:24 <int-e> But I honestly don't know when alterF was first seriously proposed and discussed (in the context of containers).
09:28:47 × Erutuon quits (~Erutuon@user/erutuon) (Quit: WeeChat 2.8)
09:28:57 Erutuon joins (~Erutuon@user/erutuon)
09:29:30 <gensyst> dminuoso, I have a function that processes the data type's numbers one by one, and some functions there assume that the integer in question is positive (example: doStuff: forall n. (KnownNat n) => Vector (n + 1) Int -> String)
09:30:06 <gensyst> and that function call doesn't compile because at that point, that one (from "one by one") number is at that point not known to be positive as expected.
09:32:48 <lortabac> gensyst: in general you can use (n + 1) or Succ (if you have an inductive type) for this invariant
09:33:32 × darchitect quits (~darchitec@2a00:23c6:3584:df00:7dec:bf13:8fa:748c) (Ping timeout: 240 seconds)
09:33:53 <lortabac> (n + 1) is guaranteed to be positive
09:33:55 xsperry joins (~xs@user/xsperry)
09:34:28 off^ joins (~off@wsip-98-188-240-142.mc.at.cox.net)
09:35:14 <gensyst> lortabac, yes and i have it on "doStuff". the question is, how to get it into the MyType ?
09:42:13 <gensyst> I think I found a way.. i had to put the KnownNat and "+1" stuff into the data *constructors*.
09:43:02 <gensyst> in any case this is getting kind of pity because my data type is now very specific. i wonder if haskell's type system can even generalize it at all. (so the same type can be used for both positive cases and non-negative cases)
09:47:34 <lortabac> gensyst: you need to define a GADT that is indexed by the same nat you gave it as a constructor argument
09:47:41 <lortabac> in other words, a singleton
09:48:50 <lortabac> but at this point things start getting really complex, and probably not worth it
09:49:03 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds)
09:50:59 × lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection)
09:52:04 <gensyst> lortabac, thanks! cool to know it's possible, but yeah, i'll keep the types specific for now and get back to those after i have read "Thinking with Types" book!
09:52:10 <gensyst> any other books/resources you recommend?
09:54:06 <lortabac> gensyst: I'll be honest, after spending a considerable amount of time on these problems, my advice is "don't"
09:54:31 <lortabac> use Idris or Agda
09:54:43 <gensyst> why? what happened :)
09:55:00 <lortabac> or even better, just accept that you can't encode every possible invariant in the types
09:55:45 <lortabac> gensyst: it gets **extremely complex** very quickly
09:56:01 <gensyst> It stays less complex with Idris/Agda?
09:56:26 <gensyst> Is this a limitation in Haskell that's here to stay on Haskell?
09:56:36 <int-e> The type checker should be helping you, not vice versa.
09:57:15 <dminuoso> gensyst: The limitation in Haskell is that type level programming is rather an artifact than a feature.
09:57:34 <dminuoso> It just so happens that, after enabling a bunch of bolted-on extensions, you can do a bit of type level programming.
09:57:59 <lortabac> do you know the "fraction of our power" meme? that describes the problem well :)
09:58:14 <int-e> In the same spirit, types should be dependable, not dependent. (There may be /some/ overlap.)
09:59:25 × Jing quits (~hedgehog@2604:a840:3::10c8) (Remote host closed the connection)
09:59:31 <gensyst> Are there any plans to remedy this in Haskell, with some breaking changes?
09:59:40 <gensyst> Otherwise I fear Haskell will be left in the dust :(
09:59:47 <gensyst> by more powerful langs
10:00:04 Jing joins (~hedgehog@2604:a840:3::10c8)
10:00:16 <int-e> gensyst: Are you sure?
10:00:25 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
10:00:35 <gensyst> int-e, no :)
10:00:52 <gensyst> lortabac, didn't know the meme until now, thanks
10:00:53 <lortabac> gensyst: https://imgflip.com/i/5xyend :)
10:01:05 <int-e> Anyway, there are plans for dependent types in Haskell and the struggle is to make them *not* break things (except in exceptional cases)
10:01:36 <gensyst> This is sad :( Haskell is already the past :(
10:01:41 <merijn> Man...had an epiphany how to speed up yesterday's AOC right as I went to bed and then spend like an hour lying awake focussed on that >.>
10:01:50 <gensyst> but it has libraries and probably some good optimizations
10:01:56 <merijn> I'm not convinced Dependent Types are the future, tbh
10:02:06 <merijn> So not sure why you'd say Haskell is in the past
10:02:19 <int-e> Me neither. They make for good papers though.
10:02:33 <gensyst> compared to everything else i've used haskell is in the future lol. everything else seems useless in comparison
10:03:00 <dminuoso> gensyst: My favourite example of how "bolted on this is", is the typing the technical interview blog post. :)
10:03:00 cosimone joins (~user@93-47-228-203.ip115.fastwebnet.it)
10:03:08 Bob_Esponja joins (~Bob_Espon@240.red-176-83-54.dynamicip.rima-tde.net)
10:03:48 <int-e> (In a paper you can make up a whole world to your liking. In practice, you want to use libraries and their authors will inevitably have different ideas about which properties they'd like to track in types... so when you combine those... hmm, well, I'm speculating that it's a mess)
10:03:49 × alx741 quits (~alx741@181.199.42.79) (Read error: Connection reset by peer)
10:05:23 <gensyst> int-e. so maybe with Haskell, we've found the right balance!
10:05:29 <gensyst> for the next 2 decades.
10:05:30 × Bob_Esponja quits (~Bob_Espon@240.red-176-83-54.dynamicip.rima-tde.net) (Read error: Connection reset by peer)
10:05:44 <oak-> Can't you already get quite close to dependently typed programming by enabling various language extensions, such as DataKinds?
10:06:41 <merijn> oak-: Sure, if you like suffering
10:08:35 <oak-> I have anyway got the idea that it might not be always reasonable to do type level programming everywhere, but there are special cases where there are benefits
10:09:28 tom_ joins (~tom@2a00:23c8:970c:4801:f5c6:93c3:2f5e:e0)
10:10:18 darchitect joins (~darchitec@82-132-214-28.dab.02.net)
10:10:44 <oak-> Somehow I find Haskell's type-level programming comparable to LISP macros (although there is also Template Haskell), you don't use them everywhere but in situations where you want to create your own DSL to solve the problem
10:11:25 × zincy quits (~tom@2a00:23c8:970c:4801:2c67:e51d:1302:54d3) (Ping timeout: 252 seconds)
10:11:40 <int-e> . o O ( Oh, while I'm quipping: Those who give up type inference for stronger type systems deserve neither. )
10:13:06 <int-e> gensyst: I think that's too subjective to meaningfully confirm or deny.
10:14:52 Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915)
10:15:35 × Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 250 seconds)
10:16:26 Bob_Esponja joins (~Bob_Espon@240.red-176-83-54.dynamicip.rima-tde.net)
10:17:07 × Bob_Esponja quits (~Bob_Espon@240.red-176-83-54.dynamicip.rima-tde.net) (Read error: Connection reset by peer)
10:17:37 Lord_of_Life_ is now known as Lord_of_Life
10:19:28 <gensyst> well i'm betting on haskell
10:19:31 <dminuoso> oak-: More often than not, a simple `when badCondition (throwIO MyException)` can do wonders.
10:19:44 <dminuoso> It's so much easier to read and follow, and maintain, than crazy type level programming to assert something
10:20:48 <oak-> This reminds me that I actually bought the "Thinking with types" -book but haven't read it :D
10:20:59 alx741 joins (~alx741@157.100.93.160)
10:21:23 <dminuoso> Another important thing with type level trickery is that it greatly reduces the amount of people capable or willing to help maintain your package.
10:21:51 <dminuoso> When you have to enable 10 extensions and be a GHC wizard to work with some given code, you essentialy ensure you're doing this all by yourself.
10:23:39 <int-e> Yeah maybe we could rank those extensions by how much they *help* with writing correct code. GADTs would be my number 1, I think.
10:24:32 <int-e> TypeInType would be near the bottom
10:24:57 <dminuoso> int-e: Amusingly TypeInType is implicitly enabled anyway.
10:25:04 <dminuoso> You cant not have it.
10:26:08 kuribas joins (~user@ip-188-118-57-242.reverse.destiny.be)
10:26:25 <gensyst> all i want to do is mandate equal sizes for certain vectors and it's *already* painful lol
10:26:34 <gensyst> i guess that's as far as i can push it
10:26:39 <gensyst> s/can/should
10:26:52 <int-e> dminuoso: It does have the advantage of not getting in the way, but I don't really have a use for the freedoms it offers.
10:27:38 <int-e> Also I still have ghc-8.0.2 around if needed ;)
10:35:03 <merijn> bleh, there's no efficient data structure for lookups with 2 different keys, I guess
10:40:00 <int-e> Like a 2D array?
10:40:19 <merijn> no, that'd just be 1 key that's a tuple
10:40:35 <int-e> Okay. I don't understand what you mean then.
10:41:49 <merijn> int-e: I have a bunch of values that have 2 independent keys, both identifying the same value and I want to look up with either. Now I'm just using 2 maps, but that's rather a PITA to keep in sync
10:41:52 <geekosaur> like a database table with two indexed fields?
10:42:04 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
10:42:37 <merijn> Essentially
10:43:19 <geekosaur> would consider replicating that: stick values in a vector and have both maps provide the index into the vector. still a pain to keep in sync though]
10:43:31 pfurla[m] joins (uid345156@id-345156.tinside.irccloud.com)
10:43:39 <geekosaur> always will be, you're just looking for someone else to have dealt with the pain :)
10:44:35 ph88 joins (~ph88@2a02:8109:9e00:71d0:943d:5b05:e9f7:79b5)
10:44:38 yuyua32 joins (~yuyua32@wireless-student-pt3-240-10.lut.ac.uk)
10:50:14 [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470)
10:51:07 × mbuf quits (~Shakthi@122.178.199.206) (Ping timeout: 250 seconds)
10:53:05 mbuf joins (~Shakthi@171.61.229.99)
10:54:11 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
10:55:07 × pfurla quits (~pfurla@2804:18:5804:c94c:6161:1466:1870:aecb) (Quit: gone to sleep. ZZZzzz…)
10:55:15 × yuyua32 quits (~yuyua32@wireless-student-pt3-240-10.lut.ac.uk) (Quit: Client closed)
10:58:20 benin joins (~benin@183.82.204.250)
10:58:31 × mbuf quits (~Shakthi@171.61.229.99) (Ping timeout: 256 seconds)
10:58:40 mbuf joins (~Shakthi@122.178.230.23)
10:59:13 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
11:00:42 DNH joins (~DNH@8.43.122.49)
11:01:35 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
11:02:02 × benin quits (~benin@183.82.204.250) (Client Quit)
11:03:22 × ubert quits (~Thunderbi@p200300ecdf1abb0650b4610a52e3eab2.dip0.t-ipconnect.de) (Ping timeout: 260 seconds)
11:04:24 ubert joins (~Thunderbi@p200300ecdf1abb061518ea9ba8d342d1.dip0.t-ipconnect.de)
11:04:30 jakalx parts (~jakalx@base.jakalx.net) ()
11:06:56 × [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Read error: Connection reset by peer)
11:06:56 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
11:07:33 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
11:07:50 benin joins (~benin@183.82.204.250)
11:08:47 cyphase_eviltwin is now known as cyphase
11:14:11 [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470)
11:16:39 × Akiva quits (~Akiva@user/Akiva) (Ping timeout: 256 seconds)
11:19:02 dyeplexer joins (~dyeplexer@user/dyeplexer)
11:19:55 alx741 joins (~alx741@157.100.93.160)
11:20:43 × SummerSonw quits (~The_viole@203.77.49.232) (Ping timeout: 252 seconds)
11:21:33 y04nn joins (~y04nn@92.223.89.196)
11:23:44 lavaman joins (~lavaman@98.38.249.169)
11:24:49 madjestic joins (~madjestic@88-159-247-120.fixed.kpn.net)
11:25:34 mmhat joins (~mmh@55d47819.access.ecotel.net)
11:27:15 AlexNoo_ is now known as AlexNoo
11:29:17 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 265 seconds)
11:32:37 × koz quits (~koz@121.99.240.58) (Ping timeout: 240 seconds)
11:33:54 × hololeap_ quits (~hololeap@user/hololeap) (Ping timeout: 276 seconds)
11:34:03 koz joins (~koz@121.99.240.58)
11:34:05 hololeap_ joins (~hololeap@user/hololeap)
11:35:11 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
11:39:12 jz99 joins (~jz99@n110-33-34-202.hum1.act.optusnet.com.au)
11:40:14 __monty__ joins (~toonn@user/toonn)
11:40:15 × jz99 quits (~jz99@n110-33-34-202.hum1.act.optusnet.com.au) (Client Quit)
11:44:20 × gensyst quits (gensyst@user/gensyst) (Quit: Leaving)
11:45:17 × rembo10 quits (~rembo10@remulis.com) (Quit: ZNC 1.8.2 - https://znc.in)
11:45:33 ph88^ joins (~ph88@95.90.240.104)
11:46:03 × y04nn quits (~y04nn@92.223.89.196) (Remote host closed the connection)
11:46:26 rembo10 joins (~rembo10@remulis.com)
11:48:38 × acidjnk quits (~acidjnk@p200300d0c7271e736483cc3bf5018c54.dip0.t-ipconnect.de) (Ping timeout: 260 seconds)
11:51:26 jakalx joins (~jakalx@base.jakalx.net)
11:52:14 alx741 joins (~alx741@157.100.93.160)
11:53:59 CiaoSen joins (~Jura@p200300c957347b002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
11:55:18 SummerSonw joins (~The_viole@203.77.49.232)
11:57:25 × yaroot quits (~yaroot@175.0.30.125.dy.iij4u.or.jp) (Ping timeout: 240 seconds)
11:57:39 yaroot joins (~yaroot@2409:12:ac0:2300:680e:dbff:fe1e:4953)
11:58:43 mikoto-chan joins (~mikoto-ch@esm-84-240-99-143.netplaza.fi)
12:03:33 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
12:03:47 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
12:04:17 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
12:05:25 altern joins (~Sergii@altern.corbina.com.ua)
12:08:53 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 250 seconds)
12:09:10 × jgeerds_ quits (~jgeerds@55d4ac73.access.ecotel.net) (Ping timeout: 260 seconds)
12:09:55 × altern quits (~Sergii@altern.corbina.com.ua) (Ping timeout: 256 seconds)
12:10:27 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
12:15:42 × jle` quits (~jle`@cpe-23-240-75-236.socal.res.rr.com) (Ping timeout: 260 seconds)
12:15:43 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds)
12:16:30 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
12:17:26 jle` joins (~jle`@cpe-23-240-75-236.socal.res.rr.com)
12:17:44 × cfricke quits (~cfricke@user/cfricke) (Ping timeout: 252 seconds)
12:18:45 × hololeap_ quits (~hololeap@user/hololeap) (Ping timeout: 276 seconds)
12:18:53 Achylles joins (~Achylles_@2804:431:d725:5f74:726:267b:60a8:3cf6)
12:19:33 × nfd quits (~nfd@user/nfd) (Ping timeout: 256 seconds)
12:19:52 acidjnk joins (~acidjnk@p200300d0c7271e736483cc3bf5018c54.dip0.t-ipconnect.de)
12:19:55 hololeap_ joins (~hololeap@user/hololeap)
12:20:13 alx741 joins (~alx741@157.100.93.160)
12:21:49 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds)
12:22:17 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
12:29:42 pretty_dumm_guy joins (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655)
12:32:46 yhsiveht joins (~Nishant@2405:201:f005:c007:5dca:71f9:c326:6e3b)
12:33:04 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 268 seconds)
12:33:54 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
12:34:03 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
12:36:11 × thevishy quits (~Nishant@2405:201:f005:c007:49c7:f8b1:7727:93e) (Ping timeout: 250 seconds)
12:36:47 × Achylles quits (~Achylles_@2804:431:d725:5f74:726:267b:60a8:3cf6) (Remote host closed the connection)
12:39:13 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 250 seconds)
12:40:01 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
12:43:03 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
12:43:38 Vajb joins (~Vajb@2001:999:62:f3d1:4390:fbed:1f9b:9d03)
12:45:37 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds)
12:45:52 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
12:50:06 jippiedoe joins (~david@2a02-a44c-e14e-1-f6c0-f1a6-a625-ead4.fixed6.kpn.net)
12:50:07 × Vajb quits (~Vajb@2001:999:62:f3d1:4390:fbed:1f9b:9d03) (Read error: Connection reset by peer)
12:50:52 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
12:51:10 × SummerSonw quits (~The_viole@203.77.49.232) (Remote host closed the connection)
12:51:17 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds)
12:51:32 SummerSonw joins (~The_viole@203.77.49.232)
12:51:38 alx741 joins (~alx741@157.100.93.160)
12:51:41 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
12:52:37 <dminuoso> int-e: Regarding GADTs, I find that somewhat surprising. I have not yet really encountered the need or usecase to write more-correect-code with them.
12:52:40 × pfurla[m] quits (uid345156@id-345156.tinside.irccloud.com) (Quit: Connection closed for inactivity)
12:52:51 <dminuoso> But maybe I'm missing out on some common patterns with them
12:54:23 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
12:54:24 bontaq joins (~user@ool-45779fe5.dyn.optonline.net)
12:55:09 Vajb joins (~Vajb@2001:999:62:f3d1:4390:fbed:1f9b:9d03)
12:56:57 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds)
12:57:29 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
12:57:44 noctux2 joins (~noctux@p5b2cc15e.dip0.t-ipconnect.de)
12:58:38 × noctux2 quits (~noctux@p5b2cc15e.dip0.t-ipconnect.de) (Client Quit)
13:00:01 × max22- quits (~maxime@2a01cb08833598009a038ff51315adf9.ipv6.abo.wanadoo.fr) (Ping timeout: 250 seconds)
13:03:13 × SummerSonw quits (~The_viole@203.77.49.232) (Remote host closed the connection)
13:03:34 SummerSonw joins (~The_viole@203.77.49.232)
13:04:05 × darchitect quits (~darchitec@82-132-214-28.dab.02.net) (Read error: Connection reset by peer)
13:04:05 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
13:07:22 gensyst joins (gensyst@user/gensyst)
13:07:47 <gensyst> foo @Int a b is working but a `foo @Int` b is not
13:07:53 <gensyst> How to apply types to section operators?
13:08:13 <merijn> gensyst: You can't apply anything within `` it only works on single variables
13:09:11 curiousgay joins (~curiousga@77-120-141-90.kha.volia.net)
13:09:49 <jippiedoe> flip (foo @Int) b
13:10:28 <dminuoso> let f = foo @Int in l `f` r
13:11:26 <gensyst> ok thank you
13:11:39 <gensyst> not the prettiest to have those intermediate vars though, but ok
13:13:59 <geekosaur> the parser gets ugly if you allow more than just an identifier in ``
13:14:12 <geekosaur> especially whenb you try to nest them :)
13:15:04 <dminuoso> geekosaur: Well you can of course just write `foo @Int b a`
13:15:10 <dminuoso> Oh. gensyst
13:15:16 × benin quits (~benin@183.82.204.250) (Quit: The Lounge - https://thelounge.chat)
13:15:21 pfurla joins (~pfurla@177.25.184.15)
13:15:32 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
13:15:41 bahamas joins (~lucian@84.232.140.13)
13:16:45 <geekosaur> problem there is you get "cleverly" named things like `notFollowedBy` that expect to be written infix and look bass-ackwards when written prefix
13:18:13 benin joins (~benin@183.82.204.250)
13:18:14 × SummerSonw quits (~The_viole@203.77.49.232) (Ping timeout: 260 seconds)
13:18:38 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Quit: = "")
13:21:23 <dminuoso> Fair, I tend to use isSuffixOf/isInfixOf/isPrefixOf in infix notation exclusively
13:22:07 alx741 joins (~alx741@157.100.93.160)
13:28:11 × Erutuon quits (~Erutuon@user/erutuon) (Ping timeout: 250 seconds)
13:28:36 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
13:30:32 Ainoretho joins (~ypw@huji-132-64-244-88.xt.huji.ac.il)
13:31:35 SummerSonw joins (~The_viole@203.77.49.232)
13:32:30 <gensyst> thanks guys
13:32:34 × gensyst quits (gensyst@user/gensyst) (Quit: Leaving)
13:33:30 × benin quits (~benin@183.82.204.250) (Quit: The Lounge - https://thelounge.chat)
13:33:47 benin joins (~benin@183.82.204.250)
13:36:37 × bahamas quits (~lucian@84.232.140.13) (Ping timeout: 256 seconds)
13:46:32 max22- joins (~maxime@2a01cb0883359800f72e75eb3cbff1a0.ipv6.abo.wanadoo.fr)
13:46:42 alx741 joins (~alx741@157.100.93.160)
13:51:39 jkaye joins (~jkaye@2601:281:8300:7530:323:f5e4:2678:9ded)
13:59:29 shriekingnoise joins (~shrieking@186.137.144.80)
14:00:58 bollu joins (uid233390@id-233390.helmsley.irccloud.com)
14:02:09 × chexum quits (~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection)
14:02:22 chexum joins (~quassel@gateway/tor-sasl/chexum)
14:02:36 × lortabac quits (~lortabac@2a01:e0a:541:b8f0:1b1:ff3c:2e88:391a) (Quit: WeeChat 2.8)
14:04:18 waleee joins (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4)
14:04:35 <iphy> is there a parser generator for trees? like happy is for token streams. I want to re-parse the tree after parsing a token stream into a tree. something like pattern matching but more concise. basically I'd like to first parse a more general language and then identify patterns on it
14:04:39 × xsperry quits (~xs@user/xsperry) (Remote host closed the connection)
14:06:38 <dminuoso> iphy: Is that not simply an algebra on the tree?
14:07:40 <geekosaur> that's more or less what I'm wondering. I mean, the whole point of parsing into a tree representation is to enable such analysis
14:08:02 <iphy> for example, I'd parse a C file into a list of top level declarations (comments, includes, functions, defines, #ifdef/#endif, etc.) and then re-parse the list of declarations into "includes first, defines and functions next, and everything should be wrapped in a header guard"
14:08:24 <dminuoso> That does not sound like "parsing"
14:08:29 <dminuoso> That sounds like a simple tree transformation.
14:08:36 <dminuoso> i.e. `transform :: Tree -> Tree`
14:08:41 <iphy> sort of, yes
14:08:51 <iphy> except the output tree might be a different type, but sure, it could be the same type
14:08:58 <iphy> and yes, it's a simple tree transformation
14:09:05 <iphy> is there a "tree transformation" generator?
14:09:17 <dminuoso> You mean a function?
14:09:29 <dminuoso> I'm really unsure what you are looking for, that isn't covered by a simple function with pattern matching.
14:10:05 <iphy> header ::= ifndef ID define ID include+ decl+ endif
14:10:17 <iphy> that's what I want to express
14:10:46 <iphy> header ::= ifndef ID define ID include+ decl+ endif { Header $2 $5 $6 }
14:11:15 <iphy> or, maybe in haskell pattern matching syntax:
14:11:16 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:158b:cfc1:e7b3:d4ac)
14:12:16 <dminuoso> By the way, changing the order of macros in a C program can alter its meaning.
14:12:47 <iphy> header = \case (Ifndef guard) (Define _) incs@[Include...] decls@[Decl...] Endif -> Header guard incs decls
14:12:50 <iphy> (pseudo-haskell)
14:13:26 <iphy> I'm not changing C programs, I'm parsing them
14:13:33 <geekosaur> you'd have specific AST nodes for those which you can match against
14:13:48 <iphy> yes, I have AST nodes for Include, Decl, etc.
14:13:48 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
14:14:13 <iphy> I want to match a list of nodes against this pattern
14:15:38 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:158b:cfc1:e7b3:d4ac) (Ping timeout: 260 seconds)
14:16:11 × SummerSonw quits (~The_viole@203.77.49.232) (Ping timeout: 245 seconds)
14:16:17 <iphy> if there's a library for expressing this pattern, that's cool too
14:19:09 × yhsiveht quits (~Nishant@2405:201:f005:c007:5dca:71f9:c326:6e3b) (Quit: Leaving)
14:24:40 lavaman joins (~lavaman@98.38.249.169)
14:29:19 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 256 seconds)
14:31:13 <geekosaur> I was thinking hoopl but that's for dataflow analysis
14:32:12 alx741 joins (~alx741@157.100.93.160)
14:32:32 <geekosaur> but tbh if I know a header is going to have that pattern I build it into the parser rules and the resulting AST will have your Header node
14:33:29 <iphy> right, that's an option
14:33:54 <iphy> but I was hoping to be able to do more pattern matching and analysis that way more easily
14:34:06 <dminuoso> I would simply do this in haskell code.
14:34:25 <dminuoso> Once you have your AST, you can transform it, and if the resulting data type changes, make it a simple `f :: AST1 -> AST2`
14:34:32 <iphy> https://gist.github.com/iphydf/766056c412aa360946a57612b2537daa
14:34:43 <iphy> does this snippet make sense? what I'd like to express?
14:34:57 <dminuoso> No
14:35:01 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
14:35:01 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
14:35:01 wroathe joins (~wroathe@user/wroathe)
14:35:14 <dminuoso> Or maybe
14:37:31 <jippiedoe> I don't completely know what you want, but maybe attribute grammars provide something similar?
14:39:05 × sleblanc quits (~sleblanc@user/sleblanc) (Ping timeout: 252 seconds)
14:39:52 <iphy> https://gist.github.com/iphydf/b1fc840ae314b9e89b9f3bbaf2def78e
14:39:55 <iphy> more or less
14:40:09 <iphy> probably monadic and with Alternative instead
14:40:21 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
14:41:47 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Client Quit)
14:42:00 <iphy> so line 2 turns into the function on line 6
14:42:52 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
14:43:21 <dminuoso> I think I have a broad understanding what you are trying to do here.
14:43:36 <dminuoso> And it seems you should simply write this into your happy grammar.
14:44:20 <dminuoso> Or potentially a separate pass, much in line with how macro expansion is implemented in C compielrs
14:44:31 featurebug joins (~featurebu@49.205.122.91)
14:44:53 <dminuoso> i.e. first parse the macro language into a MacroAst of course, and then parse the C bits and pieces separately
14:45:35 <iphy> hmm
14:45:58 benin1 joins (benin@gateway/vpn/protonvpn/benin)
14:46:11 <iphy> maybe I can turn ast nodes into the token type of a second happy parser
14:46:32 <iphy> but I'd like to make many smaller parsers like this, used for various analyses
14:46:58 <iphy> making many happy parsers seems a bit heavy
14:47:02 <dminuoso> Something like `data MacroAst = Define T.Text T.Text | If T.Text MacroAst | C T.Text
14:47:18 <dminuoso> And then `C T.Text` would be the raw C chunks
14:47:50 <iphy> right, but that would be specific to one use case
14:47:53 darkstardevx joins (~darkstard@50.39.115.145)
14:48:02 × benin quits (~benin@183.82.204.250) (Ping timeout: 240 seconds)
14:48:44 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 268 seconds)
14:48:52 benin joins (~benin@183.82.204.250)
14:50:50 × benin quits (~benin@183.82.204.250) (Client Quit)
14:50:51 × benin1 quits (benin@gateway/vpn/protonvpn/benin) (Ping timeout: 256 seconds)
14:51:12 SummerSonw joins (~The_viole@203.77.49.232)
14:51:14 PVPANTHONY joins (~The_viole@203.77.49.232)
14:51:53 × jlamothe_ quits (~jlamothe@198.251.61.229) (Quit: leaving)
14:57:05 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
14:57:22 × joeyh quits (joeyh@kitenet.net) (Ping timeout: 268 seconds)
14:57:59 joeyh joins (~joeyh@kitenet.net)
14:57:59 × nshepperd quits (nshepperd@2600:3c03::f03c:92ff:fe28:92c9) (Ping timeout: 268 seconds)
14:58:02 × landonf quits (landonf@mac68k.info) (Ping timeout: 240 seconds)
14:58:36 × hays quits (rootvegeta@fsf/member/hays) (Ping timeout: 268 seconds)
14:58:45 h_ joins (~rootveget@fsf/member/hays)
14:58:47 <featurebug> Hi all, I am trying to build haskell on wsl but getting this error - https://pastebin.com/Qjcxm33d . Any idea what is the problem?
14:59:33 <merijn> featurebug: Any specific reason you're trying to build GHC from source?
14:59:48 nshepperd joins (~nshepperd@li364-218.members.linode.com)
15:00:31 nvmd joins (~nvmd@user/nvmd)
15:01:46 mc47 joins (~mc47@xmonad/TheMC47)
15:01:49 <featurebug> yes I was trying to run the external-stg-interpreter, following these instructions - https://github.com/grin-compiler/ghc-whole-program-compiler-project#usage
15:02:06 <featurebug> part of that was building ghc. not entirely sure why that is necessary
15:02:23 dschrempf joins (~dominik@070-207.dynamic.dsl.fonira.net)
15:03:09 landonf joins (landonf@mac68k.info)
15:03:13 jlamothe joins (~jlamothe@198.251.61.229)
15:03:21 <merijn> ah, because he forked GHC
15:04:51 <merijn> Looks like there's *something* broken with his GHC fork under WSL, but no clue what
15:05:11 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
15:05:11 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
15:05:11 wroathe joins (~wroathe@user/wroathe)
15:05:34 <featurebug> ok ok, is it generally possible to build ghc in wsl?
15:05:42 <merijn> no clue, tbh
15:05:59 <iphy> should be
15:06:06 <iphy> "error: variable ‘stg_exports_GHCziDataziFastString’ has initializer but incomplete type"
15:06:13 xkuru joins (~xkuru@user/xkuru)
15:06:21 <iphy> that doesn't sound like an OS specific issue
15:09:53 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 252 seconds)
15:11:44 × [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Read error: Connection reset by peer)
15:14:45 alx741 joins (~alx741@157.100.93.160)
15:18:54 × madjestic quits (~madjestic@88-159-247-120.fixed.kpn.net) (Quit: Reconnecting)
15:19:06 madjestic joins (~madjestic@88-159-247-120.fixed.kpn.net)
15:19:21 × fr33domlover quits (~fr33@2.55.142.29) (Remote host closed the connection)
15:20:00 <geekosaur> that looks to me like a missing or incomplete include file defining ForeignExportsList
15:20:28 Sgeo joins (~Sgeo@user/sgeo)
15:24:30 tdmm joins (1c9b9145fc@2604:bf00:561:2000::1c8)
15:28:17 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
15:29:46 × PVPANTHONY quits (~The_viole@203.77.49.232) (Quit: Leaving)
15:30:16 burnsidesLlama joins (~burnsides@dhcp168-019.wadham.ox.ac.uk)
15:30:19 × burnsidesLlama quits (~burnsides@dhcp168-019.wadham.ox.ac.uk) (Remote host closed the connection)
15:30:26 burnsidesLlama joins (~burnsides@dhcp168-019.wadham.ox.ac.uk)
15:31:23 × SummerSonw quits (~The_viole@203.77.49.232) (Quit: Leaving)
15:31:36 × pfurla quits (~pfurla@177.25.184.15) (Quit: gone to sleep. ZZZzzz…)
15:32:33 <geekosaur> hm, conceivably that's a platform issue if whatever include file is supposed to define that is generated and the generation went wrong somehow because of platform
15:32:55 <geekosaur> but I'd expect ForeignExportsList to not be platform specific tbh
15:33:50 × gehmehgeh quits (~user@user/gehmehgeh) (Quit: Leaving)
15:37:45 × ldlework quits (~hexeme@user/hexeme) (Ping timeout: 250 seconds)
15:40:23 × DNH quits (~DNH@8.43.122.49) (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:40:51 <janus> Cale: when you say "linear things [..] secretly update a reference" do you mean they update a counter? so we're talking about run-time errors if you use it wrong?
15:41:25 × eco quits (~ubuntu@ec2-54-201-230-197.us-west-2.compute.amazonaws.com) (Ping timeout: 252 seconds)
15:45:01 alx741 joins (~alx741@157.100.93.160)
15:47:34 bahamas joins (~lucian@84.232.140.13)
15:48:30 × coot quits (~coot@89-64-85-93.dynamic.chello.pl) (Quit: coot)
15:49:02 coot joins (~coot@89-64-85-93.dynamic.chello.pl)
15:49:52 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
15:52:21 hexeme joins (~hexeme@user/hexeme)
15:52:33 albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8)
15:52:45 eco joins (~ubuntu@ec2-54-201-230-197.us-west-2.compute.amazonaws.com)
15:53:38 vincenz joins (~poucet@104.134.21.7)
15:56:47 Guest57 joins (~Guest57@82.47.22.49)
15:58:41 × Guest57 quits (~Guest57@82.47.22.49) (Client Quit)
15:59:38 <merijn> Whoo!
15:59:53 <merijn> New solution to Day14 takes 0.01 for part 1&2, down from 40s!
15:59:54 <geekosaur> moo?
16:00:06 × chizil[m] quits (~chizilmat@2001:470:69fc:105::1:34ab) (Quit: You have been kicked for being idle)
16:01:27 <Taneb> merijn: nice!
16:03:25 <merijn> I realised my initial version was just a very dumb specific hack that can be trivially generalised :p
16:03:34 lbseale joins (~ep1ctetus@user/ep1ctetus)
16:03:48 <merijn> Of course, this only occurred to me as I hit the bed and then spent 40 minutes lying awake thinking it through, so my sleep was ruined...
16:04:31 × Morrow quits (~quassel@bzq-110-168-31-106.red.bezeqint.net) (Ping timeout: 252 seconds)
16:07:33 alx741 joins (~alx741@157.100.93.160)
16:10:10 × dschrempf quits (~dominik@070-207.dynamic.dsl.fonira.net) (Quit: WeeChat 3.3)
16:11:13 × chele quits (~chele@user/chele) (Remote host closed the connection)
16:12:25 DNH joins (~DNH@8.43.122.49)
16:12:25 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
16:13:02 alx741 joins (~alx741@157.100.93.160)
16:17:27 DavSanchez joins (~DavSanche@73.red-83-34-157.dynamicip.rima-tde.net)
16:19:32 <jippiedoe> Did you solve it in a similar way to day6?
16:20:53 <merijn> Not at all :p
16:22:01 <merijn> Day6 has a fairly easy iterative solution
16:22:08 <merijn> Day14 not so much
16:22:10 × DavSanchez quits (~DavSanche@73.red-83-34-157.dynamicip.rima-tde.net) (Remote host closed the connection)
16:22:20 <c_wraith> Day 14 has a solution almost identical to day 6
16:22:40 DavSanch_ joins (~davsanche@73.red-83-34-157.dynamicip.rima-tde.net)
16:23:19 <merijn> c_wraith: Not identical to my day 6 solution :p
16:23:32 <merijn> c_wraith: https://github.com/merijn/AdventOfCode/blob/master/Day6.hs#L42-L51
16:24:11 <merijn> I don't see how I'd apply that approach to Day14
16:24:18 <c_wraith> nope, it's basically the same. The only difference is that you're working over a mildly larger state space.
16:25:05 <merijn> c_wraith: This is my Day14 solution: https://github.com/merijn/AdventOfCode/blob/master/Day14.hs#L71-L115
16:28:13 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
16:31:43 × bahamas quits (~lucian@84.232.140.13) (Ping timeout: 250 seconds)
16:31:55 doyougnu joins (~doyougnu@c-73-25-202-122.hsd1.or.comcast.net)
16:35:22 Nolrai2 joins (~Nolrai2@73.240.1.39)
16:35:50 × off^ quits (~off@wsip-98-188-240-142.mc.at.cox.net) (Remote host closed the connection)
16:36:57 <DavSanch_> Good day everyone, I have a question about cabal.project files that include several packages (for example, a lib, a cli and a gui). Is there any way to make the packages defined there visible to the others?
16:37:33 <DavSanch_> I mean, is it possible for example that the "gui" package could import a library defined in the "lib" package, provided it hasn't been installed nor uploaded to hackage
16:37:55 _ht joins (~quassel@82-169-194-8.biz.kpn.net)
16:38:03 × biberu quits (~biberu@user/biberu) (Read error: Connection reset by peer)
16:38:28 <jippiedoe> merijn: How is that so fast?! I thought that the final string would have been way too large to store
16:38:36 <Nolrai2> Is there a reason mapAccum is in Data.Conduit.List and doesn't have a renamed version in Data.Conduit.Combinators?
16:39:03 <merijn> jippiedoe: Who says anything about storing final strings? :)
16:40:41 <merijn> jippiedoe: You can check the solution at the link above :)
16:41:38 <jippiedoe> Ah, I read through it too fast: 'polymerInsertion' itself looks like the naive algorithm, but I have to look at fastScore a bit more
16:41:50 <merijn> jippiedoe: Yeah, that was is my initial simple expansion
16:42:13 <merijn> jippiedoe: Which works perfectly fine lazily, constant memory for 40 minutes chugging along the part 2 solution :p
16:42:24 <merijn> But probably won't finish before the heat death of the universe :p
16:44:37 <Nolrai2> DavSanch_: short answer is "yes". https://docs.haskellstack.org/en/stable/yaml_configuration/ describes how for the stack build tool, iiuc your question.
16:45:16 × ph88^ quits (~ph88@95.90.240.104) (Quit: Leaving)
16:45:16 <merijn> DavSanch_: ah, wait, I only now see the plural "cabal.project file*s*"
16:45:24 <merijn> DavSanch_: Why is that plural? Because that sounds wrong
16:45:34 ph88^ joins (~ph88@ip5f5af068.dynamic.kabel-deutschland.de)
16:45:44 × ph88^ quits (~ph88@ip5f5af068.dynamic.kabel-deutschland.de) (Client Quit)
16:45:47 <DavSanch_> You're right, I was talking about a single cabal.project file :)
16:45:58 × ph88 quits (~ph88@2a02:8109:9e00:71d0:943d:5b05:e9f7:79b5) (Quit: Leaving)
16:46:15 ph88 joins (~ph88@ip5f5af068.dynamic.kabel-deutschland.de)
16:46:28 alx741 joins (~alx741@157.100.93.160)
16:46:31 <merijn> DavSanch_: If you list all the package in the cabal.project packages it should "just work"?
16:46:59 <merijn> DavSanch_: see https://github.com/merijn/broadcast-chan/blob/master/cabal.project#L1
16:47:30 <jippiedoe> merijn: Alright, I get it now, that's very neat! The solution I had / c_wraith was mentioning, is just like Day6, except you count all possible pairs
16:47:55 <DavSanch_> Thanks guys, most probably I have something wrong around because I'm finding errors. I'll take a look
16:47:57 <merijn> c_wraith already whispered me about that solution :)
16:48:02 × lechner quits (~lechner@debian/lechner) (Ping timeout: 240 seconds)
16:48:14 <merijn> DavSanch_: helps to pastebin the errors (and/or link to repo)
16:49:22 <DavSanch_> It's for this one: https://github.com/DavSanchez/hematria
16:49:41 <DavSanch_> latest changes (i.e. the GUI importing the lib) are not up yet
16:50:27 lechner joins (~lechner@debian/lechner)
16:51:22 <merijn> What are the errors?
16:52:41 slowButPresent joins (~slowButPr@user/slowbutpresent)
16:53:14 <DavSanch_> Could not find module 'x' It is not a module in the current program, or in any known package
16:53:14 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
16:53:19 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:158b:cfc1:e7b3:d4ac)
16:54:33 <DavSanch_> Ahh solved, just copied/pasted the exported lib from the library folder and it worked, had a typo somewhere
16:55:05 <merijn> :p
16:55:09 <DavSanch_> Thanks @merijin @Nolrai2
16:55:34 jakalx parts (~jakalx@base.jakalx.net) (Error from remote client)
16:55:57 × srk quits (~sorki@user/srk) (Remote host closed the connection)
16:56:18 srk joins (~sorki@user/srk)
16:56:32 × jippiedoe quits (~david@2a02-a44c-e14e-1-f6c0-f1a6-a625-ead4.fixed6.kpn.net) (Remote host closed the connection)
16:58:38 × xkuru quits (~xkuru@user/xkuru) (Read error: Connection reset by peer)
16:59:32 econo joins (uid147250@user/econo)
17:00:28 Akiva joins (~Akiva@user/Akiva)
17:01:18 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 260 seconds)
17:02:14 × jackhill quits (~jackhill@kalessin.dragonsnail.net) (Remote host closed the connection)
17:04:20 biberu joins (~biberu@user/biberu)
17:04:46 × biberu quits (~biberu@user/biberu) (Remote host closed the connection)
17:05:33 jakalx joins (~jakalx@base.jakalx.net)
17:06:04 lambdalove-sadvi joins (~user@2804:d51:47f5:ac00:9bf5:fb5f:29:c009)
17:10:01 biberu joins (~biberu@user/biberu)
17:10:53 × waleee quits (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4) (Ping timeout: 252 seconds)
17:11:02 alx741 joins (~alx741@157.100.93.160)
17:12:47 xkuru joins (~xkuru@user/xkuru)
17:13:12 Guest47 joins (~Guest47@2a02:8109:b63f:ed22:a45d:5f40:3bfd:dbd3)
17:13:46 waleee joins (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4)
17:13:52 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Quit: Leaving)
17:15:02 geekosaur joins (~geekosaur@xmonad/geekosaur)
17:15:31 mvk joins (~mvk@2607:fea8:5cdd:f000::9788)
17:15:31 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
17:16:25 bahamas joins (~lucian@84.232.140.13)
17:22:48 ProfSimm joins (~ProfSimm@87.227.196.109)
17:23:49 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection)
17:24:23 Neuromancer joins (~Neuromanc@user/neuromancer)
17:26:30 × lupulo quits (~lupulo_@128.red-83-35-42.dynamicip.rima-tde.net) (Ping timeout: 260 seconds)
17:26:58 FinnElija joins (~finn_elij@user/finn-elija/x-0085643)
17:29:19 × DavSanch_ quits (~davsanche@73.red-83-34-157.dynamicip.rima-tde.net) ()
17:32:02 × waleee quits (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4) (Ping timeout: 240 seconds)
17:32:15 × Guest47 quits (~Guest47@2a02:8109:b63f:ed22:a45d:5f40:3bfd:dbd3) (Quit: Client closed)
17:33:34 alx741 joins (~alx741@157.100.93.160)
17:33:43 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
17:35:38 × acidjnk quits (~acidjnk@p200300d0c7271e736483cc3bf5018c54.dip0.t-ipconnect.de) (Ping timeout: 252 seconds)
17:37:25 × ph88 quits (~ph88@ip5f5af068.dynamic.kabel-deutschland.de) (Quit: Leaving)
17:38:38 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 260 seconds)
17:40:55 × DNH quits (~DNH@8.43.122.49) (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:40:55 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
17:42:07 <cigsender> :q
17:42:24 × cigsender quits (~cigsender@74.124.58.162) (Quit: leaving)
17:43:10 × mbuf quits (~Shakthi@122.178.230.23) (Quit: Leaving)
17:43:33 jackhill joins (~jackhill@kalessin.dragonsnail.net)
17:43:45 × puke quits (~puke@user/puke) (Remote host closed the connection)
17:44:00 puke joins (~puke@user/puke)
17:49:57 × coot quits (~coot@89-64-85-93.dynamic.chello.pl) (Quit: coot)
17:50:29 × curiousgay quits (~curiousga@77-120-141-90.kha.volia.net) (Ping timeout: 256 seconds)
17:52:26 × aliosablack quits (~chomwitt@94.66.63.187) (Quit: Leaving)
17:52:40 aliosablack joins (~chomwitt@2a02:587:dc19:a500:12c3:7bff:fe6d:d374)
17:52:40 × aliosablack quits (~chomwitt@2a02:587:dc19:a500:12c3:7bff:fe6d:d374) (Remote host closed the connection)
17:52:59 chomwitt joins (~chomwitt@2a02:587:dc19:a500:12c3:7bff:fe6d:d374)
17:53:04 × kuribas quits (~user@ip-188-118-57-242.reverse.destiny.be) (Quit: ERC (IRC client for Emacs 26.3))
17:53:58 curiousgay joins (~curiousga@77-120-141-90.kha.volia.net)
17:54:34 waleee joins (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4)
17:58:48 hexeme is now known as ldlework
17:59:03 alx741 joins (~alx741@157.100.93.160)
18:01:22 <EvanR> hmm is there a slick ADT which is a list of alternating a and b
18:01:23 × Vajb quits (~Vajb@2001:999:62:f3d1:4390:fbed:1f9b:9d03) (Read error: Connection reset by peer)
18:01:35 <EvanR> first element could be a or b
18:02:19 × jinsun quits (~quassel@user/jinsun) (Read error: Connection reset by peer)
18:03:04 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
18:03:59 jackhill is now known as KM4MBG
18:04:12 <EvanR> data NodeA a b = NodeA a (NodeB a b)
18:04:12 KM4MBG is now known as jackhill
18:04:23 <EvanR> data NodeB a b = NodeB b (NodeA a b)
18:04:29 <geekosaur> % data AB a = ANil | ACons a (BA a); data BA a = BNil | BCons a (AB a)
18:04:29 <yahb> geekosaur:
18:04:52 <xerox> or [Either a b] with smart constructors / view patterns
18:04:56 <EvanR> BCons holds no b
18:05:14 <monochrom> That's probably a typo
18:05:16 <EvanR> yeah
18:05:20 <geekosaur> oh, sorry, missed that part, just had alternating as
18:05:39 <EvanR> so this is slick ... then what is the type of something that takes one xD
18:05:51 <EvanR> Either (AB a b) (BA a b) ...
18:05:52 jinsun joins (~quassel@user/jinsun)
18:06:02 <EvanR> not as slick
18:06:07 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
18:06:20 zebrag joins (~chris@user/zebrag)
18:06:23 <geekosaur> % data AB a b = ANil | ACons a (BA a b)' data BA a b = BNil | BCons b (AB a b)
18:06:23 <yahb> geekosaur: ; <interactive>:143:40: error: parse error on input `data'
18:06:31 <geekosaur> % data AB a b = ANil | ACons a (BA a b); data BA a b = BNil | BCons b (AB a b)
18:06:31 <yahb> geekosaur:
18:07:08 <geekosaur> what you'd do with it, besides possibly building an inefficient rbtree, I dunno
18:07:33 <EvanR> if that is what the data looks like... then it expresses that in types
18:08:21 <EvanR> i guess it needs a 3rd type to act as a container so it could start on A or B
18:08:34 pfurla joins (~pfurla@201.17.118.230)
18:08:36 × aforemny quits (~aforemny@static.248.158.34.188.clients.your-server.de) (Quit: ZNC 1.8.2 - https://znc.in)
18:09:01 <EvanR> i looked at GADT that uses a toggling Bool phantom and realized where I was headed
18:09:09 aforemny joins (~aforemny@static.248.158.34.188.clients.your-server.de)
18:09:18 akegalj joins (~akegalj@141-136-187-255.dsl.iskon.hr)
18:09:30 <monochrom> Heh inefficient rbtree.
18:10:59 <EvanR> if values are like music, types are the notation that gives a partial picture of what the composer wants
18:12:04 <akegalj> why `(+x) 1` is valid and equal to `1+x` while `(-x) 1` is invalid?
18:12:27 <EvanR> which makes dynamic types death metal or something
18:12:41 <geekosaur> akegalj, because of a syntactic oddity
18:13:03 <geekosaur> (-x) is (negate x)
18:13:05 <monochrom> Consider (subtract x)
18:13:19 <geekosaur> becuase unary minus is special cased
18:13:35 <monochrom> But an exception was made.
18:13:39 <geekosaur> (but see the LexicalNegation extension)
18:13:42 <EvanR> :t (x -)
18:13:43 <lambdabot> Expr -> Expr
18:13:50 <EvanR> :t (x +)
18:13:51 <lambdabot> Expr -> Expr
18:14:03 <EvanR> I'm being bamboozled
18:14:14 <geekosaur> simple-reflect strikes again
18:14:20 <monochrom> Syntax decisions are social constructs.
18:14:28 <EvanR> :t (\x -> -(x -))
18:14:29 <lambdabot> (Num a, Num (a -> a)) => a -> a -> a
18:14:35 <EvanR> >:D
18:14:46 <EvanR> wait
18:14:47 <akegalj> monochrom: subtract is ok, thanks!
18:14:51 × Akiva quits (~Akiva@user/Akiva) (Ping timeout: 250 seconds)
18:15:12 <EvanR> @pl (\x -> negate . (x -))
18:15:13 <lambdabot> (negate .) . (-)
18:17:27 DNH joins (~DNH@8.44.0.72)
18:21:29 × slowButPresent quits (~slowButPr@user/slowbutpresent) (Quit: leaving)
18:23:29 lavaman joins (~lavaman@98.38.249.169)
18:24:32 alx741 joins (~alx741@157.100.93.160)
18:27:53 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 252 seconds)
18:29:23 × pfurla quits (~pfurla@201.17.118.230) (Quit: gone to sleep. ZZZzzz…)
18:29:24 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
18:29:38 kranius joins (~kranius@222.186.245.213.rev.sfr.net)
18:30:46 × bollu quits (uid233390@id-233390.helmsley.irccloud.com) (Quit: Connection closed for inactivity)
18:35:11 whatsupdoc joins (uid509081@id-509081.hampstead.irccloud.com)
18:35:32 × zebrag quits (~chris@user/zebrag) (Quit: Konversation terminated!)
18:35:34 × doyougnu quits (~doyougnu@c-73-25-202-122.hsd1.or.comcast.net) (Ping timeout: 260 seconds)
18:35:37 × hgolden quits (~hgolden2@cpe-172-114-81-123.socal.res.rr.com) (Quit: Konversation terminated!)
18:36:23 × kranius quits (~kranius@222.186.245.213.rev.sfr.net) (Ping timeout: 256 seconds)
18:36:42 × dyeplexer quits (~dyeplexer@user/dyeplexer) (Remote host closed the connection)
18:37:09 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:158b:cfc1:e7b3:d4ac) (Remote host closed the connection)
18:37:10 Jing_ joins (~hedgehog@2604:a840:3::103e)
18:39:59 × Jing quits (~hedgehog@2604:a840:3::10c8) (Ping timeout: 252 seconds)
18:41:51 waleee-cl joins (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4)
18:41:57 × waleee quits (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4) (Read error: Connection reset by peer)
18:42:28 × waleee-cl quits (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4) (Client Quit)
18:42:32 × madjestic quits (~madjestic@88-159-247-120.fixed.kpn.net) (Ping timeout: 240 seconds)
18:43:17 waleee joins (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4)
18:43:17 × burnsidesLlama quits (~burnsides@dhcp168-019.wadham.ox.ac.uk) (Remote host closed the connection)
18:46:40 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:158b:cfc1:e7b3:d4ac)
18:47:04 alx741 joins (~alx741@157.100.93.160)
18:48:54 [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470)
18:51:19 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
18:52:19 <Cale> janus: No, they do whatever we would have done with the thing that was supposed to be linearly accessed
18:53:33 <Cale> janus: It's just that if you don't let anyone see what the thing actually is, and you destroy the thing after each use, replacing it with the result of the operation, then you can be sure that it's accessed once.
18:53:34 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
18:54:08 <Cale> (well, at most once, anyway -- the "at least once" part is perhaps a bit trickier)
18:55:48 × hololeap_ quits (~hololeap@user/hololeap) (Read error: Connection reset by peer)
18:57:11 hololeap_ joins (~hololeap@user/hololeap)
19:00:59 × bahamas quits (~lucian@84.232.140.13) (Ping timeout: 250 seconds)
19:05:02 × dhouthoo quits (~dhouthoo@178-117-36-167.access.telenet.be) (Quit: WeeChat 3.3)
19:05:52 coot joins (~coot@89-64-85-93.dynamic.chello.pl)
19:06:05 nfd joins (~nfd@user/nfd)
19:10:03 alx741 joins (~alx741@157.100.93.160)
19:10:07 × curiousgay quits (~curiousga@77-120-141-90.kha.volia.net) (Quit: Leaving)
19:12:01 tzh joins (~tzh@c-24-21-73-154.hsd1.or.comcast.net)
19:12:04 × coot quits (~coot@89-64-85-93.dynamic.chello.pl) (Quit: coot)
19:12:59 × xff0x quits (~xff0x@2001:1a81:52ce:1300:ffd2:54e0:463d:d772) (Ping timeout: 252 seconds)
19:13:59 xff0x joins (~xff0x@2001:1a81:52ce:1300:b1bd:3a1d:cfef:d772)
19:14:06 dsrt^ joins (~dsrt@wsip-98-188-240-142.mc.at.cox.net)
19:14:51 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
19:15:42 × max22- quits (~maxime@2a01cb0883359800f72e75eb3cbff1a0.ipv6.abo.wanadoo.fr) (Ping timeout: 265 seconds)
19:16:54 burnsidesLlama joins (~burnsides@dhcp168-019.wadham.ox.ac.uk)
19:20:58 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
19:23:26 × burnsidesLlama quits (~burnsides@dhcp168-019.wadham.ox.ac.uk) (Ping timeout: 252 seconds)
19:24:07 Morrow joins (~quassel@bzq-110-168-31-106.red.bezeqint.net)
19:30:40 × notzmv quits (~zmv@user/notzmv) (Read error: Connection reset by peer)
19:32:35 alx741 joins (~alx741@157.100.93.160)
19:33:34 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
19:35:55 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
19:38:22 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
19:39:43 jakalx parts (~jakalx@base.jakalx.net) ()
19:40:29 jakalx joins (~jakalx@base.jakalx.net)
19:40:43 curiousgay joins (~curiousga@77-120-141-90.kha.volia.net)
19:40:47 k joins (~user@152.1.137.158)
19:40:54 k is now known as Guest6770
19:41:19 × DNH quits (~DNH@8.44.0.72) (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:41:48 <Guest6770> Is there a way to force the evaluation of statically known arguments (especially dictionaries) while still allowing a function to be inlined?
19:42:52 <Guest6770> I currently switch on a case statement of a `Maybe Dict`, which should be evaluated at compile time to `Just Dict` or `Nothing`.
19:43:15 <Guest6770> But the case statement is hanging around in the compiled core.
19:44:03 DNH joins (~DNH@8.43.122.49)
19:49:31 × darkstardevx quits (~darkstard@50.39.115.145) (Quit: Leaving)
19:51:17 coot joins (~coot@89-64-85-93.dynamic.chello.pl)
19:54:07 bahamas joins (~lucian@84.232.140.13)
19:54:08 neurocyte0132889 joins (~neurocyte@IP-212232092128.dynamic.medianet-world.de)
19:54:08 × neurocyte0132889 quits (~neurocyte@IP-212232092128.dynamic.medianet-world.de) (Changing host)
19:54:08 neurocyte0132889 joins (~neurocyte@user/neurocyte)
19:54:39 alx741 joins (~alx741@157.100.93.160)
19:54:57 <Guest6770> Looks like applying `inline` to the dictionary does the trick.
19:55:38 max22- joins (~maxime@2a01cb0883359800cb0bc7c67be4bc8f.ipv6.abo.wanadoo.fr)
19:58:01 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
19:58:19 × ProfSimm quits (~ProfSimm@87.227.196.109) (Remote host closed the connection)
19:58:33 × bahamas quits (~lucian@84.232.140.13) (Ping timeout: 256 seconds)
19:59:27 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
20:02:30 Akiva joins (~Akiva@user/Akiva)
20:02:54 doyougnu joins (~doyougnu@c-73-25-202-122.hsd1.or.comcast.net)
20:04:47 × hololeap_ quits (~hololeap@user/hololeap) (Read error: Connection reset by peer)
20:04:57 <janus> Cale: even if you disallow serialization of something, i understand that it couldn't be e.g. written to disk. but i still don't understand what type-level feature can prevent something from being used more than once?
20:05:07 × juhp quits (~juhp@128.106.188.82) (Ping timeout: 250 seconds)
20:05:27 × LiaoTao quits (~LiaoTao@gateway/tor-sasl/liaotao) (Ping timeout: 276 seconds)
20:05:42 <Cale> janus: You can take away direct access to the thing altogether though.
20:06:05 <janus> ah, so the linear variables shouldn't even have names, and they should implicitly exist in the context of the monad
20:06:06 × ChaiTRex quits (~ChaiTRex@user/chaitrex) (Ping timeout: 276 seconds)
20:06:10 <Cale> yeah
20:06:42 <janus> then it becomes even harder to mix it with networking
20:06:55 lavaman joins (~lavaman@98.38.249.169)
20:07:32 juhp joins (~juhp@128.106.188.82)
20:07:34 × zaquest quits (~notzaques@5.130.79.72) (Remote host closed the connection)
20:07:37 <janus> or maybe not, i guess it could provide MonadIO independently of this..
20:08:02 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
20:08:28 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
20:08:42 × jpds quits (~jpds@gateway/tor-sasl/jpds) (Ping timeout: 276 seconds)
20:08:52 ChaiTRex joins (~ChaiTRex@user/chaitrex)
20:08:54 zaquest joins (~notzaques@5.130.79.72)
20:08:58 LiaoTao joins (~LiaoTao@gateway/tor-sasl/liaotao)
20:09:04 <Cale> The way I would have done it is to generalise Arrow and split it up so that we'd have a way of supporting all the different types of substructural things, and we wouldn't even really need anything more in the type system
20:09:08 madjestic joins (~madjestic@88-159-247-120.fixed.kpn.net)
20:09:21 <Cale> If we split it up so that not all the structural components were always available, you could take out the operations that let you duplicate and drop things, and then the corresponding generalisation of proc/do notation would give us back the ability to name things
20:10:16 <Cale> If you take that kind of idea far enough, you end up with Conal's constrained categories thing.
20:11:17 × jkaye quits (~jkaye@2601:281:8300:7530:323:f5e4:2678:9ded) (Ping timeout: 252 seconds)
20:11:54 hololeap_ joins (~hololeap@user/hololeap)
20:12:11 ub joins (~Thunderbi@p200300ecdf1abb06cc2914e8ae945344.dip0.t-ipconnect.de)
20:12:36 jgeerds_ joins (~jgeerds@55d4ac73.access.ecotel.net)
20:12:51 bollu joins (uid233390@id-233390.helmsley.irccloud.com)
20:13:49 Guest19 joins (~Guest19@static.14.118.201.195.clients.your-server.de)
20:13:51 × Guest19 quits (~Guest19@static.14.118.201.195.clients.your-server.de) (Client Quit)
20:14:35 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection)
20:14:48 × ChaiTRex quits (~ChaiTRex@user/chaitrex) (Remote host closed the connection)
20:15:35 alx741 joins (~alx741@157.100.93.160)
20:16:24 × hololeap_ quits (~hololeap@user/hololeap) (Read error: Connection reset by peer)
20:20:07 × jgeerds_ quits (~jgeerds@55d4ac73.access.ecotel.net) (Quit: Leaving)
20:20:16 jgeerds joins (~jgeerds@55d4ac73.access.ecotel.net)
20:20:53 zmt01 joins (~zmt00@user/zmt00)
20:21:55 × xff0x quits (~xff0x@2001:1a81:52ce:1300:b1bd:3a1d:cfef:d772) (Ping timeout: 265 seconds)
20:22:25 xff0x joins (~xff0x@2001:1a81:52ce:1300:b0c:6219:b31e:3167)
20:23:39 × azimut_ quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 276 seconds)
20:24:14 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
20:24:49 × zmt00 quits (~zmt00@user/zmt00) (Ping timeout: 265 seconds)
20:26:24 burnsidesLlama joins (~burnsides@dhcp168-019.wadham.ox.ac.uk)
20:26:46 × DNH quits (~DNH@8.43.122.49) (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:27:33 × LiaoTao quits (~LiaoTao@gateway/tor-sasl/liaotao) (Ping timeout: 276 seconds)
20:29:10 bahamas joins (~lucian@84.232.140.13)
20:29:39 azimut joins (~azimut@gateway/tor-sasl/azimut)
20:29:59 FinnElija joins (~finn_elij@user/finn-elija/x-0085643)
20:31:13 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:158b:cfc1:e7b3:d4ac) (Remote host closed the connection)
20:34:06 × bahamas quits (~lucian@84.232.140.13) (Ping timeout: 260 seconds)
20:34:40 × chexum quits (~quassel@gateway/tor-sasl/chexum) (Quit: No Ping reply in 180 seconds.)
20:34:45 × xff0x quits (~xff0x@2001:1a81:52ce:1300:b0c:6219:b31e:3167) (Ping timeout: 252 seconds)
20:35:56 wootehfoot joins (~wootehfoo@user/wootehfoot)
20:35:57 × Digit quits (~user@user/digit) (Ping timeout: 256 seconds)
20:36:24 <oats> https://github.com/oatberry/aoc2021-haskell/blob/main/src/Day10.hs yeet
20:36:25 chexum joins (~quassel@gateway/tor-sasl/chexum)
20:36:31 × kjak quits (~kjak@pool-108-45-56-21.washdc.fios.verizon.net) (Ping timeout: 256 seconds)
20:37:20 <oats> gotta `go` fast
20:37:57 × stiell quits (~stiell@gateway/tor-sasl/stiell) (Ping timeout: 276 seconds)
20:39:19 <d34df00d> There's a bunch of functors that only control some aspect of behaviour (think First or Last or QuickCheck's NonNegative, for instance).
20:39:24 stiell joins (~stiell@gateway/tor-sasl/stiell)
20:40:09 <d34df00d> There's a natural isomorphism (forgetting the behaviour part) between some type a and F a for these functors (witnessed by First and getFirst, etc).
20:40:27 <d34df00d> Is there any library that abstracts that away and allows me to inject/extract the underlying value from such a control/behavioural functor?
20:40:43 ChaiTRex joins (~ChaiTRex@user/chaitrex)
20:41:02 <Taneb> That sounds like lens's Control.Lens.Wrapped, which I think is inspired by something else
20:41:03 <d34df00d> It's super straighforward to roll your own, it's just that I don't want to reinvent the type class if there's a common vocabulary one.
20:41:17 <tomsmeding> do you know about 'coerce'?
20:41:36 <d34df00d> Taneb: thanks, I'll take a look!
20:42:10 <d34df00d> tomsmeding: well, it didn't occur to me it's useful in this context. Not sure if it communicates the intent well enough.
20:42:12 alx741 joins (~alx741@157.100.93.160)
20:42:19 <d34df00d> Dunno, something just feels not right about coerce.
20:42:30 <tomsmeding> d34df00d: First and Last aren't quite isomorphic to the underlying type though, since newtype First a = First (Maybe a)
20:42:31 <oats> why, it's safe :P
20:42:45 <tomsmeding> sure, was just mentioning it in case you weren't aware :)
20:42:49 <geekosaur> isn't the underlying conceopt Iso?
20:43:02 <d34df00d> Oh lol, right. Well, let's think about something First-like for semigroups.
20:43:06 <monochrom> coerce works, but it works much more broadly, and is an operational answer. I think Wrapped may be a mathematical answer.
20:43:19 <monochrom> Or Iso, yeah.
20:43:21 Erutuon joins (~Erutuon@user/erutuon)
20:44:04 <monochrom> Sum and Product are good examples.
20:44:26 xsperry joins (~xs@user/xsperry)
20:44:40 <d34df00d> Sum indeed is a better example than First.
20:45:29 xff0x joins (~xff0x@2001:1a81:52ce:1300:b0c:6219:b31e:3167)
20:47:23 DNH joins (~DNH@8.43.122.49)
20:47:50 fizbin joins (~fizbin@c-73-33-197-160.hsd1.nj.comcast.net)
20:49:27 <Guest6770> Something `First`-like for `Semigroup`s: `First`, from `Data.Semigroup`.
20:50:19 <d34df00d> Very efficient module organization, no room for surprise.
20:50:22 <d34df00d> Haskell is a boring language.
20:50:38 <Guest6770> Just remember to qualify your imports :-)
20:50:45 <d34df00d> Alrighty, Wrapped it is. Thank you folks!
20:52:41 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
20:58:10 × xff0x quits (~xff0x@2001:1a81:52ce:1300:b0c:6219:b31e:3167) (Ping timeout: 265 seconds)
20:58:48 xff0x joins (~xff0x@2001:1a81:52ce:1300:fb1:616f:b19a:8052)
20:58:48 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
20:59:10 <int-e> dminuoso: It's not like I use GADTs everywhere, it's mostly ADTs for expressions (with result type) and existentials. I am attributing ExistentialQuantification to GADTs out of appreciation for the more intuitive (to me, at least) syntax (data HasShow where HS :: ShowA => a -> HasShow doesn't involve an awkwardly placed forall). YMMV
20:59:41 <EvanR> I'm doing this fold to find a minimum float value or Nothing on empty. But for some reason the use of infinity in the middle is alarming me https://paste.tomsmeding.com/seYenSws
21:01:38 × _ht quits (~quassel@82-169-194-8.biz.kpn.net) (Remote host closed the connection)
21:02:52 <EvanR> or maybe the noise from Maybe is alarming
21:03:04 <EvanR> maybe I should embrace infinity
21:05:39 jkaye joins (~jkaye@2601:281:8300:7530:7bc1:436b:e88b:37f9)
21:07:48 jpds joins (~jpds@gateway/tor-sasl/jpds)
21:07:50 Pdroman joins (~Android@197.red-79-156-174.staticip.rima-tde.net)
21:08:52 × DNH quits (~DNH@8.43.122.49) (Quit: Textual IRC Client: www.textualapp.com)
21:10:39 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
21:12:52 × coot quits (~coot@89-64-85-93.dynamic.chello.pl) (Quit: coot)
21:13:18 × Pdroman quits (~Android@197.red-79-156-174.staticip.rima-tde.net) (Quit: AndroidIrc Disconnecting)
21:15:26 alx741 joins (~alx741@157.100.93.160)
21:16:02 <Guest6770> > compare (1 :: Double) (1 / 0)
21:16:03 <lambdabot> LT
21:16:21 <Guest6770> > compare (1 / 0) (1 :: Double)
21:16:22 <lambdabot> GT
21:16:42 <Guest6770> Seems legit.
21:17:23 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:158b:cfc1:e7b3:d4ac)
21:17:34 × Guest6770 quits (~user@152.1.137.158) (Quit: heading home)
21:19:26 <tomsmeding> EvanR: wouldn't that return Nothing if the map containss only inf values?
21:20:57 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
21:21:33 <Taneb> > compare (1 / 0) (1 / 0 :: Double)
21:21:33 × neurocyte0132889 quits (~neurocyte@user/neurocyte) (Read error: Connection reset by peer)
21:21:34 <lambdabot> EQ
21:21:41 <Taneb> > (1 / 0) == (1 / 0 :: Double)
21:21:42 <lambdabot> True
21:21:55 <Taneb> Oh yeah, that's infinity, not nan
21:22:09 <geekosaur> don't need a type ascription due to defaulting and that (/) is Fractional
21:22:13 acidjnk joins (~acidjnk@p200300d0c7271e9405040680e1e3c542.dip0.t-ipconnect.de)
21:22:30 neurocyte0132889 joins (~neurocyte@IP-212232092128.dynamic.medianet-world.de)
21:22:30 × neurocyte0132889 quits (~neurocyte@IP-212232092128.dynamic.medianet-world.de) (Changing host)
21:22:30 neurocyte0132889 joins (~neurocyte@user/neurocyte)
21:23:03 <EvanR> tomsmeding, yep... so just leaving Maybes out of it is turning out simpler
21:25:39 <tomsmeding> half-serious suggestion: newtype Min' a = Min' (Maybe a); instance Ord a => Semigroup (Min' a) where { Min' Nothing <> Min' Nothing = Min' Nothing ; Min' a <> Min' b = Min' (Just (minimum (catMaybes [a, b]))) }; instance Monoid (Min' a) where mempty = Min' Nothing
21:25:56 <tomsmeding> and foldMap Min'
21:26:07 <Taneb> geekosaur: in my particular usage there I thought it benifited from being explicit
21:26:07 <tomsmeding> um, foldMap (Min' . Just)
21:27:11 <tomsmeding> (the ' is because Min is already in Data.Semigroup but lacks the Maybe)
21:27:15 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
21:29:08 EvanR doing a double take at that
21:29:12 <awpr> > Just (Min 5) <> Just (Min 6) -- didn't the Maybe instance get changed to be the same as the above?
21:29:13 <lambdabot> error:
21:29:13 <lambdabot> • Data constructor not in scope: Min :: t0 -> a
21:29:13 <lambdabot> • Perhaps you meant one of these:
21:29:24 <tomsmeding> @let import Data.Semigroup
21:29:24 <lambdabot> <command line>: does not exist: .L.hs
21:29:33 <tomsmeding> % import Data.Semigroup
21:29:33 <yahb> tomsmeding:
21:29:39 <tomsmeding> % Just (Min 5) <> Just (Min 6)
21:29:39 <yahb> tomsmeding: Just (Min {getMin = 5})
21:29:49 <EvanR> that's a lot for foldl' min (1/0) foos
21:30:04 × danso quits (~danso@23-233-111-52.cpe.pppoe.ca) (Ping timeout: 265 seconds)
21:30:32 <tomsmeding> awpr: thanks, that's indeed better
21:30:33 <Taneb> awpr: Nothing sorts less than Just whatever, in this case we want it to sort greater
21:30:41 <tomsmeding> EvanR: type Min' a = Maybe (Min a)
21:30:46 <Taneb> % Nothing <> Just (Min 6)
21:30:46 <yahb> Taneb: Just (Min {getMin = 6})
21:30:52 <Taneb> Oh, am I wrong?
21:31:03 <Taneb> Yeah, I'm being stupid
21:31:06 <Taneb> Carry on :)
21:31:06 <awpr> `min` is different from `<>` here
21:31:09 <Artem[m]> Is ghcup supposed to install profiling version of base? A Reddit user claims that it doesn't do it but I thought it did actually. But I see no mention of it anywhere on the ghcup site. https://www.reddit.com/r/haskell/comments/rh4ase/getting_cabal_to_profile/hooz9qd
21:31:24 <tomsmeding> Taneb: I think the Nothing is the mempty from the Maybe monoid
21:31:50 <awpr> % compare Nothing (Just (Min 6))
21:31:50 <yahb> awpr: LT
21:31:53 <tomsmeding> Artem[m]: ghcup should install profiling versions of base for sure
21:33:18 <tomsmeding> EvanR: though this produces some additional branching on the maybe values through the fold; if you want the nothing in case the map is empty, probably best to handle that case separately and do 'foldl1' min' otherwise :)
21:33:49 × burnsidesLlama quits (~burnsides@dhcp168-019.wadham.ox.ac.uk) (Remote host closed the connection)
21:34:04 <Artem[m]> tomsmeding: thank you for confirming! I wonder if it may depend on the platform or something (e.g. aarch64 has been a curve ball I think).
21:34:32 <EvanR> nah infinity turns out the better
21:35:00 × curiousgay quits (~curiousga@77-120-141-90.kha.volia.net) (Remote host closed the connection)
21:35:13 <tomsmeding> Artem[m]: that perhaps, or maybe OP is using ghcup but forgot that they also have another installation (perhaps from the system package manager) lying around that happens to get precedence or something
21:35:15 <EvanR> my eventual treatment of empty vs "too far in the future" ends up being the same
21:35:33 <tomsmeding> wouldn't be the first person to make that mistake, but no idea if that's also happening here :)
21:35:39 curiousgay joins (~curiousga@77-120-141-90.kha.volia.net)
21:35:40 <tomsmeding> EvanR: awesome :)
21:35:41 × machinedgod quits (~machinedg@24.105.81.50) (Ping timeout: 250 seconds)
21:35:49 benin joins (~benin@183.82.204.250)
21:38:06 zincy joins (~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807)
21:38:52 alx741 joins (~alx741@181.199.42.79)
21:38:54 zincy_ joins (~zincy@host86-151-99-97.range86-151.btcentralplus.com)
21:38:57 × zincy quits (~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807) (Read error: Connection reset by peer)
21:40:15 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
21:42:26 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:158b:cfc1:e7b3:d4ac) (Remote host closed the connection)
21:46:19 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:158b:cfc1:e7b3:d4ac)
21:50:38 × euandreh quits (~euandreh@2804:14c:33:9fe5:80ee:faa6:7302:e610) (Ping timeout: 260 seconds)
21:52:16 × takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection)
21:52:41 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
21:53:30 × alx741 quits (~alx741@181.199.42.79) (Read error: Connection reset by peer)
21:53:55 <monochrom> Yes, sometimes it's useful to equate "never" with "happens at time infinity".
21:54:14 × mc47 quits (~mc47@xmonad/TheMC47) (Remote host closed the connection)
21:54:27 danso joins (~danso@23-233-111-52.cpe.pppoe.ca)
21:55:31 <monochrom> https://perl.plover.com/classes/OOPSLA/samples/slide067.html (Be sure to keep clicking "next" for the subsequent slides to see what it is explaining!)
21:56:02 × lambdalove-sadvi quits (~user@2804:d51:47f5:ac00:9bf5:fb5f:29:c009) (Ping timeout: 240 seconds)
21:57:07 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:158b:cfc1:e7b3:d4ac) (Remote host closed the connection)
21:57:20 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:158b:cfc1:e7b3:d4ac)
21:59:47 takuan joins (~takuan@178-116-218-225.access.telenet.be)
22:04:44 bitmapper joins (uid464869@id-464869.lymington.irccloud.com)
22:04:57 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
22:06:34 × wootehfoot quits (~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer)
22:06:48 × Midjak quits (~Midjak@may53-1-78-226-116-92.fbx.proxad.net) (Quit: This computer has gone to sleep)
22:07:24 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:158b:cfc1:e7b3:d4ac) (Remote host closed the connection)
22:08:03 pfurla[m] joins (uid345156@id-345156.tinside.irccloud.com)
22:08:43 <Hecate> hohai
22:09:13 <Hecate> I have put a path to a .so in extra-lib-dirs (in cabal.project)
22:09:14 <geekosaur> œ
22:09:21 <Hecate> but gcc is unable to find the library in question
22:10:03 alx741 joins (~alx741@157.100.93.160)
22:10:05 <Hecate> the path gives access to libpq.so and GCC gives me
22:10:06 <Hecate> /usr/bin/ld.gold: error: cannot find -lpq
22:10:08 <Hecate> :(
22:11:42 machinedgod joins (~machinedg@24.105.81.50)
22:11:53 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
22:13:27 <geekosaur> I think I'd want to see -v output to see if it gets passed on; in particular with configure-based Setup extra-lib-dirs can end up being ignored because configure thinks it knows better (perhaps especially if there's pkgconfig foo involved?)
22:13:37 euandreh joins (~euandreh@2804:14c:33:9fe5:9d95:c71:11e4:3e0f)
22:13:54 <Clint> Hecate: do you need libpq.so or libpq.a?
22:15:50 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
22:17:02 <Hecate> Clint: oh that's a good question, I don't actually know the answer
22:17:33 <Clint> how are you specifying the library?
22:17:59 <Hecate> I am not, it's postgresql-libpq that does
22:18:22 <Clint> oh, and you're able to build postgresql-libpq?
22:18:22 <Hecate> that being said, let me purge my ldconfig cache
22:18:31 × Nolrai2 quits (~Nolrai2@73.240.1.39) (Quit: Client closed)
22:18:41 <Hecate> Clint: the log stops at one of the direct dependencies
22:18:50 <Hecate> let me try and build postgresql-libpq directly to see
22:20:43 <Hecate> grmph, no apparent problem…
22:21:20 <Hecate> also, weirdly, "/usr/pgsql-14/lib/" appears in /etc/ld.so.conf.d
22:21:38 × son0p quits (~ff@2800:484:1d81:b700:d40b:900:b387:320) (Ping timeout: 252 seconds)
22:21:47 <Hecate> Clint: it would seem that postgresql-libpq uses pkg-config
22:22:02 <Hecate> oh no.
22:22:04 <Hecate> it doesn't
22:22:09 <Hecate> it uses…
22:22:13 <Hecate> ah, pg_config
22:23:18 × euandreh quits (~euandreh@2804:14c:33:9fe5:9d95:c71:11e4:3e0f) (Ping timeout: 260 seconds)
22:23:22 × phma_ quits (phma@2001:5b0:2144:24c8:3448:3cec:586:a41) (Read error: Connection reset by peer)
22:23:27 × michalz quits (~michalz@185.246.204.121) (Remote host closed the connection)
22:24:17 phma_ joins (phma@2001:5b0:210f:4b78:b1e:6610:21b4:b15b)
22:24:35 phma_ is now known as phma
22:25:29 × CiaoSen quits (~Jura@p200300c957347b002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 252 seconds)
22:27:17 × fizbin quits (~fizbin@c-73-33-197-160.hsd1.nj.comcast.net) (Remote host closed the connection)
22:30:09 <Hecate> ugh
22:30:22 <Hecate> I had to add -L /usr/pgsql-14/lib to cabal.project :( :( :(
22:30:31 × chomwitt quits (~chomwitt@2a02:587:dc19:a500:12c3:7bff:fe6d:d374) (Ping timeout: 250 seconds)
22:30:58 × akegalj quits (~akegalj@141-136-187-255.dsl.iskon.hr) (Quit: leaving)
22:32:07 alx741 joins (~alx741@157.100.93.160)
22:32:32 × takuan quits (~takuan@178-116-218-225.access.telenet.be) (Ping timeout: 240 seconds)
22:35:09 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
22:35:43 × earendel quits (uid498179@user/earendel) (Quit: Connection closed for inactivity)
22:36:53 slowButPresent joins (~slowButPr@user/slowbutpresent)
22:39:29 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds)
22:45:01 avidela joins (~textual@88.98.244.170)
22:45:23 euandreh joins (~euandreh@2804:14c:33:9fe5:1e71:dc8c:d2fa:3d7e)
22:45:32 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:158b:cfc1:e7b3:d4ac)
22:45:42 × zincy_ quits (~zincy@host86-151-99-97.range86-151.btcentralplus.com) (Remote host closed the connection)
22:46:28 jakalx parts (~jakalx@base.jakalx.net) ()
22:46:42 jakalx joins (~jakalx@base.jakalx.net)
22:50:12 avidela is now known as zephyz
22:51:58 × lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection)
22:58:13 × zephyz quits (~textual@88.98.244.170) (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:58:14 fizbin joins (~fizbin@c-73-33-197-160.hsd1.nj.comcast.net)
22:58:48 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
23:00:56 avidela joins (~textual@88.98.244.170)
23:02:43 × fizbin quits (~fizbin@c-73-33-197-160.hsd1.nj.comcast.net) (Ping timeout: 256 seconds)
23:03:09 × avidela quits (~textual@88.98.244.170) (Client Quit)
23:06:30 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
23:08:41 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
23:10:40 hololeap_ joins (~hololeap@user/hololeap)
23:10:57 hololeap_ is now known as hololeap
23:16:44 alx741 joins (~alx741@157.100.93.160)
23:16:53 × Erutuon quits (~Erutuon@user/erutuon) (Ping timeout: 256 seconds)
23:19:45 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:158b:cfc1:e7b3:d4ac) (Remote host closed the connection)
23:20:12 abhixec joins (~abhixec@c-67-169-139-16.hsd1.ca.comcast.net)
23:20:17 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
23:21:16 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
23:21:29 × abhixec quits (~abhixec@c-67-169-139-16.hsd1.ca.comcast.net) (Read error: Connection reset by peer)
23:21:59 sagax joins (~sagax_nb@user/sagax)
23:22:31 lavaman joins (~lavaman@98.38.249.169)
23:24:09 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
23:26:37 × ubert quits (~Thunderbi@p200300ecdf1abb061518ea9ba8d342d1.dip0.t-ipconnect.de) (Read error: Connection reset by peer)
23:26:37 ub is now known as ubert
23:27:05 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 252 seconds)
23:27:44 <Axman6> Hecate: isn't that soimething that pg_config can do for you?
23:28:33 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:158b:cfc1:e7b3:d4ac)
23:29:22 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Remote host closed the connection)
23:31:06 geekosaur joins (~geekosaur@xmonad/geekosaur)
23:31:27 pfurla joins (~pfurla@177.25.189.1)
23:32:29 × Inst quits (~Inst@2601:6c4:4080:3f80:7939:82b5:8236:6c32) (Remote host closed the connection)
23:32:46 Inst joins (~Inst@2601:6c4:4080:3f80:d9b5:7230:29a1:ab4d)
23:34:14 × cosimone quits (~user@93-47-228-203.ip115.fastwebnet.it) (Ping timeout: 252 seconds)
23:34:38 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
23:37:04 × Inst quits (~Inst@2601:6c4:4080:3f80:d9b5:7230:29a1:ab4d) (Remote host closed the connection)
23:37:22 Inst joins (~Inst@2601:6c4:4080:3f80:d9b5:7230:29a1:ab4d)
23:37:39 alx741 joins (~alx741@157.100.93.160)
23:40:46 × Ainoretho quits (~ypw@huji-132-64-244-88.xt.huji.ac.il) (Ping timeout: 245 seconds)
23:42:29 × gentauro quits (~gentauro@user/gentauro) (Ping timeout: 252 seconds)
23:42:29 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
23:42:46 × gentauro_ quits (~gentauro@185.107.12.141) (Ping timeout: 268 seconds)
23:43:30 notzmv joins (~zmv@user/notzmv)
23:45:01 × mikoto-chan quits (~mikoto-ch@esm-84-240-99-143.netplaza.fi) (Quit: mikoto-chan)
23:45:07 × Inst quits (~Inst@2601:6c4:4080:3f80:d9b5:7230:29a1:ab4d) (Read error: Connection reset by peer)
23:45:25 Inst joins (~Inst@2601:6c4:4080:3f80:d9b5:7230:29a1:ab4d)
23:45:49 <janus> Axman6: how do you call pg_config from cabal.project? does it have shell interpolation :O ?
23:47:01 × Jing_ quits (~hedgehog@2604:a840:3::103e) (Remote host closed the connection)
23:47:41 Jing joins (~hedgehog@2604:a840:3::103e)
23:49:29 <geekosaur> ideally whatever it is that actually needs it would call it itself
23:49:38 × Inst quits (~Inst@2601:6c4:4080:3f80:d9b5:7230:29a1:ab4d) (Ping timeout: 252 seconds)
23:49:43 <geekosaur> then again that probably requires custom Setup
23:52:46 Tuplanolla joins (~Tuplanoll@91-159-68-169.elisa-laajakaista.fi)
23:54:33 Guest27 joins (~Guest27@cpc148070-lewi21-2-0-cust347.2-4.cable.virginm.net)
23:55:55 × Guest27 quits (~Guest27@cpc148070-lewi21-2-0-cust347.2-4.cable.virginm.net) (Client Quit)

All times are in UTC on 2021-12-15.