Home liberachat/#haskell: Logs Calendar

Logs on 2022-12-09 (liberachat/#haskell)

00:00:38 <hpc> also, often in programming the two are uncomfortably similar
00:00:49 <monochrom> Did I tell you this plot line from a novel? 4 persons sworn to keep a secret; but one of them was evil and used the wording "I won't tell the 5th person". Later, at a conference of like 100 people, he told the secret. His defense: "Who is the 5th person?"
00:00:54 <hpc> "do i move $0 to this register or xor it with itself" isn't something anyone wants to be aware of, but they do want fast code
00:02:41 <iqubic> The next thing I'm confused by is why there's no lens function called "arrayOf" that constructs an Array from an IndexedTraversal like "toMapOf"
00:03:11 × waleee quits (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Ping timeout: 264 seconds)
00:03:12 <c_wraith> It doesn't really add anything on top of composing with listarray
00:03:36 <jackdk> I suspect it's also because you cannot guarantee that the traversal visits every index
00:03:56 <monochrom> My understanding of human nature and Aesop fables is that I am confused that any function is written at all.
00:04:15 <hpc> monochrom: the function was always there, waiting to be discovered
00:04:40 <monochrom> Humans are supposed to be like "someone else should write that function" and end with a Mexican standoff impasse.
00:04:51 × hippoid quits (~idris@user/hippoid) (Quit: WeeChat 3.5)
00:05:26 × azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds)
00:05:26 × califax quits (~califax@user/califx) (Ping timeout: 255 seconds)
00:05:26 × stiell quits (~stiell@gateway/tor-sasl/stiell) (Ping timeout: 255 seconds)
00:05:26 × ec_ quits (~ec@gateway/tor-sasl/ec) (Ping timeout: 255 seconds)
00:06:02 <EvanR> all functions are chiseled out of the master function that does everything
00:06:39 <iqubic> What's the master function do?
00:06:40 <hpc> EvanR: that's amusingly close to a real thing - https://dolphin-emu.org/blog/2017/07/30/ubershaders/
00:07:05 × zeenk quits (~zeenk@2a02:2f04:a30d:4300::7fe) (Quit: Konversation terminated!)
00:07:37 azimut joins (~azimut@gateway/tor-sasl/azimut)
00:08:17 ec_ joins (~ec@gateway/tor-sasl/ec)
00:08:29 califax joins (~califax@user/califx)
00:08:31 <hpc> iqubic: if you're still indecisive after all this discussion, i say break the tie in your head with Vector and wait until your code annoys you to regret the decision
00:08:32 stiell joins (~stiell@gateway/tor-sasl/stiell)
00:09:47 <EvanR> I found Vector of Vector of whatever to be easier to write than Array (Int,Int) because it wasn't symmetric
00:10:06 <EvanR> I kept working with the transposed array all the time
00:13:11 <jackdk> https://joearms.github.io/published/2013-11-21-My-favorite-erlang-program.html is the closest thing to a master function I've ever seen
00:15:19 <hpc> that's pretty neat
00:15:33 <hpc> and really does best exemplify erlang
00:15:46 waleee joins (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340)
00:16:47 <hpc> one of my favorite little tricks in haskell is a forkIO thread that does nothing but read from a Chan (IO ()) it closes over and run that action
00:17:50 <hpc> great for when i don't feel like dealing with dependencies yet :D
00:18:31 <jackdk> Oh that's fun
00:18:31 <c_wraith> you can do fun stuff in ghci that way too, like working interactively with things that normally need some kind of transformer over IO
00:19:07 <c_wraith> just start up the environment, then send actions to it
00:19:57 emmanuelux joins (~emmanuelu@user/emmanuelux)
00:20:44 <hpc> jackdk: yeah - i have this not-really-a-joke that haskell is my favorite imperative language and perl is my favorite functional language
00:20:49 <hpc> and first-class IO is why
00:21:32 <iqubic> Why is perl a functional language?
00:22:10 <hpc> perl's function calling conventions are extremely flexible
00:22:31 <hpc> so like, a simple example with list flattening:
00:22:42 <hpc> you have some function that does stuff, and it takes named parameters
00:23:00 <hpc> so you can write foo(option1 => value1, option2 => value2)
00:23:13 <hpc> but you almost always want option1 to be value3
00:23:39 <hpc> well, the function actually just takes a "list", which can be array-ish or hash-ish or some combination
00:24:23 <hpc> so you can write sub bar { foo(option1 => value3, @_); }
00:24:34 <hpc> and now if you call bar(option2 => value2), option1 is value3
00:24:47 <hpc> or you can call bar(option1 => value1, option2 => value2), and it's value1 instead
00:25:14 <hpc> and of course, both foo and that defaults thing can be parameters
00:25:40 <hpc> sub mkdefaults { my ($fun, $defaults) = @_; return sub { $fun->(%$defaults, @_); }; }
00:26:13 <hpc> sub mkdefaults { my ($fun, @defaults) = @_; return sub { $fun->(@defaults, @_); }; } # er, meant to write this
00:26:34 <hpc> so now you can write $bar = mkdefaults(\&foo, option1 => value3);
00:26:48 × acidjnk_new quits (~acidjnk@p200300d6e7137a16f8a8efad5ebd7081.dip0.t-ipconnect.de) (Ping timeout: 260 seconds)
00:27:57 <hpc> and that's not to mention what you can do with regexes and block arguments
00:28:29 <hpc> (regexes can call functions in perl)
00:29:27 <monochrom> The Erlang universal server sounds dangerously close to unix inetd of the past and systemd socket activation today. :)
00:30:38 <hpc> socket activation is more like lazy IO over a network imo
00:31:00 <hpc> you "start" the server but don't actually run any code until something connects
00:31:16 <hpc> like how a file handle ends up half-open with hGetContents
00:32:04 pja joins (~pja@2a02:8010:6098:0:e65f:1ff:fe1f:660f)
00:33:19 azimut_ joins (~azimut@gateway/tor-sasl/azimut)
00:33:20 × azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds)
00:33:38 × gurkenglas quits (~gurkengla@p548ac72e.dip0.t-ipconnect.de) (Ping timeout: 268 seconds)
00:47:05 × jpds2 quits (~jpds@gateway/tor-sasl/jpds) (Remote host closed the connection)
00:47:48 redmp joins (~redmp@mobile-166-170-36-4.mycingular.net)
00:47:52 jpds2 joins (~jpds@gateway/tor-sasl/jpds)
00:48:56 <redmp> Hello! I have a question about typeclasses: <https://termbin.com/b8z6> In this example, the C₁ instance can see the A instance, but the C₂ cannot. Why not?
00:49:30 thegeekinside joins (~thegeekin@189.217.82.244)
00:51:53 × Vajb quits (~Vajb@2001:999:504:3ad6:52a4:a3b5:32d8:e74d) (Ping timeout: 252 seconds)
00:55:55 <jackdk> There's probably a good reason like "an instance must directly mention all declared superclasses" but I don't know what it is.
00:56:04 <jackdk> If you don't get an answer, maybe try the Discourse?
00:59:59 <EvanR> hpc, I'm not sure I understand the role of the thread + Chan (IO ()) for the purposes of not dealing with dependencies
01:00:03 × Guest75 quits (Guest75@2a01:7e01::f03c:92ff:fe5d:7b18) (Ping timeout: 260 seconds)
01:01:41 <redmp> jackdk: Here's a sentence from the 2010 report that seems to contradict the behavior in that snippet:
01:01:44 <redmp> "The constraints expressed by the superclass context cx[(T u1 … uk)∕u] of C must be satisfied. In other words, T must be an instance of each of C’s superclasses and the contexts of all superclass instances must be implied by cx′. "
01:02:05 <monochrom> Short answer: You are lacking an "instance A x where ...".
01:02:12 × perrierjouet quits (~perrier-j@modemcable048.127-56-74.mc.videotron.ca) (Quit: WeeChat 3.7.1)
01:02:16 <hpc> EvanR: it's a janky way of getting 80% of https://hackage.haskell.org/package/async
01:02:20 <monochrom> This is exactly the same as the following.
01:02:43 <redmp> jackdk: https://www.haskell.org/onlinereport/haskell2010/haskellch4.html#x10-770004.3.2
01:02:54 <monochrom> Because "class Eq a => Ord a", if you add "instance Ord Foo" then you also need to add "instance Eq Foo".
01:03:03 <monochrom> Yes, because.
01:03:09 wroathe joins (~wroathe@207-153-38-140.fttp.usinternet.com)
01:03:09 × wroathe quits (~wroathe@207-153-38-140.fttp.usinternet.com) (Changing host)
01:03:09 wroathe joins (~wroathe@user/wroathe)
01:03:53 <EvanR> hpc, the only difference from just executing all the IO as is in all the threads is some kind of global serialization?
01:04:09 perrierjouet joins (~perrier-j@modemcable048.127-56-74.mc.videotron.ca)
01:04:27 <redmp> monochrom: But C₂ has an instance of A under the assumption that it has an instance of B, which is stated in C₂'s instance context.
01:05:02 <monochrom> That is a wrong interpretation.
01:05:50 × Topsi quits (~Topsi@dyndsl-095-033-225-177.ewe-ip-backbone.de) (Read error: Connection reset by peer)
01:05:58 <hpc> EvanR: it's just that it gets put in the background in a close-enough way to test an idea
01:06:06 <monochrom> Instead, an author of "instance ... C2 Foo" has the obligation, not the assumption, to add "instance ... A Foo". As said.
01:06:19 <hpc> the fact that it's still all sort of serial doesn't matter as much as my being able to carry on in the main thread
01:06:29 <monochrom> This is also what the Haskell Report clause you quoted says.
01:06:29 <EvanR> Oh I see, a cheap way to run a side action without spawning a thread
01:06:34 <hpc> and it's like 4 lines of code
01:06:34 <EvanR> with no way to get the result
01:06:41 <hpc> yeah
01:06:42 <redmp> monochrom: C₁ can use 'a' in its implementatino and doesn't add an instance of A anywhere because C₁ has B in its context.
01:07:11 <EvanR> though wouldn't that be equivalent to... forkIO io
01:07:21 <redmp> Ugh, this is difficult .. sorry, my last sentence is confusing b/c I didn't state when I'm talking about an instance or a class.
01:07:24 <EvanR> writeChan ch io <=> forkIO io
01:07:30 <monochrom> C1 is different from C2.
01:07:42 <EvanR> except for the serialization
01:07:43 <geekosaur> monochrom, I would question that because the context can't be discharged until a use site, not the instance declaration, no?
01:07:55 <monochrom> C1 is simply "class C1" so it actually imposes fewer obligations on instance authors.
01:08:40 <monochrom> OK, everything you say, use it to explain why "instance Ord Foo" is rejected until "instanace Eq Foo" exists.
01:08:40 <hpc> EvanR: in the simplest case yeah, but it's also got a bit of flexibility in it
01:08:51 werneta joins (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
01:09:02 <hpc> maybe instead of Chan (IO ()) it's Chan (a -> IO ()) or something, and i have some useful other thing closed over
01:09:11 <hpc> or instead of forkIO, it's forkOS and that's actually the opengl thread
01:09:12 <monochrom> My simple theory explains it. Your theories don't.
01:09:20 <EvanR> ah
01:09:50 <EvanR> Chan (a -> IO ()) with something useful closed over, hey look, more globals
01:09:55 <EvanR> OOP eat your heart out
01:10:04 <monochrom> And damn right "class X => Y" is not "instance X => Y". In fact very opposite.
01:10:15 <hpc> in the project i came up with that idiom in, it wasn't one thread
01:10:23 × albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection)
01:10:23 <monochrom> One could almost argue that one of those =>'s should have been <=
01:10:24 <redmp> monochrom: have i hit a nerve?
01:10:39 <hpc> i had a supervisor thread dynamically resizing a pool that all consumed from the same channel, for load testing
01:11:13 <EvanR> enough stockholm syndrome has me reading class Eq a => Ord a where from right to left
01:11:24 <EvanR> I know it says => but I think <=
01:11:49 <hpc> heh, i just think of the base type classes and "know what it means"
01:12:07 <hpc> and then get as confused as redmp when the names are reduced to A/B/C :P
01:14:05 × thegeekinside quits (~thegeekin@189.217.82.244) (Remote host closed the connection)
01:14:35 × EvanR quits (~EvanR@user/evanr) (Remote host closed the connection)
01:14:48 <monochrom> In "instance B x => C1 x", the "B x =>" is used to check "c1 = a" only.
01:14:56 troydm joins (~troydm@host-176-37-124-197.b025.la.net.ua)
01:15:25 EvanR joins (~EvanR@user/evanr)
01:15:28 <monochrom> It is not used to help accept "you can make x an instance of C1" at all.
01:15:44 <monochrom> And it does not help accept "you can make x an instance of C2" either.
01:16:11 <monochrom> Those of us who survived the Functor-Applicative-Monad transition know it very well.
01:16:30 albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8)
01:16:57 <monochrom> We had all kinds of "instance <possibly constraints => > Monad Foo" without any "instance Functor Foo" or "instance Applicative Foo".
01:17:27 × chomwitt quits (~chomwitt@athedsl-351826.home.otenet.gr) (Read error: Connection reset by peer)
01:17:28 <monochrom> Suddenly base added "class Functor => Applicative" and "class Applicative => Monad", we had to add those extra instances.
01:17:47 <monochrom> IT DID NOT MATTER WHAT WE HAD IN <possibly constraints => >
01:18:06 <redmp> it seems i hit a nerve
01:18:17 biancospino joins (~biancospi@host-212-171-55-162.pool212171.interbusiness.it)
01:18:22 <monochrom> Sure.
01:18:32 <geekosaur> are you, uh, paying attention?
01:18:47 <geekosaur> or just whining about having hit a nerve?
01:19:15 <redmp> i dunno, monochrom is the one using caps when all i did was ask a question and then seek clarification, once
01:19:34 <redmp> Here's a quote from the 2010 report https://termbin.com/yo1n
01:20:38 biancospino parts (~biancospi@host-212-171-55-162.pool212171.interbusiness.it) ()
01:20:38 <monochrom> Well I can stop. You won't get further information.
01:20:44 <redmp> ???
01:20:59 <monochrom> I can complain "all I did was give an honest answer", too.
01:21:33 <EvanR> what is the current topic / question
01:22:15 <redmp> uh, i just found some behavior i didn't understand and i asked why it works like that
01:22:29 <monochrom> And I answered why it works like that.
01:22:50 <monochrom> It's also a very simple answer.
01:23:37 <redmp> If I can paraphrase your answer, it seems like you said: The constraints mentioned by the class declaration have to be repeated by instance declarations, and there's no flexibility on that point.
01:23:44 <redmp> Is that a correct understanding of your answer?
01:23:53 <monochrom> No.
01:24:24 <EvanR> constraints mentioned in the class declaration have to be satisfied somehow for your instances, one way or another
01:25:13 <monochrom> The "satisfied" there is still ambiguous.
01:25:30 <monochrom> "repeated by instance declarations" is also ambiguous.
01:25:38 <hpc> "class A x => B x" means "to write an instance B x, you must also write an instance A x"
01:25:51 ddellacosta joins (~ddellacos@89.45.224.208)
01:25:57 <monochrom> Both could be interpreted as "instance Eq Foo => Ord Foo" which is wrong.
01:25:59 × xff0x quits (~xff0x@ai071162.d.east.v6connect.net) (Ping timeout: 264 seconds)
01:26:07 <monochrom> Yes, see, what hpc said.
01:26:24 <hpc> "instance A x => B x" means "this instance covers all x, but you can only use the instance in contexts where you have instance A x, whatever x is"
01:27:00 <hpc> so say you wrote "instance A x => B x where b = whatever"
01:27:13 <hpc> and now elsewhere in your code you write "example = b 100"
01:27:31 <hpc> that will only typecheck if you have instance A Int
01:29:02 <hpc> you generally don't want to write "instance A x => B x", for reasons that are hard to understand without a bunch of other type class knowledge
01:29:20 eggplantade joins (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net)
01:29:37 <redmp> So is this a difference of *when* the constraint is enforced? The class constraint is enforced where the instance is defined, but the instance constraint is enforced where the methods are used?
01:29:41 <hpc> the docs for OverlappingInstances might be a good place to start for background on thata
01:30:57 <hpc> redmp: that's probably a good working understanding of it, yeah
01:31:28 <redmp> ok, thank you hpc and monochrom
01:31:32 <mrkun[m]> https://www.youtube.com/watch?v=OPGd5p_W_LM talks exactly about the original case, if you don't mind video
01:31:42 <hpc> you'll find later that "enforced" is a fuzzy way of talking about how instances get resolved and such
01:31:42 <redmp> i'll take a look
01:31:47 <EvanR> you don't necessarily have to write an instance B x directly, it could provided by a more general instance, based on something else
01:32:24 × money_ quits (~money@user/polo) (Quit: money_)
01:33:57 <EvanR> er, I meant A
01:34:00 × eggplantade quits (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 260 seconds)
01:34:30 <monochrom> I don't think you can get more general than "instance A x" especially with "x" being a type variable. :)
01:35:02 <EvanR> some instance declarations produce instances for a family of types at a time, based on more prereqs
01:35:16 <EvanR> yeah for some reason I thought x was a metasyntactic variable here not literally a type variable
01:37:12 <hpc> heh, yeah i hate when that sort of confusion happens to me
01:37:21 <hpc> i try and always name my metasyntactic variables things like "expr"
01:37:49 <EvanR> when teachers ask "what is x", they have no idea
01:38:29 <hpc> one of my coworkers never properly learned what a graph was
01:38:30 <EvanR> what they're getting into!
01:38:42 <hpc> i drew a sine wave on his whiteboard and he said "i have no idea what that is"
01:39:08 <hpc> it's funny how easily you get used to some things being common knowledge
01:39:29 <jean-paul[m]> how ... what ... how do you get out of grade school without knowing what a graph is
01:39:40 <hpc> but if i had to explain the difference between a variable and a metasyntactic variable, i don't think i could
01:39:45 <monochrom> Selective amnesia.
01:39:51 <EvanR> I thought graph was going to be something else
01:40:22 <EvanR> something about dijkstra
01:40:35 <monochrom> You know how after exams, students are like "now I can forget all this stuff".
01:40:50 <hpc> jean-paul[m]: you'd be surprised how far you can go sometimes just by mushing notation together
01:41:04 <hpc> (and admittedly also by how far you don't really have to go to graduate)
01:41:22 <hpc> i got through a lot of physics work by ignoring reality and doing unit conversions
01:41:50 <hpc> m**2 to m, multiply by 2/x, and such
01:41:58 <EvanR> i got the impression that the basic levels at my high school were lessons in patience, just sit in the room for 4 years. And they will throw you a party at the end
01:42:19 <hpc> (funny enough, this was before i learned calc)
01:42:40 <hpc> sometimes the adapation to not learn something is more effective than learning it
01:47:35 <redmp> quit
01:47:36 × redmp quits (~redmp@mobile-166-170-36-4.mycingular.net) (Quit: leaving)
01:51:00 <monochrom> Cynically and radically extremistly, I am not convinced that any essay writing "in your own words to show you understand" is any more than mushing notation together.
01:51:20 <monochrom> Or at least most essay writing.
01:52:14 <hpc> there's a thing on that which i can't find now
01:52:32 <c_wraith> "write a more convincing explanation of why you know something than the latest GPT model"
01:52:34 <hpc> called "gaming the test" or something like that
01:52:54 <monochrom> Ah yes people game the tests all the time.
01:52:56 <hpc> where you aren't actually trained in class to know material, you're trained to satisfy the teacher's grading function
01:53:22 <hpc> in a math class that might be "show your work confidently no matter how wrong you are"
01:53:40 <hpc> in a literature class it might be "in the old man and the sea, joe dimaggio is jesus"
01:54:16 <monochrom> My university has insane TOEFL score requirements for foreign students. The East Asian students we get are still very broken in very basic English grammar.
01:54:17 <hpc> you don't have to believe it, you just have to write it, chinese room style
01:54:52 <monochrom> Explanation: They got insane TOEFL scores by remembering insane long obscure words in the dictionary, not by figuring out English.
01:55:01 × ezzieyguywuf quits (~Unknown@user/ezzieyguywuf) (Remote host closed the connection)
01:55:11 <hpc> ah, interesting
01:55:34 <hpc> i guess it's like that old ms word feature that said "your document is at an 8th grade reading level" or whatever?
01:56:03 <hpc> as long as you just keep using prepositions your score goes up and up
01:56:10 ezzieyguywuf joins (~Unknown@user/ezzieyguywuf)
01:56:43 <monochrom> Wait, joe dimaggio is jesus??!!
01:56:57 <hpc> monochrom: it's been decades and i am still bitter about that class
01:57:01 monochrom didn't get that back then when reading the old man and the sea.
01:57:14 monochrom didn't even remember the person's name, dammit
01:57:32 × ezzieyguywuf quits (~Unknown@user/ezzieyguywuf) (Remote host closed the connection)
01:57:43 <hpc> i don't think the old man had a name
01:57:50 <hpc> but he had a radio on the boat, and listened to baseball
01:57:54 <jackdk> I recently a joke that GPT stood for "Guessing the Password of the Teacher"
01:58:06 <hpc> jackdk: i think that's actually what it was called
01:58:20 <monochrom> btw I read a Chinese translation. That might hurt, too.
01:58:32 <hpc> https://www.lesswrong.com/posts/NMoLJuDJEms7Ku9XS/guessing-the-teacher-s-password
01:58:39 ezzieyguywuf joins (~Unknown@user/ezzieyguywuf)
01:59:01 <monochrom> haha
01:59:24 <jackdk> yeah it was a reference to that LW article
01:59:48 <hpc> i mean, that's the thing i was forgetting the name of :D
02:03:44 <monochrom> OK today I learn that wakalixes is a good password. >:)
02:04:05 <hpc> ill remember it the next time i need to log into your email
02:04:50 × beteigeuze quits (~Thunderbi@85.247.81.220) (Ping timeout: 246 seconds)
02:13:23 × Unicorn_Princess quits (~Unicorn_P@user/Unicorn-Princess/x-3540542) (Remote host closed the connection)
02:13:35 xff0x joins (~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp)
02:17:17 × azimut_ quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds)
02:18:02 azimut joins (~azimut@gateway/tor-sasl/azimut)
02:26:13 × inversed quits (~inversed@bcdcac82.skybroadband.com) (Read error: Connection reset by peer)
02:27:11 notzmv joins (~zmv@user/notzmv)
02:27:29 razetime joins (~quassel@49.207.203.213)
02:28:58 inversed joins (~inversed@bcdcac82.skybroadband.com)
02:35:15 instantaphex joins (~jb@c-73-171-252-84.hsd1.fl.comcast.net)
02:41:00 lisbeths joins (uid135845@id-135845.lymington.irccloud.com)
02:43:06 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection)
02:43:46 FinnElija joins (~finn_elij@user/finn-elija/x-0085643)
02:45:22 × mmhat quits (~mmh@p200300f1c73b51d2ee086bfffe095315.dip0.t-ipconnect.de) (Quit: WeeChat 3.7.1)
02:50:04 × bontaq quits (~user@ool-45779fe5.dyn.optonline.net) (Ping timeout: 260 seconds)
02:52:38 × Kaiepi quits (~Kaiepi@108.175.84.104) (Ping timeout: 260 seconds)
02:53:17 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 255 seconds)
02:56:02 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
03:00:02 <EvanR> stupid question, what is "unlifted" and or "to unlift" / "unlifting" something
03:00:09 <EvanR> are they even related
03:05:01 mvk joins (~mvk@2607:fea8:5ce3:8500::efb)
03:05:07 × mvk quits (~mvk@2607:fea8:5ce3:8500::efb) (Client Quit)
03:16:24 × emmanuelux quits (~emmanuelu@user/emmanuelux) (Quit: au revoir)
03:16:31 jinsun joins (~jinsun@user/jinsun)
03:17:52 eggplantade joins (~Eggplanta@2600:1700:38c5:d800:30d2:fcaf:3b1c:ad43)
03:19:10 <monochrom> Depends on context.
03:19:55 <monochrom> But I think there is an "unlifted" library that's about bringing forkIO or bracket to StateT IO etc.
03:21:51 <jackdk> Unless he's talking about unlifted data types?
03:22:17 <EvanR> let the answer be in the list monad xD
03:22:28 <EvanR> so far there's two possibilities
03:24:35 <ddellacosta> weird I was just this second thinking about this https://www.fpcomplete.com/blog/2017/07/announcing-new-unliftio-library/
03:26:07 <EvanR> so in unliftIO, is it supposed to be the opposite of lifting (transformer jargon) ?
03:26:42 zmt01 joins (~zmt00@user/zmt00)
03:27:05 tcard_ joins (~tcard@2400:4051:5801:7500:cf17:befc:ff82:5303)
03:27:17 pflanze_ joins (~pflanze@159.100.249.232)
03:27:28 tzh_ joins (~tzh@c-24-21-73-154.hsd1.wa.comcast.net)
03:27:31 poljar1 joins (~poljar@93-139-83-160.adsl.net.t-com.hr)
03:27:36 Luj30 joins (~Luj@2a01:e0a:5f9:9681:5880:c9ff:fe9f:3dfb)
03:27:45 rune_ joins (sid21167@id-21167.ilkley.irccloud.com)
03:27:46 ozkutuk53 joins (~ozkutuk@176.240.173.153)
03:27:46 idnar_ joins (sid12240@debian/mithrandi)
03:27:48 arkeet` joins (arkeet@moriya.ca)
03:27:48 econo_ joins (uid147250@user/econo)
03:28:07 scav_ joins (sid309693@user/scav)
03:28:09 mxs_ joins (~mxs@user/mxs)
03:28:28 sclv_ joins (sid39734@haskell/developer/sclv)
03:28:32 totbwf_ joins (sid402332@id-402332.uxbridge.irccloud.com)
03:28:33 meinside_ joins (uid24933@id-24933.helmsley.irccloud.com)
03:28:41 jludwig89 joins (~justin@li657-110.members.linode.com)
03:28:42 poscat0x04 joins (~poscat@2408:8206:4821:f702:d964:a961:eb17:d7fd)
03:28:43 Fangs_ joins (sid141280@id-141280.hampstead.irccloud.com)
03:28:52 jrm2 joins (~jrm@user/jrm)
03:28:53 coderpat- joins (~coderpath@d66-183-126-83.bchsia.telus.net)
03:28:57 pieguy128_ joins (~pieguy128@bras-base-mtrlpq5031w-grc-43-67-70-144-160.dsl.bell.ca)
03:29:13 <monochrom> So I think it's called "unlift" because to have some kind of bracket for StateT IO, first you have to bring StateT IO down to IO level, because bracket requires that.
03:29:19 FragByte_ joins (~christian@user/fragbyte)
03:29:32 gawen_ joins (~gawen@user/gawen)
03:29:35 mud joins (~mud@user/kadoban)
03:29:49 nek09 joins (~nek0@2a01:4f8:222:2b41::12)
03:30:10 hrberg_ joins (~quassel@171.79-160-161.customer.lyse.net)
03:30:14 potash_ joins (~foghorn@94.225.47.8)
03:30:30 xnbya2 joins (~xnbya@2a01:4f8:c17:cbdd::1)
03:30:46 shriekingnoise_ joins (~shrieking@186.137.167.202)
03:30:47 lbseale_ joins (~quassel@user/ep1ctetus)
03:30:52 haveo_ joins (~haveo@sl35.iuwt.fr)
03:31:00 meooow_ joins (~meooow@2400:6180:100:d0::ad9:e001)
03:31:01 tinwood_ joins (~tinwood@general.default.akavanagh.uk0.bigv.io)
03:31:03 tomku|two joins (~tomku@user/tomku)
03:31:06 mauke_ joins (~mauke@user/mauke)
03:31:20 finn_elija joins (~finn_elij@user/finn-elija/x-0085643)
03:31:20 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija)))
03:31:20 finn_elija is now known as FinnElija
03:31:32 mjacob_ joins (~mjacob@adrastea.uberspace.de)
03:31:35 mtjm_ joins (~mutantmel@2604:a880:2:d0::208b:d001)
03:31:43 masterbu1lder joins (~master@user/masterbuilder)
03:31:44 wroathe_ joins (~wroathe@207-153-38-140.fttp.usinternet.com)
03:31:52 xff0x_ joins (~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp)
03:31:53 finstern1s joins (~X@23.226.237.192)
03:32:53 mimmy_ joins (~mimmy@2604:a880:cad:d0::3e:1001)
03:32:59 terrorjack7 joins (~terrorjac@2a01:4f8:1c1e:509a::1)
03:33:00 Erutuon_ joins (~Erutuon@user/erutuon)
03:33:48 × wroathe quits (~wroathe@user/wroathe) (Killed (NickServ (GHOST command used by wroathe_!~wroathe@207-153-38-140.fttp.usinternet.com)))
03:33:51 wroathe_ is now known as wroathe
03:34:06 × wroathe quits (~wroathe@207-153-38-140.fttp.usinternet.com) (Client Quit)
03:34:31 × sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.)
03:34:32 <EvanR> ah
03:34:49 × econo quits (uid147250@user/econo) (Ping timeout: 256 seconds)
03:34:49 × poscat quits (~poscat@2408:8206:4821:f702:d964:a961:eb17:d7fd) (Ping timeout: 256 seconds)
03:34:49 × jludwig quits (~justin@user/jludwig) (Ping timeout: 256 seconds)
03:34:49 × mxs quits (~mxs@user/mxs) (Ping timeout: 256 seconds)
03:34:49 × rune quits (sid21167@id-21167.ilkley.irccloud.com) (Ping timeout: 256 seconds)
03:34:49 × mimmy quits (~mimmy@159.203.19.37) (Ping timeout: 256 seconds)
03:34:49 econo_ is now known as econo
03:34:49 × TheCoffeMaker quits (~TheCoffeM@user/thecoffemaker) (Ping timeout: 256 seconds)
03:34:49 × FragByte quits (~christian@user/fragbyte) (Ping timeout: 256 seconds)
03:34:50 × sclv quits (sid39734@haskell/developer/sclv) (Ping timeout: 256 seconds)
03:34:50 × idnar quits (sid12240@debian/mithrandi) (Ping timeout: 256 seconds)
03:34:50 × arkeet quits (arkeet@moriya.ca) (Ping timeout: 256 seconds)
03:34:50 mimmy_ is now known as mimmy
03:34:50 × meinside quits (uid24933@id-24933.helmsley.irccloud.com) (Ping timeout: 256 seconds)
03:34:50 × tomku quits (~tomku@user/tomku) (Ping timeout: 256 seconds)
03:34:50 jludwig89 is now known as jludwig
03:34:50 × haveo quits (~haveo@sl35.iuwt.fr) (Ping timeout: 256 seconds)
03:34:50 × tinwood quits (~tinwood@canonical/tinwood) (Ping timeout: 256 seconds)
03:34:50 rune_ is now known as rune
03:34:50 × mauke quits (~mauke@user/mauke) (Ping timeout: 256 seconds)
03:34:50 × totbwf quits (sid402332@id-402332.uxbridge.irccloud.com) (Ping timeout: 256 seconds)
03:34:50 × scav quits (sid309693@user/scav) (Ping timeout: 256 seconds)
03:34:50 mxs_ is now known as mxs
03:34:50 FragByte_ is now known as FragByte
03:34:50 × notzmv quits (~zmv@user/notzmv) (Ping timeout: 256 seconds)
03:34:50 × xff0x quits (~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp) (Ping timeout: 256 seconds)
03:34:51 × perrierjouet quits (~perrier-j@modemcable048.127-56-74.mc.videotron.ca) (Ping timeout: 256 seconds)
03:34:51 × lbseale quits (~quassel@user/ep1ctetus) (Ping timeout: 256 seconds)
03:34:51 × tzh quits (~tzh@c-24-21-73-154.hsd1.or.comcast.net) (Ping timeout: 256 seconds)
03:34:51 × Erutuon quits (~Erutuon@user/erutuon) (Ping timeout: 256 seconds)
03:34:51 × shriekingnoise quits (~shrieking@186.137.167.202) (Ping timeout: 256 seconds)
03:34:51 × meooow quits (~meooow@2400:6180:100:d0::ad9:e001) (Ping timeout: 256 seconds)
03:34:51 × mtjm quits (~mutantmel@2604:a880:2:d0::208b:d001) (Ping timeout: 256 seconds)
03:34:51 × Luj3 quits (~Luj@2a01:e0a:5f9:9681:5880:c9ff:fe9f:3dfb) (Ping timeout: 256 seconds)
03:34:51 × swamp_ quits (~zmt00@user/zmt00) (Ping timeout: 256 seconds)
03:34:51 × poljar quits (~poljar@93-139-83-160.adsl.net.t-com.hr) (Ping timeout: 256 seconds)
03:34:51 arkeet` is now known as arkeet
03:34:51 sclv_ is now known as sclv
03:34:51 × mjacob quits (~mjacob@adrastea.uberspace.de) (Ping timeout: 256 seconds)
03:34:51 × masterbuilder quits (~master@user/masterbuilder) (Ping timeout: 256 seconds)
03:34:51 × tcard quits (~tcard@2400:4051:5801:7500:cf17:befc:ff82:5303) (Ping timeout: 256 seconds)
03:34:51 × terrorjack quits (~terrorjac@2a01:4f8:1c1e:509a::1) (Ping timeout: 256 seconds)
03:34:51 × hrberg quits (~quassel@171.79-160-161.customer.lyse.net) (Ping timeout: 256 seconds)
03:34:51 × kadobanana quits (~mud@user/kadoban) (Ping timeout: 256 seconds)
03:34:52 × nek0 quits (~nek0@2a01:4f8:222:2b41::12) (Ping timeout: 256 seconds)
03:34:52 × pieguy128 quits (~pieguy128@bras-base-mtrlpq5031w-grc-43-67-70-144-160.dsl.bell.ca) (Ping timeout: 256 seconds)
03:34:52 × finsternis quits (~X@23.226.237.192) (Ping timeout: 256 seconds)
03:34:52 × ozkutuk5 quits (~ozkutuk@176.240.173.153) (Ping timeout: 256 seconds)
03:34:52 × coderpath quits (~coderpath@d66-183-126-83.bchsia.telus.net) (Ping timeout: 256 seconds)
03:34:52 × gawen quits (~gawen@user/gawen) (Ping timeout: 256 seconds)
03:34:52 × potash quits (~foghorn@user/foghorn) (Ping timeout: 256 seconds)
03:34:52 × pflanze quits (~pflanze@159.100.249.232) (Ping timeout: 256 seconds)
03:34:52 × jrm quits (~jrm@user/jrm) (Ping timeout: 256 seconds)
03:34:52 × Putonlalla quits (~Putonlall@it-cyan.it.jyu.fi) (Ping timeout: 256 seconds)
03:34:52 × earthy quits (~arthurvl@2a02-a469-f5e2-1-ba27-ebff-fea0-40b0.fixed6.kpn.net) (Ping timeout: 256 seconds)
03:34:52 × Fangs quits (sid141280@id-141280.hampstead.irccloud.com) (Ping timeout: 256 seconds)
03:34:52 × xnbya quits (~xnbya@2a01:4f8:c17:cbdd::1) (Ping timeout: 256 seconds)
03:34:52 earthy joins (~arthurvl@2a02:a469:f5e2:1:ba27:ebff:fea0:40b0)
03:34:52 wroathe joins (~wroathe@207.153.38.140)
03:34:52 totbwf_ is now known as totbwf
03:34:52 Luj30 is now known as Luj3
03:34:52 ozkutuk53 is now known as ozkutuk5
03:34:52 × wroathe quits (~wroathe@207.153.38.140) (Changing host)
03:34:52 wroathe joins (~wroathe@user/wroathe)
03:34:53 jrm2 is now known as jrm
03:34:53 Fangs_ is now known as Fangs
03:34:53 meinside_ is now known as meinside
03:34:53 nek09 is now known as nek0
03:34:53 idnar_ is now known as idnar
03:34:53 scav_ is now known as scav
03:34:53 terrorjack7 is now known as terrorjack
03:34:54 finstern1s is now known as finsternis
03:34:55 TheCoffeMaker_ joins (~TheCoffeM@190.245.123.30)
03:34:56 wroathe is now known as 048AAIV30
03:35:40 sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10)
03:35:41 048AAIV30 is now known as wroathe
03:36:28 mtjm_ is now known as mtjm
03:40:01 × son0p quits (~ff@2604:3d08:5b7f:5540::a58f) (Ping timeout: 256 seconds)
03:42:48 notzmv joins (~zmv@user/notzmv)
03:43:12 Putonlalla joins (~Putonlall@it-cyan.it.jyu.fi)
03:43:44 × td_ quits (~td@83.135.9.14) (Ping timeout: 260 seconds)
03:44:11 son0p joins (~ff@2604:3d08:5b7f:5540::a58f)
03:45:09 td_ joins (~td@83.135.9.40)
03:45:10 × eggplantade quits (~Eggplanta@2600:1700:38c5:d800:30d2:fcaf:3b1c:ad43) (Remote host closed the connection)
03:46:43 perrierjouet joins (~perrier-j@modemcable048.127-56-74.mc.videotron.ca)
03:47:17 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 255 seconds)
03:49:17 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
03:49:22 × terrorjack quits (~terrorjac@2a01:4f8:1c1e:509a::1) (Quit: The Lounge - https://thelounge.chat)
03:49:50 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds)
03:49:55 × rembo10 quits (~rembo10@main.remulis.com) (Quit: ZNC 1.8.2 - https://znc.in)
03:50:42 terrorjack joins (~terrorjac@2a01:4f8:1c1e:509a::1)
03:52:04 rembo10 joins (~rembo10@main.remulis.com)
04:03:19 <jackdk> yes, it's giving you the opposite to `liftIO :: MonadIO m => IO a -> m a`, which you need for all sorts of bracketesque functions
04:11:34 × johnw quits (~johnw@76-234-69-149.lightspeed.frokca.sbcglobal.net) (Quit: ZNC - http://znc.in)
04:12:11 × machinedgod quits (~machinedg@d198-53-218-113.abhsia.telus.net) (Ping timeout: 264 seconds)
04:28:31 × Erutuon_ quits (~Erutuon@user/erutuon) (Ping timeout: 252 seconds)
04:30:44 × opticblast quits (~Thunderbi@secure-165.caltech.edu) (Ping timeout: 248 seconds)
04:39:09 × tomokojun quits (~tomokojun@37.19.221.173) (Quit: じゃあね〜。)
04:45:40 eggplantade joins (~Eggplanta@2600:1700:38c5:d800:30d2:fcaf:3b1c:ad43)
04:46:33 × eggplantade quits (~Eggplanta@2600:1700:38c5:d800:30d2:fcaf:3b1c:ad43) (Remote host closed the connection)
04:46:47 eggplantade joins (~Eggplanta@2600:1700:38c5:d800:30d2:fcaf:3b1c:ad43)
04:47:42 × ddellacosta quits (~ddellacos@89.45.224.208) (Ping timeout: 268 seconds)
04:50:40 × lisbeths quits (uid135845@id-135845.lymington.irccloud.com) (Quit: Connection closed for inactivity)
04:52:58 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection)
04:53:40 FinnElija joins (~finn_elij@user/finn-elija/x-0085643)
05:05:10 × waleee quits (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Ping timeout: 260 seconds)
05:10:47 Vajb joins (~Vajb@hag-jnsbng11-58c3a5-27.dhcp.inet.fi)
05:12:43 × mncheck quits (~mncheck@193.224.205.254) (Ping timeout: 248 seconds)
05:19:40 mbuf joins (~Shakthi@49.205.86.134)
05:24:10 × Vajb quits (~Vajb@hag-jnsbng11-58c3a5-27.dhcp.inet.fi) (Read error: Connection reset by peer)
05:24:19 Vajb joins (~Vajb@2001:999:504:3ad6:52a4:a3b5:32d8:e74d)
05:34:40 dextaa7 joins (~DV@user/dextaa)
05:35:55 × finsternis quits (~X@23.226.237.192) (Remote host closed the connection)
05:37:08 × dextaa quits (~DV@user/dextaa) (Ping timeout: 260 seconds)
05:37:09 dextaa7 is now known as dextaa
05:37:31 × Vajb quits (~Vajb@2001:999:504:3ad6:52a4:a3b5:32d8:e74d) (Ping timeout: 252 seconds)
05:37:44 Vajb joins (~Vajb@2001:999:504:3ad6:52a4:a3b5:32d8:e74d)
05:38:45 phma_ joins (phma@2001:5b0:215d:cc28:414c:6f3a:6804:56b7)
05:41:26 × phma quits (phma@2001:5b0:215d:cc28:414c:6f3a:6804:56b7) (Ping timeout: 246 seconds)
05:43:40 king_gs joins (~Thunderbi@2806:103e:29:cdd2:b2dd:cddc:5884:d05c)
05:44:10 × raym quits (~ray@user/raym) (Quit: kernel update, rebooting...)
05:50:40 Kaiepi joins (~Kaiepi@108.175.84.104)
06:02:47 × king_gs quits (~Thunderbi@2806:103e:29:cdd2:b2dd:cddc:5884:d05c) (Quit: king_gs)
06:05:50 × Vajb quits (~Vajb@2001:999:504:3ad6:52a4:a3b5:32d8:e74d) (Ping timeout: 256 seconds)
06:08:13 Guest3061 joins (~Guest30@188.168.24.7)
06:10:30 <Guest3061> hello, how haskell parse this expression (head . tail xs)?
06:11:40 <c_wraith> prefix function application always binds more tightly than infix operators
06:11:48 <c_wraith> so its (head . (tail xs))
06:11:48 Ybombinator joins (~Ybombinat@81.198.69.124)
06:12:03 <c_wraith> which... looks like a type error
06:12:08 × phma_ quits (phma@2001:5b0:215d:cc28:414c:6f3a:6804:56b7) (Read error: Connection reset by peer)
06:12:21 <c_wraith> You probably wanted something more like (head . tail) xs
06:12:35 <c_wraith> though I'd rather use pattern matching for that.
06:12:36 <Guest3061> why not ((head .) tail) xs
06:13:04 <c_wraith> that's the same thing, but with more parens
06:13:15 takuan joins (~takuan@178-116-218-225.access.telenet.be)
06:13:16 phma_ joins (~phma@host-67-44-208-220.hnremote.net)
06:14:07 <c_wraith> (head .) tail === (\x -> head . x) tail === (head . tail)
06:15:18 <Guest3061>  (head . (tail xs)) and (head . tail) xs not same
06:15:32 <c_wraith> correct.
06:15:40 <xerox> @src (.)
06:15:40 <lambdabot> (f . g) x = f (g x)
06:19:17 money_ joins (~money@user/polo)
06:19:52 <Guest3061> whats wrong: head . tail xs => (head .) tail xs where (head .) operator section;  (head .) tail xs => (head . tail) xs = head (tail xs), but haskell error
06:21:36 bilegeek joins (~bilegeek@2600:1008:b050:71de:7be6:f44e:ae73:bf89)
06:21:37 <c_wraith> how are you getting that first transformation?
06:21:56 <iqubic> :t head . tail xs
06:21:57 <lambdabot> error:
06:21:57 <lambdabot> • Variable not in scope: xs :: [a0]
06:21:57 <lambdabot> • Perhaps you meant one of these:
06:22:07 <c_wraith> iqubic: nevermind that it's a type error
06:22:13 <iqubic> :t \xs -> head . tail xs
06:22:14 <lambdabot> error:
06:22:14 <lambdabot> • Couldn't match expected type ‘a1 -> [c]’ with actual type ‘[a]’
06:22:14 <lambdabot> • Possible cause: ‘tail’ is applied to too many arguments
06:22:40 <iqubic> Yeah, that just doesn't compile in the first place.
06:22:49 <c_wraith> Guest3061: you're changing the parsing rules by using a section. It changes it from an infix operator to a prefix function
06:23:27 <c_wraith> (head .) tail xs is parsed as ((head .) tail) xs
06:23:27 <Guest3061> ye section is funtction and have high priority
06:23:48 <c_wraith> specifically, the tail and the xs aren't grouped together
06:23:52 <Guest3061> why error
06:24:12 raym joins (~ray@user/raym)
06:24:38 <Guest3061> ((head .) tail) xs is correct expression
06:24:50 <c_wraith> so is (head . tail) xs, which is exactly identical
06:24:57 <c_wraith> except with fewer parenthesis
06:26:03 × money_ quits (~money@user/polo) (Ping timeout: 256 seconds)
06:26:08 <c_wraith> But when you change it to (head . tail xs), it's parsing as (head . (tail xs)) instead
06:26:21 <c_wraith> which is a type error, because tail xs cannot be a function
06:26:28 × instantaphex quits (~jb@c-73-171-252-84.hsd1.fl.comcast.net) (Ping timeout: 248 seconds)
06:26:43 <iqubic> Yeah.
06:27:06 <iqubic> `head . tail xs` not equal `(head . tail) xs`
06:27:10 × tcard_ quits (~tcard@2400:4051:5801:7500:cf17:befc:ff82:5303) (Quit: Leaving)
06:27:25 <iqubic> `head . tail xs` is actually `head . (tail xs)`
06:28:13 <Guest3061> function is left associative
06:28:17 <Guest3061> first function head
06:28:42 michalz joins (~michalz@185.246.204.72)
06:28:53 tcard joins (~tcard@2400:4051:5801:7500:cf17:befc:ff82:5303)
06:29:38 <c_wraith> associativity only matters when the precedence is the same.
06:29:44 <c_wraith> Operators are always lower precedence.
06:30:14 phma_ is now known as phma
06:30:40 <c_wraith> (than function application)
06:30:55 paulpaul1076 joins (~textual@95-29-5-111.broadband.corbina.ru)
06:30:56 <iqubic> Function application is always done first, then you deal with operators.
06:31:24 <Guest3061> we have two function in expression - head and tail, head is first
06:31:40 bgs joins (~bgs@212-85-160-171.dynamic.telemach.net)
06:32:50 <c_wraith> iqubic: record update syntax has higher precedence than function application
06:33:07 <iqubic> Alright, that's fair.
06:34:13 <iqubic> In the situation we have `head . tail xs` we have both function application `tail xs` and evaluating an operator `.` Of these two things, GHC will always choose to do function application first
06:34:25 <c_wraith> nice precision. :)
06:36:00 <Guest3061> why (head .) is operator?
06:36:25 <mauke_> it's not
06:36:34 mauke_ is now known as mauke
06:36:46 <iqubic> (head .) isn't an operator. The only operator here is . which has two arguments `head` and `tail xs`
06:36:58 <iqubic> (head .) isn't an operator. The only operator here is . which has two arguments `head` and `tail xs`
06:37:13 <mauke> echo?
06:37:32 <iqubic> Yeah. Sorry about that. My computer bugged out for a moment.
06:38:07 instantaphex joins (~jb@c-73-171-252-84.hsd1.fl.comcast.net)
06:38:47 <Guest3061> f x f y f z ~ ((((f x) f) y)  f) z correct?
06:39:06 <iqubic> Now that is correct.
06:39:32 <iqubic> Well, except for the last parthesis being in the wrong spot
06:40:10 <iqubic> No actually, a few parentheses are wrong.
06:40:55 <mauke> are they?
06:41:03 <Guest3061> if x = . is function - arg it will not resemble our expression?
06:41:30 <mauke> . is an operator, not a value
06:41:50 <mauke> 2 + 2 does not mean ((2) +) 2, it means ((+) 2) 2
06:42:09 <mauke> heh
06:42:12 <iqubic> Yes, that's correct mauke.
06:42:20 <mauke> except (2 +) would be a section, so that would actually work
06:42:27 <mauke> 2 + 2 does not mean (2 (+)) 2
06:42:47 × instantaphex quits (~jb@c-73-171-252-84.hsd1.fl.comcast.net) (Ping timeout: 264 seconds)
06:43:23 × Ybombinator quits (~Ybombinat@81.198.69.124) (Read error: Connection reset by peer)
06:43:28 <Guest3061> but 2 not function
06:43:38 × jargon_ quits (~jargon@174-22-192-24.phnx.qwest.net) (Ping timeout: 268 seconds)
06:43:44 <mauke> it could be
06:44:16 <mauke> this is about syntax, not types
06:46:51 <mauke> @let instance (Num a) => Num ((->) e) where { (+) = liftA2 (+); (*) = liftA2 (*); abs = fmap abs; signum = fmap signum; fromInteger = pure . fromInteger; negate = fmap negate }
06:46:52 <lambdabot> /sandbox/tmp/.L.hs:167:26: error:
06:46:52 <lambdabot> • Expecting one more argument to ‘(->) e’
06:46:52 <lambdabot> Expected a type, but ‘(->) e’ has kind ‘* -> *’
06:47:01 <mauke> @let instance (Num a) => Num (e -> a) where { (+) = liftA2 (+); (*) = liftA2 (*); abs = fmap abs; signum = fmap signum; fromInteger = pure . fromInteger; negate = fmap negate }
06:47:02 <lambdabot> Defined.
06:47:06 <mauke> > 2 + 2
06:47:08 <lambdabot> 4
06:47:17 <mauke> > 2 "hello"
06:47:18 <lambdabot> 2
06:47:23 <mauke> there, now 2 is a function
06:48:13 Ybombinator joins (~Ybombinat@81.198.69.124)
06:48:50 <mauke> > (sqrt - 1) 2
06:48:51 <lambdabot> 0.41421356237309515
06:50:13 <c_wraith> > (sin ^ 2 + cos ^ 2) 17
06:50:15 <lambdabot> 0.9999999999999999
06:50:26 <c_wraith> oh no. the floating point error got me!
06:50:29 <mauke> > 2 (3 4)
06:50:30 <lambdabot> 2
06:50:35 <mauke> > (2 . 3) 4
06:50:37 <lambdabot> 2
06:50:39 <mauke> > 2 . 3 4
06:50:41 <lambdabot> error:
06:50:41 <lambdabot> • No instance for (Typeable a0)
06:50:41 <lambdabot> arising from a use of ‘show_M75277755340628173127’
06:50:43 <mauke> there
06:50:53 × azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds)
06:51:04 × Guest3061 quits (~Guest30@188.168.24.7) (Quit: Client closed)
06:51:49 <iqubic> I guess we scared them off.
06:52:06 Guest30 joins (~Guest30@188.168.24.7)
06:52:16 azimut joins (~azimut@gateway/tor-sasl/azimut)
06:52:18 × bgs quits (~bgs@212-85-160-171.dynamic.telemach.net) (Remote host closed the connection)
06:52:54 <mauke> welcome back :-)
06:54:34 <Guest30> head. tail [1,2,3] on what principle haskell choose 1st operation is tail [1, 2, 3]
06:55:25 × m5zs7k quits (aquares@web10.mydevil.net) (Ping timeout: 260 seconds)
06:56:00 <Ybombinator> How does the len function here https://bpa.st/6DRA work? Like how will it look after recursion? I only understood that it will return 0 after the last recursion and I assume the 1s are somehow added to it but it doesn't make sense to me how.
06:56:07 <mauke> syntactically, it's like 2 + sqrt 3
06:56:30 <mauke> . and + are infix operators, tail and sqrt are values
06:56:32 <Guest30> sqrt is function and have high priority
06:56:49 <mauke> it's not sqrt itself that has priority
06:57:09 <mauke> it's that when you put two values next to each other, that's function application and has high priority
06:57:32 <jackdk> Ybombinator: you can use substitution to evaluate by hand: `len "hi" = len "i" + 1 = ((len "") + 1) + 1 = (0 + 1) + 1 = 2`
06:57:42 <mud> Ybombinator: It says that the len of an empty list is 0 (len [] = 0) . Then it says that if the list has one element to pick off from them front, then it's 1 + the len of the rest
06:58:17 <Guest30> why head . not function application?
06:58:28 <mauke> because . is an operator, not a value
06:58:30 <mauke> we've been over this
06:58:32 <Ybombinator> oh right, the substitution makes it easy to understand
06:59:13 <mauke> if you're asking what makes . an operator, it's that its name is made of punctuation symbols
06:59:33 <mauke> unlike, say, tail, which is made of letters
07:00:31 <Guest30> why do we look at this as an application head to . but not the other way around
07:01:08 <mauke> because . is an operator, not a value
07:02:51 <c_wraith> that's really the whole point of operators. They're infix, not prefix.
07:02:54 m5zs7k joins (aquares@web10.mydevil.net)
07:03:15 <c_wraith> It's why you get to write 2 + 2 instead of a lisp-like (+ 2 2)
07:03:29 <mauke> syntactically, head . tail xs is no different from x + sqrt y
07:03:32 <Guest30> why operator can`t be argument
07:03:34 <mauke> the types really don't matter
07:03:47 <EvanR> operator section like (+) and (.) can be an argument
07:04:03 <mauke> you have to put ( ) around it to turn an operator into a value
07:04:16 <mauke> otherwise it's an operator, not a value (we've been over this)
07:04:23 <EvanR> naked operators are parsed different
07:04:59 × Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer)
07:07:45 <Guest30> thank you very much, I will remember that an operator cannot be an argument of a function
07:08:18 × Ybombinator quits (~Ybombinat@81.198.69.124) (Ping timeout: 268 seconds)
07:08:19 <EvanR> unless you parenthesize it
07:08:30 Ybombinator joins (~Ybombinat@81.198.69.124)
07:08:47 <Guest30> operator in parentheses is function
07:08:53 × chexum quits (~quassel@gateway/tor-sasl/chexum) (Quit: No Ping reply in 180 seconds.)
07:09:43 × Guest30 quits (~Guest30@188.168.24.7) (Quit: Client closed)
07:10:03 × Ybombinator quits (~Ybombinat@81.198.69.124) (Read error: Connection reset by peer)
07:10:15 Ybombinator joins (~Ybombinat@81.198.69.124)
07:10:19 × Ybombinator quits (~Ybombinat@81.198.69.124) (Read error: Connection reset by peer)
07:10:43 Ybombinator joins (~Ybombinat@81.198.69.124)
07:10:59 chexum joins (~quassel@gateway/tor-sasl/chexum)
07:12:03 <jackdk> Ybombinator: In my personal experience (both in my own learning and when teaching), I have found that "go do the evaluation by hand and work through the substitutions" really helps make things click. Haskell is wonderful in that substitution is pretty much always possible
07:15:29 × Ybombinator quits (~Ybombinat@81.198.69.124) (Ping timeout: 260 seconds)
07:16:22 × Kaiepi quits (~Kaiepi@108.175.84.104) (Quit: Leaving)
07:20:38 × troydm quits (~troydm@host-176-37-124-197.b025.la.net.ua) (Ping timeout: 268 seconds)
07:24:29 × Techcable quits (~Techcable@user/Techcable) (Ping timeout: 260 seconds)
07:24:33 <SrPx> Is it possible to define an efficient hyper-operation sequence as a recursive squaring function over 2-adics in Haskell?
07:24:37 <SrPx> https://stackoverflow.com/questions/74739974/is-it-possible-to-define-an-efficient-hyper-operation-sequence-as-a-recursive-sq
07:28:08 × ft quits (~ft@p508dbd59.dip0.t-ipconnect.de) (Quit: leaving)
07:31:46 chele joins (~chele@user/chele)
07:32:47 machinedgod joins (~machinedg@d198-53-218-113.abhsia.telus.net)
07:34:16 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
07:34:24 Ybombinator joins (~Ybombinat@81.198.69.124)
07:42:56 blomberg joins (~default_u@117.247.121.23)
07:43:00 <blomberg> he
07:43:16 <blomberg> are there default arguments values option for functions
07:43:31 <blomberg> f x=2 y=4 = x+y
07:43:50 <iqubic> Not in Haskell.
07:44:11 <iqubic> Well, I mean, not easily
07:45:39 nilradical1 joins (~nilradica@123-243-44-216.tpgi.com.au)
07:45:47 × Ybombinator quits (~Ybombinat@81.198.69.124) (Ping timeout: 248 seconds)
07:46:06 <nilradical1> hello, how can i get modules in `app/` to be available for import in the repl
07:46:26 × m5zs7k quits (aquares@web10.mydevil.net) (Ping timeout: 246 seconds)
07:46:44 <nilradical1> using cabal. under 'executable', ive added the module name to 'exposed modules' and also 'other modules' but in the repl its not available
07:48:47 × blomberg quits (~default_u@117.247.121.23) (Ping timeout: 256 seconds)
07:49:12 blomberg joins (default_us@gateway/vpn/protonvpn/thatpythonboy)
07:50:50 <blomberg> iqubic:there are easily available using partial application f' = f 2 3 --so 2 3 are defaults :)
07:51:38 <blomberg> but i don't want to apply f 2 3 to evaluating, so what's the syntax for partial application
07:57:56 × azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds)
07:58:04 <dminuoso> blomberg: We dont really have partial application.
07:58:08 Kaiepi joins (~Kaiepi@108.175.84.104)
07:58:25 <dminuoso> Or rather `f 2 3` is exactly that, but its not partial application either
07:59:04 <dminuoso> The closest thing to default arguments that we commonly use, is by putting arguments inside a data structure
07:59:06 <dminuoso> Say:
07:59:30 <dminuoso> % import Data.Word
07:59:30 <yahb2> <no output>
07:59:44 <dminuoso> % data ServerOptions = ServerOptions { listenPort :: Word16, listenAddress :: Word32, serverName :: T.text }
07:59:44 <yahb2> <interactive>:52:99: error: parse error on input ‘T.text’
07:59:48 <dminuoso> % data ServerOptions = ServerOptions { listenPort :: Word16, listenAddress :: Word32, serverName :: String }
07:59:48 <yahb2> <no output>
07:59:54 <dminuoso> And then defining some top level value
08:00:05 m5zs7k joins (aquares@web10.mydevil.net)
08:00:47 <dminuoso> % defaultOptions = defaultOptions { listenPort = 1234, listenAddress = 0x7F000001, serverName = "myServer" }
08:00:48 <yahb2> <no output>
08:01:17 <dminuoso> Such that the usage style becomes `startServer defaultOptions`, or if you want to customize some, you might write `startServer defaultOptions{ listenPort = 2345 }`
08:01:29 <blomberg> > `(+) 2 3`
08:01:31 <lambdabot> <hint>:1:1: error: parse error on input ‘`’
08:01:39 <dminuoso> Leave the backticks away
08:01:45 <dminuoso> > (+) 2 3
08:01:46 <lambdabot> 5
08:02:06 <blomberg> quotes in the eval is another option
08:02:10 Ybombinator joins (~Ybombinat@85.254.74.38)
08:02:14 <blomberg> s/in/and
08:02:23 × nilradical1 quits (~nilradica@123-243-44-216.tpgi.com.au) (Ping timeout: 260 seconds)
08:02:29 <dminuoso> You mean like (`f` 3) or (3 `f`)?
08:03:14 <dminuoso> blomberg: I mean yes and no. They are partial applications if you consider `f :: Int -> Int -> Int` accepting two arguments.
08:03:30 <dminuoso> THough there's also the notion that every function really accepts only one argument
08:04:24 <dminuoso> And in that sense something like (`f` 3) is conceptually rather a short hand for `\x -> f x 3`
08:04:31 <dminuoso> Or `flip f 3` if you want
08:05:43 <dminuoso> blomberg: That being said, writing `f 2 3` to already pre-apply 2 and 3 is fine. Why do you not like it?
08:06:16 <dminuoso> It might be helpful to understand, that the way this is implemented in GHC Haskell makes it extremely cheap. GHC doesnt create a new function upon partial application of somne kind.
08:08:16 mncheck joins (~mncheck@193.224.205.254)
08:09:46 MajorBiscuit joins (~MajorBisc@2001:1c00:2404:ed00:28e1:ad14:ec67:539e)
08:12:23 × MajorBiscuit quits (~MajorBisc@2001:1c00:2404:ed00:28e1:ad14:ec67:539e) (Client Quit)
08:17:00 zant1 joins (~zant@62.214.20.26)
08:17:26 MajorBiscuit joins (~MajorBisc@2001:1c00:2404:ed00:28e1:ad14:ec67:539e)
08:18:20 <albet70> what's the better way to replace a bunch of if-then-else?
08:18:37 <dminuoso> albet70: Difficult to say in general. Can you share the code you have specifically?
08:19:21 <albet70> dminuoso , https://paste.tomsmeding.com/PMJK278w
08:20:10 <dminuoso> albet70: can you share some of the surrounding code as well? perhaps the entirety of the binding here?
08:20:51 jakalx parts (~jakalx@base.jakalx.net) (Error from remote client)
08:21:17 jakalx joins (~jakalx@base.jakalx.net)
08:21:24 <albet70> https://paste.tomsmeding.com/mf0me8hF
08:22:12 acidjnk_new joins (~acidjnk@p200300d6e7137a16c4eff8deb759a49f.dip0.t-ipconnect.de)
08:22:33 <dminuoso> You could use MultiWayIf (or an equivalent `case () of ...` expression)
08:22:41 <dminuoso> Alternatively, you could use a helper binding that accomlishes the same in guards
08:24:21 <albet70> yes
08:26:50 akegalj joins (~akegalj@141-136-183-112.dsl.iskon.hr)
08:31:33 × werneta quits (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 268 seconds)
08:32:39 lortabac joins (~lortabac@2a01:e0a:541:b8f0:5543:4ce0:b6b6:f758)
08:33:24 nschoe joins (~q@141.101.51.197)
08:34:01 × shriekingnoise_ quits (~shrieking@186.137.167.202) (Quit: Quit)
08:36:11 johnw joins (~johnw@76-234-69-149.lightspeed.frokca.sbcglobal.net)
08:38:42 × eggplantade quits (~Eggplanta@2600:1700:38c5:d800:30d2:fcaf:3b1c:ad43) (Remote host closed the connection)
08:38:59 zeenk joins (~zeenk@2a02:2f04:a30d:4300::7fe)
08:39:53 <albet70> dminuoso , this 'case ... of ..' is equal to 'switch .. case ...' in other languages like C or Java?
08:42:57 aeroplane joins (~user@user/aeroplane)
08:43:03 <dminuoso> Not quite
08:43:12 <dminuoso> The construct in C is somewhat different
08:43:23 <dminuoso> And in Java as well
08:44:04 <dminuoso> If you think of the switch-case in C or Java combined with an implicit break; on each clause, then they are similar
08:44:18 <kjlid[m]> Actually Java has switch expressions nowadays
08:44:22 <dminuoso> But the fact that you can leave a break away in one clause lets you do things that case-of cant.
08:45:21 <kjlid[m]> No break needed in those
08:45:53 × mncheck quits (~mncheck@193.224.205.254) (Remote host closed the connection)
08:46:16 <int-e> There's three such pairs I know of. `case ... of` (Algol, Pascal, Haskell) `switch ... case` (C, Java), `match ... with` (ML, Rust)... Oh, Fortran has another "select case ... case". Fun.
08:47:31 coot joins (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba)
08:47:46 avicenzi joins (~avicenzi@2a00:ca8:a1f:b004::c32)
08:48:53 <kjlid[m]> How would you guys make a `[Maybe String] -> Either String [String]`?
08:49:50 <int-e> kjlid[m]: Well, what is it supposed to do?
08:49:59 <dminuoso> int-e: How is ml, rust `match ... with` different?
08:50:24 <dminuoso> I mean they do have these combined patterns which is useful, is there anything else?
08:50:25 kenran joins (~user@user/kenran)
08:50:30 <int-e> dminuoso: I think they're surprisingly close because Rust has patterns.
08:50:48 <kjlid[m]> I have a [Maybe String] and i want to accumulate those strings into a list, returning an error if one of them is Nothing
08:50:59 <dminuoso> kjlid[m]: use `asum`
08:51:06 CiaoSen joins (~Jura@p200300c95747e0002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
08:51:22 <dminuoso> kjlid[m]: Did you generate this list by means of using `fmap`?
08:51:56 <int-e> > map sequence [[Just 1, Just 2],[Just 1,Nothing]]
08:51:57 × kenran quits (~user@user/kenran) (Remote host closed the connection)
08:51:58 <lambdabot> [Just [1,2],Nothing]
08:52:02 werneta joins (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
08:52:28 <albet70> I learned a liitle cpp a few days, it's too difficult than other languages, the pointer, the left/right value, too chaos, is rust difficult too?
08:52:44 <dminuoso> Ah wait, asum is wrong. sequence it is.
08:52:58 <int-e> (that doesn't add an error yet)
08:53:01 <dminuoso> Anyway, if you have generated this list with `fmap`, and intend to `sequence` it after, consider using `traverse` instead.
08:53:06 <kjlid[m]> mapM actually. The function i am using is actually `IO (Maybe String)`
08:53:29 <int-e> :t maybe (Left "oh no") Right $ Nothing
08:53:30 <lambdabot> Either [Char] b
08:53:34 <dminuoso> kjlid[m]: Okay, if you have mtl already, you could go through MaybeT
08:53:59 <dminuoso> If not, `sequence` the result and then use some kind of `note :: e -> Maybe a -> Either e a` function, manually case-of, use `fromMaybe/maybe`
08:54:05 <dminuoso> Something along these lines
08:55:45 merijn joins (~merijn@86-86-29-250.fixed.kpn.net)
08:56:15 <xerox> > traverse sequence [[Just 1, Just 2],[Just 1,Just 4]]
08:56:16 <lambdabot> Just [[1,2],[1,4]]
08:56:58 <kjlid[m]> Do mtl have MaybeT?
08:59:58 <dminuoso> kjlid[m]: Oh well transformers does.
09:00:15 <dminuoso> Pardon me. Whenever I have one, I tend to have the other as well. :)
09:00:29 azimut joins (~azimut@gateway/tor-sasl/azimut)
09:00:31 <dminuoso> Whcih is why in my mind I keep conflating them
09:00:37 <kjlid[m]> Alright
09:04:40 × m5zs7k quits (aquares@web10.mydevil.net) (Ping timeout: 265 seconds)
09:08:02 m5zs7k joins (aquares@web10.mydevil.net)
09:09:37 <blomberg> > x=2
09:09:38 <lambdabot> <hint>:1:2: error: parse error on input ‘=’
09:09:43 <blomberg> why do i get error
09:10:05 <c_wraith> because lambdabot isn't a file, or ghci
09:10:22 cfricke joins (~cfricke@user/cfricke)
09:10:24 <c_wraith> lambdabot evaluates expressions, and x=2 isn't an expression
09:10:33 <c_wraith> > let x=2 in x + 5
09:10:34 <lambdabot> 7
09:10:37 <blomberg> % x=3
09:10:37 <yahb2> <no output>
09:10:42 <blomberg> % x
09:10:42 <yahb2> 3
09:10:42 <dminuoso> Talk to yahb2 (start with %) if you want a GHCi interface that allows you to write `x = 2`
09:10:48 <dminuoso> alternatively you can define in lambdabot as follows
09:10:50 <dminuoso> @let x = 2
09:10:51 <lambdabot> Defined.
09:10:57 <dminuoso> > print x
09:10:58 <lambdabot> error:
09:10:58 <lambdabot> Ambiguous occurrence ‘x’
09:10:58 <lambdabot> It could refer to
09:11:10 <c_wraith> > L.x
09:11:14 <lambdabot> 2
09:11:43 <blomberg> print is there in haskell
09:11:48 <c_wraith> it's not usually a good idea to @let one-character identifiers
09:11:58 <c_wraith> because lambdabot has simplereflect imported
09:12:06 <c_wraith> > f y z :: Expr
09:12:08 <lambdabot> f y z
09:13:00 <blomberg> > add x y = x+y; add'=add 2 3
09:13:01 <lambdabot> <hint>:1:9: error: parse error on input ‘=’
09:13:04 <int-e> @undef
09:13:04 <lambdabot> Undefined.
09:13:12 <int-e> :t x
09:13:13 <lambdabot> Expr
09:13:36 mncheck joins (~mncheck@193.224.205.254)
09:13:39 <int-e> > let add x y = x + y in add 2 3
09:13:40 <lambdabot> 5
09:13:43 int-e shrugs
09:14:28 <blomberg> int-e:also i want add' = add 2 3
09:14:54 <int-e> > let add x y = x + y; add' = add 2 3 in add'
09:14:56 <lambdabot> 5
09:15:45 <blomberg> we can put multi expressions in let multiexpression in singleexpression ?
09:16:13 <dminuoso> What is a multi expression?
09:16:17 <int-e> a single `let` can have any number of bindings
09:17:06 <int-e> and if you know how layout turns into explicit blocks (delimited by { and }) and semicolons, you can put it all on one line.
09:17:25 <blomberg> multi assignments
09:18:11 <c_wraith> multiple declarations.
09:18:59 <c_wraith> "assignment" carries with it some connotations of modification. You're just defining names to be the same as some other expression.
09:19:42 <int-e> @quote no.variables
09:19:42 <lambdabot> cjs says: I have to explain this shit to people. I mean, I start out right, "Hey, you know how you always have these bugs because what you thought was in the variable is not there?" And I get all of
09:19:42 <lambdabot> these nods of agreement. "Well, I've found a new language that solves that problem." Audience: "Ooooh! How?" Me: "There's no variables!" And then they all start moving away from me slowly....
09:21:07 <dminuoso> Of if you dont like declaration, you could use `equation`
09:21:41 <dminuoso> Which with a slight bit of squinting works well enough
09:22:09 <int-e> > let xs = 1:ys; ys = 2:xs in xs
09:22:10 <lambdabot> [1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2...
09:22:35 <int-e> (the equations can be recursive)
09:24:22 <merijn> int-e: I love that quote :)
09:25:01 <c_wraith> it feels very.... Arlo Guthrie
09:26:09 × bilegeek quits (~bilegeek@2600:1008:b050:71de:7be6:f44e:ae73:bf89) (Quit: Leaving)
09:27:44 <blomberg> putStrLn "x value is {x}" --so how do i print x value in that string
09:27:59 <merijn> I should actually finally add my favourite XY problem quote
09:28:10 <merijn> @remember glyph For example, if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer". If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers
09:28:11 <lambdabot> It is stored.
09:28:36 <merijn> blomberg: Normally something like: putStrln ("x value is " ++ show x)
09:28:58 <merijn> there are some libraries for format strings, but most of the time I don't find them worth the effort
09:29:21 <blomberg> show is function from Show typeclass
09:29:30 <dminuoso> Im not sure, templated strings its something I regularly miss in Haskell. :/
09:29:33 × sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.)
09:29:49 <dminuoso> People not missing it are probably just suffering from Stockholm syndrome
09:30:03 <c_wraith> I just don't format much text.
09:30:51 <merijn> blomberg: You can replace show with whatever custom formatting text
09:31:06 <int-e> There's always <rot13>Grkg.Cevags</rot13> :-P
09:31:23 <merijn> c_wraith: I occasionally do, but mconcat plus a list of strings/show expressions works easiest
09:31:35 <c_wraith> also, when I do format text, I'm usually writing showsPrec, and Prelude has a bunch of secret tools for writing showsPrec cleanly
09:31:54 <int-e> (Text.Printf. It's such an ugly hack, but it's a useful middle ground between `show` and proper pretty-printing.)
09:32:15 <merijn> dminuoso: Usually when I do format things there's more custom formatting around and then the list based approach works fairly well
09:32:43 <c_wraith> I *do* wish -XOverloadedList was designed better.
09:32:46 <dminuoso> merijn: Re jackhammer. Is it unrelated though? XY problems may not necessarily be a problem, it might be worthwhile explaining how to use a jackhammer, to let them figure out why the goal might be unwise, or perhaps they truly need to perform an excorcism.
09:33:18 <c_wraith> toList/fromList are the wrong level of abstraction for making OverloadedLists useful
09:33:42 <merijn> dminuoso: I usually end up writing this approach: https://github.com/merijn/Belewitte/blob/master/benchmark-analysis/model-src/Evaluate.hs#L402-L409
09:33:43 <c_wraith> I want to be able to use heterogenous element types!
09:33:45 sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10)
09:34:22 <dminuoso> c_wraith: How do you envision this to work?
09:34:29 <merijn> dminuoso: GADTs :p
09:34:43 <dminuoso> As in magically sprinkle GADTs over modules to make it compile?
09:35:04 <int-e> dminuoso: XY problems are problems because they often leave noone happy... neither the person who asked the question but got an answer that wouldn't help them, nor the person who answered but didn't get the satisfaction of actually helping.
09:35:08 <c_wraith> no. desugar to overloaded applications of cons and nil
09:35:18 <c_wraith> and *then* resolve the overloading.
09:35:29 <int-e> dminuoso: But of course there are exceptions on both sides.
09:35:39 <dminuoso> What *might* be fun is if GHC had pre-knowledge of all instances present, you get an existential type with `(Show, Read) *> ...` assuming that `Show, Read` is the common set of instances shared by all elements
09:36:50 <dminuoso> So something like `["foo", 6]` is fine, but you could only use it in any way that either ignores the contained type, or uses something that us uniformly supported
09:39:13 eggplantade joins (~Eggplanta@2600:1700:38c5:d800:30d2:fcaf:3b1c:ad43)
09:39:46 <c_wraith> that's way more complicated than what I want
09:40:30 × kritzefitz quits (~kritzefit@debian/kritzefitz) (Ping timeout: 260 seconds)
09:43:26 × eggplantade quits (~Eggplanta@2600:1700:38c5:d800:30d2:fcaf:3b1c:ad43) (Ping timeout: 252 seconds)
09:43:38 × tzh_ quits (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) (Quit: zzz)
09:44:38 × econo quits (uid147250@user/econo) (Quit: Connection closed for inactivity)
09:44:41 <dminuoso> c_wraith: How would you overload cons and nil? With a type of `class Consy t where cons :: a -> t a -> t a; nil :: t a; uncons :: t a -> (a, t a)`
09:44:49 kritzefitz joins (~kritzefit@debian/kritzefitz)
09:45:03 <dminuoso> Or did you mean something else?
09:45:33 × blomberg quits (default_us@gateway/vpn/protonvpn/thatpythonboy) (Ping timeout: 268 seconds)
09:45:59 <c_wraith> something along those lines. I've worked it out before, but I didn't bother memorizing it.
09:46:59 <dminuoso> c_wraith: It might be particularly interesting if this desugared nicely in pattern matches as well, such that `f (x:xs) = ..` would desugar into `f p = case uncons p of (x, xs) -> ...`
09:47:13 <dminuoso> Now that could be quite comfortable in a few situations
09:48:05 <dminuoso> Because one of the nice things about String is that it lets you comfortably write recursion on its content, but with this you could write it just as easily on text as well.
09:48:07 <c_wraith> yeah, it'd have to work out that way somehow
09:51:16 <dminuoso> That latter part should be easy enough to retrofit into the existing extension at least
09:52:03 <dminuoso> What surprises me a bit however is that IsList has a toList method
09:52:23 <dminuoso> That seems like it could rule out some potential instances
09:59:26 × califax quits (~califax@user/califx) (Ping timeout: 255 seconds)
10:00:00 califax joins (~califax@user/califx)
10:04:54 ubert1 joins (~Thunderbi@2a02:8109:abc0:6434:ca01:21c9:7b00:2bcf)
10:08:24 × ubert1 quits (~Thunderbi@2a02:8109:abc0:6434:ca01:21c9:7b00:2bcf) (Client Quit)
10:08:47 × chexum quits (~quassel@gateway/tor-sasl/chexum) (Quit: No Ping reply in 180 seconds.)
10:10:33 chexum joins (~quassel@gateway/tor-sasl/chexum)
10:11:52 Guest2318 joins (~Guest23@27.57.46.219)
10:15:16 Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915)
10:15:42 × Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 252 seconds)
10:15:44 × acidjnk_new quits (~acidjnk@p200300d6e7137a16c4eff8deb759a49f.dip0.t-ipconnect.de) (Ping timeout: 256 seconds)
10:16:16 troydm joins (~troydm@host-176-37-124-197.b025.la.net.ua)
10:16:31 Lord_of_Life_ is now known as Lord_of_Life
10:16:49 kenran joins (~user@user/kenran)
10:28:32 × anpad quits (~pandeyan@user/anpad) (Read error: Connection reset by peer)
10:30:55 beteigeuze joins (~Thunderbi@bl14-81-220.dsl.telepac.pt)
10:30:57 anpad joins (~pandeyan@user/anpad)
10:33:46 ubert1 joins (~Thunderbi@2a02:8109:abc0:6434:8bbb:a876:10e2:2306)
10:35:03 × kenran quits (~user@user/kenran) (Remote host closed the connection)
10:35:35 raehik joins (~raehik@213.86.197.10)
10:58:59 Guest75 joins (Guest75@2a01:7e01::f03c:92ff:fe5d:7b18)
11:00:18 × aeroplane quits (~user@user/aeroplane) (Ping timeout: 260 seconds)
11:00:40 acidjnk joins (~acidjnk@p200300d6e7137a1691284ca25ab2803c.dip0.t-ipconnect.de)
11:01:00 dextaa8 joins (~DV@user/dextaa)
11:02:46 × dextaa quits (~DV@user/dextaa) (Ping timeout: 256 seconds)
11:02:46 dextaa8 is now known as dextaa
11:06:02 × stiell quits (~stiell@gateway/tor-sasl/stiell) (Ping timeout: 255 seconds)
11:06:02 × Chai-T-Rex quits (~ChaiTRex@user/chaitrex) (Ping timeout: 255 seconds)
11:06:28 × xff0x_ quits (~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp) (Ping timeout: 248 seconds)
11:06:29 × califax quits (~califax@user/califx) (Ping timeout: 255 seconds)
11:06:29 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 255 seconds)
11:06:29 × jpds2 quits (~jpds@gateway/tor-sasl/jpds) (Ping timeout: 255 seconds)
11:06:29 × ec_ quits (~ec@gateway/tor-sasl/ec) (Ping timeout: 255 seconds)
11:06:42 califax joins (~califax@user/califx)
11:06:54 chexum_ joins (~quassel@gateway/tor-sasl/chexum)
11:07:23 × chexum quits (~quassel@gateway/tor-sasl/chexum) (Ping timeout: 255 seconds)
11:08:06 Chai-T-Rex joins (~ChaiTRex@user/chaitrex)
11:08:32 ec_ joins (~ec@gateway/tor-sasl/ec)
11:08:38 xff0x_ joins (~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp)
11:09:10 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
11:09:53 jpds2 joins (~jpds@gateway/tor-sasl/jpds)
11:11:16 × Guest2318 quits (~Guest23@27.57.46.219) (Ping timeout: 256 seconds)
11:12:54 <EvanR> dminuoso, what comes from List goes to List it's List. it's List
11:13:52 <dminuoso> EvanR: Sure, its just strange in that it's tighter than IsString, which can only ever go from a string but not back again
11:15:54 Unicorn_Princess joins (~Unicorn_P@user/Unicorn-Princess/x-3540542)
11:18:04 × xff0x_ quits (~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp) (Ping timeout: 256 seconds)
11:19:56 × chexum_ quits (~quassel@gateway/tor-sasl/chexum) (Quit: No Ping reply in 180 seconds.)
11:20:03 <Hecate> https://www.youtube.com/watch?v=MCfD7aIl-_E
11:21:51 stiell joins (~stiell@gateway/tor-sasl/stiell)
11:22:19 chexum joins (~quassel@gateway/tor-sasl/chexum)
11:24:18 × CiaoSen quits (~Jura@p200300c95747e0002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 256 seconds)
11:27:21 pflanze_ is now known as pflanze
11:32:53 × raehik quits (~raehik@213.86.197.10) (Ping timeout: 246 seconds)
11:34:44 × tabaqui quits (~root@88.231.62.215) (Ping timeout: 248 seconds)
11:37:20 × zant1 quits (~zant@62.214.20.26) (Ping timeout: 256 seconds)
11:41:30 eggplantade joins (~Eggplanta@2600:1700:38c5:d800:30d2:fcaf:3b1c:ad43)
11:44:08 × Ybombinator quits (~Ybombinat@85.254.74.38) (Read error: Connection reset by peer)
11:45:50 × eggplantade quits (~Eggplanta@2600:1700:38c5:d800:30d2:fcaf:3b1c:ad43) (Ping timeout: 256 seconds)
11:54:10 jakalx parts (~jakalx@base.jakalx.net) ()
12:00:16 aeroplane joins (~user@user/aeroplane)
12:02:08 jakalx joins (~jakalx@base.jakalx.net)
12:03:09 × phma quits (~phma@host-67-44-208-220.hnremote.net) (Read error: Connection reset by peer)
12:04:02 phma joins (phma@2001:5b0:211c:98f8:5c75:3015:c8e3:49df)
12:04:46 zant1 joins (~zant@2a00:20:600c:fe1d:c5b8:5056:38e4:8aa3)
12:08:21 zant2 joins (~zant@46.183.103.17)
12:08:21 × ec_ quits (~ec@gateway/tor-sasl/ec) (Remote host closed the connection)
12:08:43 CiaoSen joins (~Jura@p200300c95747e0002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
12:08:57 ec_ joins (~ec@gateway/tor-sasl/ec)
12:10:20 chomwitt joins (~chomwitt@2a02:587:7a05:dc00:1ac0:4dff:fedb:a3f1)
12:10:45 × zant1 quits (~zant@2a00:20:600c:fe1d:c5b8:5056:38e4:8aa3) (Ping timeout: 265 seconds)
12:14:13 × sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.)
12:15:30 sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10)
12:18:00 tabaqui joins (~root@88.231.62.215)
12:19:04 raehik joins (~raehik@213.86.197.10)
12:21:01 xff0x_ joins (~xff0x@ai071162.d.east.v6connect.net)
12:24:56 × zant2 quits (~zant@46.183.103.17) (Ping timeout: 256 seconds)
12:32:18 × acidjnk quits (~acidjnk@p200300d6e7137a1691284ca25ab2803c.dip0.t-ipconnect.de) (Ping timeout: 256 seconds)
12:34:46 zant2 joins (~zant@2a00:20:6058:2168:68e3:1b6:3e79:2688)
12:37:09 × chexum quits (~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection)
12:37:23 × jmdaemon quits (~jmdaemon@user/jmdaemon) (Ping timeout: 264 seconds)
12:37:45 chexum joins (~quassel@gateway/tor-sasl/chexum)
12:38:32 × raehik quits (~raehik@213.86.197.10) (Ping timeout: 256 seconds)
12:40:22 <Guillaum[m]> From the documentation, the "mask" status of `mask $ \restore -> ` is inherited in child threads (created with forkIO, or Async.async.) However, it is unclear if we can use `restore` a the child thread. The documentation of `forkIOWithUnmask` let us think that we cannot.
12:41:22 × zant2 quits (~zant@2a00:20:6058:2168:68e3:1b6:3e79:2688) (Ping timeout: 256 seconds)
12:42:59 <Guillaum[m]> Actually, the documentation of forkFinally suggest that it is possible to use restore in the child thread, see https://hackage.haskell.org/package/base-4.17.0.0/docs/Control-Concurrent.html#v:forkFinally, but in this case, what is the point of forkIOWithUnmask?
12:43:22 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
12:44:50 × son0p quits (~ff@2604:3d08:5b7f:5540::a58f) (Ping timeout: 260 seconds)
12:45:18 goober joins (~goober@90-231-13-185-no3430.tbcn.telia.com)
12:45:28 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Quit: = "")
12:45:46 <Guillaum[m]> Haa, I got it, reading https://www.fpcomplete.com/blog/2018/04/async-exception-handling-haskell/, the difference is subtle. One "restores" the previous state, when the other fully remove the masking state.
12:45:47 <Guillaum[m]> Thank you ;)
12:45:50 son0p joins (~ff@2604:3d08:5b7f:5540::a58f)
12:47:45 × MajorBiscuit quits (~MajorBisc@2001:1c00:2404:ed00:28e1:ad14:ec67:539e) (Ping timeout: 260 seconds)
12:48:07 raehik joins (~raehik@213.86.197.10)
12:49:05 mmhat joins (~mmh@p200300f1c73b51d2ee086bfffe095315.dip0.t-ipconnect.de)
12:54:47 × raehik quits (~raehik@213.86.197.10) (Ping timeout: 264 seconds)
12:57:17 <chreekat> :D
13:03:02 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Ping timeout: 255 seconds)
13:03:37 kuribas joins (~user@ptr-17d51epibvf1t5xp3ze.18120a2.ip6.access.telenet.be)
13:06:00 mestre joins (~mestre@191.177.185.178)
13:11:40 × cyphase quits (~cyphase@user/cyphase) (Ping timeout: 260 seconds)
13:13:08 <merijn> Guillaum[m]: Also, lemme recommend Simon Marlow's Parallel & Concurrent Haskell book that goes into excruciating detail on this ;)
13:14:39 <Guillaum[m]> merijn: thank you. Actually, I'm sure I read that one years ago, but concurrent programming is difficult AND I tend to forget about things when not used daily ;)
13:18:02 <maerwald[m]> It's easy to remember: don't trust haskell exceptions
13:18:29 <merijn> tbf, don't trust async exceptions in any language :p
13:18:35 <merijn> but a lot of languages don't have them
13:18:59 <dminuoso> Is there some idiom to tacking callstack information onto IO exception?
13:19:16 <Guillaum[m]> Well, C/C++ have signals, which is roughly the same in worse because it can corrupt your memory.
13:19:33 <[exa]> "have" signals
13:19:40 <dminuoso> Right now Im just annotating HasCallStack with my own exception hierarchy that all include CallStack in them, but that's fairly cumbersome
13:20:28 × troydm quits (~troydm@host-176-37-124-197.b025.la.net.ua) (Ping timeout: 256 seconds)
13:20:41 <dminuoso> maerwald[m]: any progress on that silly ghcup bug?
13:20:52 <merijn> Guillaum[m]: Yes, there's 2 kinds of people
13:21:06 <merijn> Guillaum[m]: People who think they can write signal handling code and people who don't lie to themselves :p
13:21:13 <dminuoso> Ahh it was indeed a bad header offset.
13:21:24 <dminuoso> Good catch
13:22:29 <dminuoso> What strikes me as strangely odd, is how d_name appears to have contained sensible results.
13:22:48 <dminuoso> Shouldnt d_name have had a bad offsset as well?
13:28:31 shriekingnoise joins (~shrieking@186.137.167.202)
13:30:11 <maerwald[m]> dminuoso: yes
13:30:31 <maerwald[m]> https://github.com/haskell/ghcup-hs/issues/415#issuecomment-1344184716
13:30:31 <maerwald[m]> What exactly messes with the defines is still not clear
13:31:19 <maerwald[m]> The other ccall is from unix package, which happens to include the right headers
13:31:32 <maerwald[m]> Still something is wrong
13:31:45 <maerwald[m]> You shouldn't need to add defines for system headers to be correct
13:32:05 <maerwald[m]> So I think something is messing with macros
13:32:16 <dminuoso> maerwald[m]: But seriously, why did the d_name field contain the expected data?
13:32:28 <dminuoso> I dont quite get that part.
13:32:43 <dminuoso> Or was d_name just accidentally aligned correctly?
13:33:01 <maerwald[m]> dminuoso: the function that uses d_type is defined in GHCup. The function that uses d_name in unix
13:33:10 <dminuoso> Ohhhh
13:33:21 <maerwald[m]> They have different includes
13:33:30 <dminuoso> I hate C with a passion.
13:33:34 <maerwald[m]> But that still doesn't make sense
13:34:10 <maerwald[m]> If you write a minimal main.c, all the d_type stuff is correct
13:34:10 <maerwald[m]> So something makes it incorrect in Haskell
13:34:36 <maerwald[m]> And then ghcconfig.h makes it correct again
13:34:42 <dminuoso> maerwald[m]: Could be fixincludes perhaps?
13:35:26 <dminuoso> If it is, you will have an incredibly hard time figuring it out. :p
13:36:01 <dminuoso> Or some other header that gets accidentally tossed in disables that macro
13:36:21 <maerwald[m]> But now I worry... including HsFFI.h fixes it, but what other side effects may it have
13:37:45 MajorBiscuit joins (~MajorBisc@145.94.137.174)
13:38:07 <maerwald[m]> Anyway, that's just more of a reason to merge https://github.com/haskell/unix/pull/251
13:40:05 <maerwald[m]> GHC will probably not care, because they stopped supporting armv7
13:41:20 <merijn> maerwald[m]: unsupported platforms is just "it is someone else's problem to contribute fixes", so they will care, just not invest any effort into fixing
13:41:40 <merijn> Assuming said fixes don't break everything else, ofc :p
13:42:14 × akegalj quits (~akegalj@141-136-183-112.dsl.iskon.hr) (Ping timeout: 260 seconds)
13:43:14 <maerwald[m]> merijn: they don't have arm runners anymore I think
13:44:06 <maerwald[m]> https://gitlab.haskell.org/ghc/ghc/-/pipelines/60010
13:46:23 <chreekat> yeah, no more armv7 runners, since the servers were taken away. armv7 was and continues to be a "Tier 2 platform", meaning whether GHC works for it depends on community support. In other words, nobody is paid to keep them working
13:46:32 FinnElija joins (~finn_elij@user/finn-elija/x-0085643)
13:47:53 <maerwald[m]> Probably not good for adoption though
13:52:47 zant2 joins (~zant@62.214.20.26)
13:56:26 × Chai-T-Rex quits (~ChaiTRex@user/chaitrex) (Remote host closed the connection)
13:56:32 <merijn> Sure, but someone has to foot the bill for these things
13:57:04 Chai-T-Rex joins (~ChaiTRex@user/chaitrex)
13:59:47 Erutuon_ joins (~Erutuon@user/erutuon)
14:01:35 <maerwald> merijn: HF?
14:02:24 × MajorBiscuit quits (~MajorBisc@145.94.137.174) (Ping timeout: 256 seconds)
14:02:42 <chreekat> meanwhile, ghc also doesn't work great on aarch64/macOS Ventura, and that is considered highest priority and ppl are paid to work on it :) https://gitlab.haskell.org/ghc/ghc/-/issues/22497
14:03:02 <merijn> maerwald: Sure, but that's up to HF then, not GHC HQ. Can't blame GHC HQ for dropping niche architectures no one is paying to maintain
14:03:27 <maerwald> merijn: did they source community opinions before dropping?
14:03:43 <maerwald> like, a call for help?
14:05:30 <albet70> except callCC, is there way to do early exit?
14:09:04 festive_kurbus joins (~festive_k@user/kurbus)
14:10:49 <dminuoso> You can use IO exceptions, MaybeT, EitherT
14:11:06 <dminuoso> (Err called ExceptT actually)
14:11:35 <dminuoso> And you can also wrap entire monadic expressions in `when` ...
14:11:42 <dminuoso> Or you branch off in a guard early in a binding
14:12:26 [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470)
14:13:41 akegalj joins (~akegalj@141-136-183-112.dsl.iskon.hr)
14:16:08 × phma quits (phma@2001:5b0:211c:98f8:5c75:3015:c8e3:49df) (Read error: Connection reset by peer)
14:16:14 <albet70> dminuoso , this is the actual code https://paste.tomsmeding.com/FZoU3vqb
14:17:32 phma joins (phma@2001:5b0:211b:de08:e3b4:8590:6dc5:da01)
14:17:56 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
14:18:54 <dminuoso> albet70: Given the context, do you consider an "empty" file an error?
14:19:22 <albet70> in that 'traverse' , if-then-else branch, I can set 'return Left x' or 'return Right x' then the whole 'traverse' will return ActionM [Either a b], to check that Left Right decide to run the lase line 'redirect' or 'return ()'
14:19:33 <dminuoso> Either way, scotty which I presume you are using, has a bunch of exceptions to short circuit the entire handler
14:19:36 <dminuoso> https://hackage.haskell.org/package/scotty-0.12.1/docs/Web-Scotty.html#g:7
14:20:16 <dminuoso> Do you want to abort the entire handler, or just skip the file?
14:20:23 <dminuoso> Or whats the intention?
14:21:15 <albet70> 'finish' seems right
14:21:27 <albet70> entire handler
14:21:41 <dminuoso> Consider using `raiseStatus` even
14:22:39 × megaTherion quits (~therion@unix.io) (Quit: ZNC 1.8.2 - https://znc.in)
14:23:27 <albet70> how about turn it into ContT () ActionM a, then inside callCC to short circuit?
14:23:53 <dminuoso> You can do that as well.
14:24:12 megaTherion joins (~therion@unix.io)
14:24:17 <dminuoso> It seems unnecessarily complex, given that you have `raiseStatus` at your disposal, but its your choice.
14:24:32 <maerwald> pleasn don't use ContT
14:24:40 <dminuoso> Hey its their sanity.
14:24:45 <albet70> I don't want to refresh the front page
14:24:57 <dminuoso> Mental wards need patients too, or they lose income
14:25:05 thegeekinside joins (~thegeekin@189.217.82.244)
14:25:21 <maerwald> that should be in the haddock of ContT
14:25:25 <dminuoso> I do not know what raiseStatus has to do with "refreshing the front page" (whatever that means for you)
14:26:33 <albet70> Throw an exception, which can be caught with rescue. Uncaught exceptions turn into HTTP responses corresponding to the given status.
14:26:47 <albet70> that http responses is not what I want
14:26:54 × shriekingnoise quits (~shrieking@186.137.167.202) (Quit: Quit)
14:27:15 shriekingnoise joins (~shrieking@186.137.167.202)
14:27:47 × xff0x_ quits (~xff0x@ai071162.d.east.v6connect.net) (Ping timeout: 264 seconds)
14:29:51 <geekosaur> isn't it going to have to produce some HTTP response?
14:30:01 × megaTherion quits (~therion@unix.io) (Quit: ZNC 1.8.2 - https://znc.in)
14:32:00 xff0x_ joins (~xff0x@ai071162.d.east.v6connect.net)
14:32:17 megaTherion joins (~therion@unix.io)
14:32:40 × son0p quits (~ff@2604:3d08:5b7f:5540::a58f) (Remote host closed the connection)
14:33:33 Sgeo joins (~Sgeo@user/sgeo)
14:34:32 son0p joins (~ff@2604:3d08:5b7f:5540::a58f)
14:35:59 <albet70> it seems likely
14:36:08 bontaq joins (~user@ool-45779fe5.dyn.optonline.net)
14:37:58 <albet70> wait a sec, maybe there is no need to create ContT to short circuit, 'traverse' do early exit already
14:39:02 <albet70> oh, traverse can not exit whole function, ignore the privious msg
14:44:17 × azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds)
14:45:02 × gwern quits (~gwern@user/gwern) (Ping timeout: 246 seconds)
14:49:29 jargon joins (~jargon@174-22-192-24.phnx.qwest.net)
14:54:51 × chele quits (~chele@user/chele) (Quit: Leaving)
14:56:04 gwern joins (~gwern@user/gwern)
14:58:42 mikoto-chan joins (~mikoto-ch@2001:999:400:4e51:8dbe:5654:a687:d771)
15:01:20 × akegalj quits (~akegalj@141-136-183-112.dsl.iskon.hr) (Ping timeout: 256 seconds)
15:02:34 × kaskal quits (~kaskal@213-147-167-253.nat.highway.webapn.at) (Quit: ZNC - https://znc.in)
15:03:06 kaskal joins (~kaskal@2001:4bb8:2d1:32ed:7894:4e7:1e3f:f8dd)
15:05:52 × tabaqui quits (~root@88.231.62.215) (Ping timeout: 256 seconds)
15:07:53 × festive_kurbus quits (~festive_k@user/kurbus) (Quit: Client closed)
15:15:11 × motherfsck quits (~motherfsc@user/motherfsck) (Quit: quit)
15:15:19 × CiaoSen quits (~Jura@p200300c95747e0002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 256 seconds)
15:15:29 motherfsck joins (~motherfsc@user/motherfsck)
15:15:52 × motherfsck quits (~motherfsc@user/motherfsck) (Client Quit)
15:16:29 motherfsck joins (~motherfsc@user/motherfsck)
15:17:16 × cfricke quits (~cfricke@user/cfricke) (Quit: WeeChat 3.7.1)
15:19:44 × razetime quits (~quassel@49.207.203.213) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
15:19:51 × kaskal quits (~kaskal@2001:4bb8:2d1:32ed:7894:4e7:1e3f:f8dd) (Quit: ZNC - https://znc.in)
15:21:18 kaskal joins (~kaskal@2001:4bb8:2d1:32ed:7894:4e7:1e3f:f8dd)
15:25:37 × motherfsck quits (~motherfsc@user/motherfsck) (Quit: quit)
15:26:22 festive_kurbus joins (~festive_k@user/kurbus)
15:27:22 motherfsck joins (~motherfsc@user/motherfsck)
15:28:21 × mikoto-chan quits (~mikoto-ch@2001:999:400:4e51:8dbe:5654:a687:d771) (Ping timeout: 256 seconds)
15:30:09 × motherfsck quits (~motherfsc@user/motherfsck) (Client Quit)
15:30:31 motherfsck joins (~motherfsc@user/motherfsck)
15:31:32 × califax quits (~califax@user/califx) (Ping timeout: 255 seconds)
15:32:26 × Chai-T-Rex quits (~ChaiTRex@user/chaitrex) (Ping timeout: 255 seconds)
15:32:53 × jpds2 quits (~jpds@gateway/tor-sasl/jpds) (Ping timeout: 255 seconds)
15:33:20 × chexum quits (~quassel@gateway/tor-sasl/chexum) (Ping timeout: 255 seconds)
15:33:20 × ec_ quits (~ec@gateway/tor-sasl/ec) (Ping timeout: 255 seconds)
15:34:56 raehik joins (~raehik@213.86.197.10)
15:35:17 × motherfsck quits (~motherfsc@user/motherfsck) (Client Quit)
15:35:59 chexum joins (~quassel@gateway/tor-sasl/chexum)
15:36:52 jpds2 joins (~jpds@gateway/tor-sasl/jpds)
15:36:54 Chai-T-Rex joins (~ChaiTRex@user/chaitrex)
15:37:04 CiaoSen joins (~Jura@p200300c95747e0002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
15:37:51 ec_ joins (~ec@gateway/tor-sasl/ec)
15:37:57 califax joins (~califax@user/califx)
15:40:27 × festive_kurbus quits (~festive_k@user/kurbus) (Quit: Client closed)
15:40:32 motherfsck joins (~motherfsc@user/motherfsck)
15:42:09 × raehik quits (~raehik@213.86.197.10) (Ping timeout: 252 seconds)
15:43:20 × merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 260 seconds)
15:45:11 × mestre quits (~mestre@191.177.185.178) (Quit: Lost terminal)
15:49:51 tabaqui joins (~root@88.231.62.215)
16:00:48 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
16:02:25 raehik joins (~raehik@213.86.197.10)
16:03:43 × lortabac quits (~lortabac@2a01:e0a:541:b8f0:5543:4ce0:b6b6:f758) (Quit: WeeChat 2.8)
16:10:03 merijn joins (~merijn@86-86-29-250.fixed.kpn.net)
16:13:22 festive_kurbus joins (~festive_k@user/kurbus)
16:15:34 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
16:17:08 jakalx parts (~jakalx@base.jakalx.net) ()
16:17:10 jakalx joins (~jakalx@base.jakalx.net)
16:17:44 Techcable joins (~Techcable@user/Techcable)
16:26:09 × raehik quits (~raehik@213.86.197.10) (Ping timeout: 260 seconds)
16:31:45 acidjnk joins (~acidjnk@p54ad5adb.dip0.t-ipconnect.de)
16:32:35 × causal quits (~user@50.35.85.7) (Quit: WeeChat 3.7.1)
16:35:13 × mbuf quits (~Shakthi@49.205.86.134) (Quit: Leaving)
16:37:22 eggplantade joins (~Eggplanta@2600:1700:38c5:d800:30d2:fcaf:3b1c:ad43)
16:40:41 srk joins (~sorki@user/srk)
16:43:46 × son0p quits (~ff@2604:3d08:5b7f:5540::a58f) (Remote host closed the connection)
16:44:22 × merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 252 seconds)
16:47:15 × jespada quits (~jespada@nmal-24-b2-v4wan-166357-cust1764.vm24.cable.virginm.net) (Quit: Textual IRC Client: www.textualapp.com)
16:51:11 × festive_kurbus quits (~festive_k@user/kurbus) (Quit: Client closed)
16:52:13 Scraeling joins (~Scraeling@user/scraeling)
16:54:13 × ubert1 quits (~Thunderbi@2a02:8109:abc0:6434:8bbb:a876:10e2:2306) (Quit: ubert1)
16:57:04 raehik joins (~raehik@213.86.197.10)
16:59:06 Guest237 joins (~Guest23@27.57.46.219)
17:00:18 × srk quits (~sorki@user/srk) (Quit: ZNC 1.8.1 - https://znc.in)
17:00:42 srk joins (~sorki@user/srk)
17:01:05 Tuplanolla joins (~Tuplanoll@91-159-68-152.elisa-laajakaista.fi)
17:04:54 × freeside quits (~mengwong@103.252.202.193) (Ping timeout: 252 seconds)
17:05:17 cyphase joins (~cyphase@user/cyphase)
17:05:41 finsternis joins (~X@23.226.237.192)
17:05:42 festive_kurbus joins (~festive_k@user/kurbus)
17:08:43 Lycurgus joins (~juan@user/Lycurgus)
17:10:19 × festive_kurbus quits (~festive_k@user/kurbus) (Client Quit)
17:16:19 × bontaq quits (~user@ool-45779fe5.dyn.optonline.net) (Remote host closed the connection)
17:18:26 freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg)
17:21:17 merijn joins (~merijn@86-86-29-250.fixed.kpn.net)
17:22:16 × pavonia quits (~user@user/siracusa) (Quit: Bye!)
17:24:01 econo joins (uid147250@user/econo)
17:24:27 pestilence_ joins (~alice@2601:c2:8300:a580:7c6b:b13c:ce9c:c116)
17:25:46 × motherfsck quits (~motherfsc@user/motherfsck) (Quit: quit)
17:26:12 × merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 268 seconds)
17:26:37 × zeenk quits (~zeenk@2a02:2f04:a30d:4300::7fe) (Quit: Konversation terminated!)
17:28:11 motherfsck joins (~motherfsc@user/motherfsck)
17:30:11 × CiaoSen quits (~Jura@p200300c95747e0002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 246 seconds)
17:30:29 × eggplantade quits (~Eggplanta@2600:1700:38c5:d800:30d2:fcaf:3b1c:ad43) (Remote host closed the connection)
17:32:28 ft joins (~ft@p508dbd59.dip0.t-ipconnect.de)
17:35:48 eggplantade joins (~Eggplanta@2600:1700:38c5:d800:cc2a:ce80:f3c:358f)
17:41:31 × tabaqui quits (~root@88.231.62.215) (Quit: WeeChat 3.7.1)
17:48:21 × Lycurgus quits (~juan@user/Lycurgus) (Quit: Exeunt https://tinyurl.com/4m8d4kd5)
17:48:24 × Guest237 quits (~Guest23@27.57.46.219) (Ping timeout: 260 seconds)
17:49:27 festive_kurbus joins (~festive_k@user/kurbus)
17:53:21 bazoo joins (~bazoo@93.51.40.51)
17:55:19 <bazoo> geekosaur EvanR: I kept trying making a bounded int type and after digging for a couple hours in the base codebase I came up with the following, Am I on a good track? data Range :: Nat -> Nat -> Type where R :: (KnownNat x, min <= x, x <= max) => Proxy x -> Range min max
17:57:33 × nschoe quits (~q@141.101.51.197) (Quit: Switching off)
17:59:17 × cyphase quits (~cyphase@user/cyphase) (Ping timeout: 246 seconds)
17:59:40 <c_wraith> I think that's basically as good as possible in GHC as it stands, but I don't think it's going to be pleasant to use.
18:00:24 × raehik quits (~raehik@213.86.197.10) (Ping timeout: 256 seconds)
18:00:34 <bazoo> Indeed, as I'm not even sure how could I construct values of such type
18:00:49 pestilence_ parts (~alice@2601:c2:8300:a580:7c6b:b13c:ce9c:c116) (Using Circe, the loveliest of all IRC clients)
18:02:37 <c_wraith> Oh, that Proxy in a negative position is unnecessarily limiting. You could instead use proxy x -> Range min max
18:03:28 <c_wraith> the higher-kinded type variable is a fun trick when doing type-level stuff.
18:04:26 cyphase joins (~cyphase@user/cyphase)
18:04:56 <c_wraith> but regardless of that. You could construct a value of that type with something like foo :: Range 0 10 ; foo = R (Proxy :: Proxy 5)
18:05:50 <c_wraith> But that doesn't change how awkward it is to work with :)
18:07:29 <bazoo> True, I was hoping to be able to do something like foo :: Range 0 10 ; foo = R 5, but I'm not able to unify x with 5
18:10:15 son0p joins (~ff@2604:3d08:5b7f:5540::a58f)
18:11:04 <c_wraith> Yeah, this is the sort of thing that Haskell tools just aren't good at. Even with the extensions GHC provides.
18:11:27 merijn joins (~merijn@86-86-29-250.fixed.kpn.net)
18:13:30 <bazoo> I think the time has come for me to start looking at idris
18:13:35 <stefan-_> I got a question regarding aoc and parsec
18:13:40 <stefan-_> for this: https://gist.github.com/dozed/7f0ea0ec4ac6191b4b978012fcf21923
18:14:01 <stefan-_> I get: Left (line 5, column 1): unexpected "1" expecting " "
18:14:22 <stefan-_> basically the question is how to switch from one parsing mode (with many1) to another mode
18:17:57 <stefan-_> s/many1/sepBy1/
18:18:52 <dminuoso> All the parsec questions come up in December. Always.
18:19:14 <dminuoso> It's like a universal constant that should be included in the Feynman Lectures on Physics
18:19:31 <stefan-_> :)
18:19:34 × son0p quits (~ff@2604:3d08:5b7f:5540::a58f) (Remote host closed the connection)
18:21:18 wroathe joins (~wroathe@207-153-38-140.fttp.usinternet.com)
18:21:18 × wroathe quits (~wroathe@207-153-38-140.fttp.usinternet.com) (Changing host)
18:21:18 wroathe joins (~wroathe@user/wroathe)
18:22:20 wootehfoot joins (~wootehfoo@user/wootehfoot)
18:23:12 Guest2347 joins (~Guest23@27.57.46.219)
18:23:32 × festive_kurbus quits (~festive_k@user/kurbus) (Quit: Client closed)
18:23:56 tzh joins (~tzh@c-24-21-73-154.hsd1.or.comcast.net)
18:29:12 son0p joins (~ff@2604:3d08:5b7f:5540::a58f)
18:33:30 <mauke> stefan-_: the problem is that string " " commits to succeeding by consuming at least one character of input
18:35:02 × chexum quits (~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection)
18:35:34 chexum joins (~quassel@gateway/tor-sasl/chexum)
18:36:47 <mauke> stefan-_: as a rule of thumb, all string s should be try (string s) instead
18:36:57 <carter> hows everyone?
18:37:26 <mauke> actually, I'm not sure if that's enough
18:37:54 <stefan-_> mauke, this didnt help, gives the same error
18:38:18 <stefan-_> I thought about wrapping the two input parts in a sum type and parse with <|>
18:38:24 <stefan-_> but this seems overly complicated
18:38:39 × Cale quits (~cale@cpef48e38ee8583-cm30b7d4b3fc20.cpe.net.cable.rogers.com) (Read error: Connection reset by peer)
18:38:58 × Guest2347 quits (~Guest23@27.57.46.219) (Ping timeout: 268 seconds)
18:40:36 <mauke> it should give a slightly different error, I think
18:40:52 <mauke> stefan-_: anyway, I think the sepBy1 in the main parser should be endBy1 instead
18:41:01 <mauke> (and one of the other endOfLine's removed)
18:41:52 <mauke> because in the current code, it sees the '\n' and goes "hey, that's a separator! better parse another occurrence of itemsParser"
18:41:59 <mauke> which then fails
18:42:01 <dminuoso> Well even with `try (string " ")` you have the problem that no branch available here can succeed.
18:42:08 <dminuoso> So parsec will just report on the first branch
18:43:00 <dminuoso> Yup, in connection with what mauke said
18:43:20 <dminuoso> Honestly this is a type of input I would not use megaparsec to parse with.
18:43:24 <dminuoso> *parsec
18:43:59 caef^ joins (~caef@76.145.185.103)
18:44:25 <dminuoso> Or at the very least not with backtracking here. Lookahead and brach is more suitable
18:44:27 × merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 248 seconds)
18:44:38 <dminuoso> Rather than just this <|> randomly stabbing and hopnig it does what you want
18:45:08 <stefan-_> try (string " ") together with endBy1 consumes at least the first part
18:45:18 <stefan-_> `many1 anyChar` then consumes the rest
18:45:21 festive_kurbus joins (~festive_k@user/kurbus)
18:45:44 <mauke> here's my parser: https://paste.tomsmeding.com/tLizvfWG
18:45:57 <mauke> it doesn't use parsec, but it should be pretty obvious anyway, I hope
18:46:18 <dminuoso> I should conjure up a fancy flatparser example for this
18:46:35 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
18:46:51 <dminuoso> Is this the input for Day 9 part 2?
18:47:00 <mauke> this is day 5
18:48:43 <mauke> btw, I love the Applicative interface for parsing
18:49:14 <mauke> <* is just so nice to have
18:49:36 emmanuelux joins (~emmanuelu@user/emmanuelux)
18:49:53 × bazoo quits (~bazoo@93.51.40.51) (Ping timeout: 260 seconds)
18:56:38 × aeroplane quits (~user@user/aeroplane) (Ping timeout: 246 seconds)
18:59:29 × festive_kurbus quits (~festive_k@user/kurbus) (Quit: Client closed)
19:03:36 <stefan-_> mauke, this does it: https://gist.github.com/dozed/2bd3f4321c012727f9587d59450d098c
19:04:37 <stefan-_> although I wonder why endBy1 works, but not sepBy1 followed by endOfLine
19:04:52 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 268 seconds)
19:05:11 <mauke> because endBy1 treats the newline as part of one element (or one iteration of the inner parser)
19:05:41 <mauke> if the parser at the beginning of the next iteration fails, endBy1 is fine with it and returns what it managed to collect before
19:06:06 <mauke> on the other hand, sepBy1 treats the separator as a reliable indicator that another element will follow
19:06:23 <mauke> so if it sees a "\n", it insists on parsing another items line
19:08:09 × jjhoo quits (~jahakala@user/jjhoo) (Remote host closed the connection)
19:08:45 <mauke> basically, there is this branching structure: (sep >> items >> ...) <|> (endOfLine >> ...)
19:09:09 <mauke> (the first ... loops back to sepBy1; the second ... is the code block that follows with moveSpecParser)
19:09:29 <mauke> since sep = endOfLine in your code, there is an ambiguity here
19:09:42 <mauke> and it cannot be resolved just by looking at the next char
19:10:08 <mauke> uh, I should be more explicit about stuff
19:10:40 merijn joins (~merijn@86-86-29-250.fixed.kpn.net)
19:11:12 <mauke> consider the following code: do { items <- sepBy1 itemsParser endOfLine; endOfLine; many1 anyChar }
19:12:24 <mauke> after parsing the first occurrence of itemsParser, sepBy1 has to make a choice: either stop and return the list of results so far, or try for another iteration of the inner parser
19:12:54 <mauke> well, the way sepBy1 makes this choice is by seeing whether the separator parser succeeds, which is endOfLine in thie code
19:14:20 <mauke> since there is a '\n' in the input at that point, the separator check succeeds
19:14:35 <stefan-_> ok, so sepBy1 is implemented with `many (sep >> p)`, which fails if p does not succeed
19:14:39 <mauke> sepBy1 p sep = do { x <- p; xs <- many (sep >> p); return (x : xs) }
19:14:54 <mauke> the only way out of this is to make sep fail without consuming any input
19:14:56 <stefan-_> and there is no `try` to mitigate this
19:15:00 <mauke> right
19:15:11 × merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 246 seconds)
19:15:26 <mauke> you would need a 'try' around the whole (sep >> p) construct, which you can't insert without writing your own version of sepBy1
19:15:37 <stefan-_> yep, makes sense
19:15:43 <stefan-_> thanks for the explanation :)
19:15:53 <mauke> you're welcome :-)
19:16:43 jjhoo joins (~jahakala@user/jjhoo)
19:16:45 <mauke> also, your move parser is incomplete because it doesn't accept multi-digit numbers
19:17:18 <mauke> "move 22 from 3 to 4", etc
19:18:25 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
19:19:02 <stefan-_> mauke, good point, `many1` should do it
19:20:55 <EvanR> wow my day 9 code reduced like hell
19:21:51 <mauke> reduce - reuse - ecyce
19:24:39 gurkenglas joins (~gurkengla@p548ac72e.dip0.t-ipconnect.de)
19:24:55 ei30metry[m] joins (~ei30metry@2001:470:69fc:105::2:d5ee)
19:31:12 <dminuoso> https://gist.github.com/dminuoso/3f8272c66fed64349f28c171deafdefa
19:31:21 <dminuoso> This is how I would write a parser for those crates probably?
19:31:50 × califax quits (~califax@user/califx) (Ping timeout: 255 seconds)
19:31:56 <dminuoso> I think its much easier to think in terms of branching than to control backtracking and rely on <|>
19:32:39 <dminuoso> (But take note, that something like lookahead is absurdly cheap in flatparse, so I dont know about parsec)
19:32:44 califax joins (~califax@user/califx)
19:33:48 × Scraeling quits (~Scraeling@user/scraeling) (Read error: Connection reset by peer)
19:33:49 <EvanR> unsolicited report I used pattern matching to turn [c] into Just c and " " into Nothing, then transpose, catMaybes
19:34:36 <dminuoso> I gotta golf this out with maximum performance and minimum memory wastage.
19:34:47 <EvanR> performance golf lol
19:35:04 <mauke> dminuoso: what is FP.empty?
19:35:16 <dminuoso> mauke: Its a failure you can backtrack on
19:35:27 <dminuoso> (or rather a failure that will trigger backtrack)
19:35:38 festive_kurbus joins (~festive_k@user/kurbus)
19:35:49 <mauke> not really needed here
19:36:09 <dminuoso> It certainly is not, I could just connect the loop here.
19:36:42 <mauke> why is FP.char a macro?
19:36:53 <dminuoso> Heh yeah funny story here.
19:37:02 <dminuoso> Long story is, string is a macro for good reason
19:37:22 <dminuoso> And char is a macro because depending on what codepoint you have, we end up generating different code
19:37:39 <dminuoso> if its a 1-octet we just peek a singular word off
19:38:11 <mauke> I see
19:39:19 <dminuoso> And similarly `string` will construct a correct sequence of reading word64, and then word8s...
19:39:38 <dminuoso> So read in register sized chunks as much as possible
19:40:07 <dminuoso> there's also `switch` with a funny quasi quoter that will let you write a case-of, but compile into a trie based lookup
19:40:41 <dminuoso> so you write $(switch [| case _ of "foo" -> ...; "bar" -> ...; "quux" -> ... |] )
19:40:50 <dminuoso> And it will do the maximally efficient thing
19:41:11 <dminuoso> (And if there's shared prefixes, due to the trie representation, it will save unnecessary duplication)
19:41:30 <dminuoso> its pretty cool
19:41:53 <mauke> you could still do that at runtime, right?
19:42:25 <mauke> hmm
19:43:04 <mauke> I suppose you'd need an associated "accept" set (or char?) for each subparser
19:48:04 × zant2 quits (~zant@62.214.20.26) (Ping timeout: 256 seconds)
19:48:58 <stefan-_> for the record, here the full solution for day5 part1: https://gist.github.com/dozed/798712c7d1fe4a2a591c9e3d6b7c3586
19:49:47 troydm joins (~troydm@host-176-37-124-197.b025.la.net.ua)
19:50:47 × mmhat quits (~mmh@p200300f1c73b51d2ee086bfffe095315.dip0.t-ipconnect.de) (Quit: WeeChat 3.7.1)
19:53:10 × jargon quits (~jargon@174-22-192-24.phnx.qwest.net) (Ping timeout: 256 seconds)
19:56:38 huskle joins (~huskle@250.79-105-213.static.virginmediabusiness.co.uk)
19:57:05 × festive_kurbus quits (~festive_k@user/kurbus) (Quit: Client closed)
19:57:33 <huskle> argh god, its friday here and its absolute carnage outside - is there any peaceful sort of haskell stuff that i could use to take my mind of all of this terrifying society
19:57:55 <monochrom> What carnage? What outside?
19:58:06 <darkling> There's an outside? I don't understand.
19:58:09 <huskle> oh, your on-silico too?
19:58:10 <monochrom> Are people hoarding toilet papers again?
19:58:28 <EvanR> dminuoso, I really like how haskell has options for distilling performance through more or less outlandish machinations
19:58:38 <huskle> what!? carrying bundles of rolls or something?
19:58:43 <EvanR> I really really like the other options xD
19:59:23 <huskle> nono, i meant to take my mind off of all of the terribleness, not be encouraged to explain it!
19:59:31 <EvanR> please don't explain it
19:59:32 <huskle> isnt there some great new haskell to be getting on with?
19:59:49 <huskle> EvanR: or to be discouraged from explaining it!
19:59:59 <EvanR> ghc 9.2.5 here, not new but newer than what I had last week
20:00:25 <huskle> i thought that it didnt do anything new at all infact
20:00:47 o-90 joins (~o-90@gateway/tor-sasl/o-90)
20:01:02 <monochrom> We could debate again on whether GHC2022 would be a good idea...
20:01:28 <monochrom> Or rather, GHC2023.
20:01:39 <huskle> this is too far ahead thinking
20:02:01 <huskle> my recent updates prevent me from thinking further ahead than the next meal
20:02:07 <monochrom> https://discourse.haskell.org/t/quo-vadit-ghc2023/5220 I'm actually surprised that some people say no.
20:02:21 jargon joins (~jargon@174-22-192-24.phnx.qwest.net)
20:02:38 <EvanR> GHC Oh 23
20:02:56 × use-value quits (~Thunderbi@2a00:23c6:8a03:2f01:75c2:a71f:beaa:29bf) (Remote host closed the connection)
20:03:15 use-value joins (~Thunderbi@2a00:23c6:8a03:2f01:75c2:a71f:beaa:29bf)
20:03:22 <monochrom> Or rather, I'm surprised some people say yes to GHC2021 and then no to GHC2023.
20:04:14 <EvanR> are the proposals accelerating in frequency like zeno's paradox, and we are approaching a limiting ghc
20:04:32 <huskle> just because im not getting bugs at the frequency i used too..
20:04:37 <monochrom> No I think it will be more or less periodic not zeno-converging.
20:04:57 <EvanR> no singularity for monochrom
20:05:05 029AAI9YL joins (~Thunderbi@179.214.113.107)
20:05:10 <huskle> i mean, if we were serious about that i could trying to dig up that code error that near killed me
20:05:17 kenran joins (~user@user/kenran)
20:05:17 <monochrom> Hell, it may even slow down. There are only so many extensions to add.
20:05:35 × kenran quits (~user@user/kenran) (Remote host closed the connection)
20:05:35 × avicenzi quits (~avicenzi@2a00:ca8:a1f:b004::c32) (Ping timeout: 264 seconds)
20:05:55 <huskle> one thing i think the haskell community could do better at is to do with this "no creative input" paradox
20:05:59 <monochrom> Ugh did the code error cause harmful radiation on you so that it really warrants "nearly killed me"?
20:06:07 <huskle> yes
20:06:10 <dsal> ghc -O23
20:06:17 <huskle> i ended up in hospital
20:06:28 <EvanR> there's more radiation in the hospital than outside
20:06:43 <huskle> and since having been discharged still have not been able to access any GP care to get my prescription
20:06:49 <monochrom> What is "no creative input"?
20:07:00 <huskle> its to do with "well its your idea, so..."
20:07:11 <monochrom> Wait, am I observationally equivalent to Elizer? >:)
20:07:34 <huskle> EvanR: this is true, we documented / developed much of it during my stay
20:07:49 × 029AAI9YL quits (~Thunderbi@179.214.113.107) (Remote host closed the connection)
20:07:49 <huskle> as im sure you can all appreciate given how we have been working here
20:08:07 <huskle> at least haskell isnt as political as the NHS
20:08:20 <huskle> or the compiler errors would be, like *even worse*
20:08:30 <EvanR> huskle, what is the solution of this equation: x = x + 1
20:08:38 <darkling> Inject 'em with technetium, and PET them in the dark... :)
20:09:00 <huskle> EvanR: im not sure why you would ask this. im not thankful for the interjection unfortunately
20:09:14 mvk joins (~mvk@2607:fea8:5ce3:8500::efb)
20:09:23 <mauke> Infinity, -Infinity, NaN, undefined
20:09:24 <EvanR> is that all you got
20:09:29 × mvk quits (~mvk@2607:fea8:5ce3:8500::efb) (Client Quit)
20:09:40 <EvanR> mauke confirmed not a bot
20:09:50 <monochrom> I still don't understand the ""no creative input" paradox"
20:09:54 <huskle> what is this, twitter?
20:10:14 <mauke> sorry for interrupting your blog
20:10:25 <huskle> good
20:10:30 <huskle> monochrom: its kind of an extreem version of "no spoonfeeding" its to do with strange loops
20:10:56 <monochrom> Well I stand firming with no spoonfeeding.
20:11:05 <monochrom> err, s/firming/firmly/
20:11:06 <huskle> makes my life a living hell, other than when people go to great lengths to augment it with things barely recoverable from in terms of space technology
20:11:15 <EvanR> no spoon affirming
20:11:20 <monochrom> At least, when I'm not getting paid to do spoonfeeding.
20:11:37 jakalx parts (~jakalx@base.jakalx.net) (Error from remote client)
20:11:49 <huskle> monochrom: the thing is, while its important that the people that end up fixing issues actually manage to do so, and often therefore cannot get the help they need
20:12:02 <monochrom> Hell, even when I'm paid to teach a university course, I have an "I won't do spoonfeeding" course policy stated explicitly.
20:12:15 <monochrom> Then again that's just because it's a university course.
20:12:15 <huskle> something something i forget but ill just get old and die and nobody will understand or care because they will just rewrite history
20:12:28 merijn joins (~merijn@86-86-29-250.fixed.kpn.net)
20:12:32 <EvanR> spoonfeeding costs extra. 3rd party tutoring
20:13:08 <monochrom> Yeah I'm open to getting paid 10 times more for spoonfeeding.
20:13:13 <huskle> well i guess if your from an education background you might value the learning outcomes more than the other outcomes which might be important also
20:13:20 euandreh joins (~Thunderbi@179.214.113.107)
20:13:24 <huskle> monochrom: you get paid, lets just leave it at that
20:13:45 <monochrom> No I'm from a self-interest background I value getting paid for how much I do.
20:13:59 <huskle> thats like some krishna thing
20:14:00 <mauke> no, I actually do care about how much I'm paid
20:14:02 <huskle> im dead against that
20:14:07 <huskle> its a form of transactionalism
20:14:10 jakalx joins (~jakalx@base.jakalx.net)
20:14:18 <huskle> its a result of the synchroniser being in the hands of liberals
20:14:21 <monochrom> On IRC I don't get paid, I get to say "that's your job" much more often.
20:14:41 <huskle> thanks for that...
20:15:10 <monochrom> When a certain discussion interests me, I am happy to do more.
20:15:16 <EvanR> huskle, how about that haskell
20:15:18 <monochrom> But when not, why should I.
20:15:21 <huskle> anyway, in terms of being "forward looking" or "having a say in the future of social credit systems"...
20:15:50 <EvanR> lets see your advent of code solutions
20:15:57 <huskle> EvanR: well sure, i guess with something as important as a far forwards vantage point central in the development of computing logic on which most of reality is based...
20:16:16 <huskle> EvanR: i wrote the orignal turing machine, i think im does proving myself to the comunity.
20:16:23 × o-90 quits (~o-90@gateway/tor-sasl/o-90) (Ping timeout: 255 seconds)
20:16:39 <huskle> though in terms of getting my mind off of this friday night business..
20:16:43 <huskle> link?
20:16:47 <EvanR> after 2 straight days of nonsense on dwarf fortress steam discussions, this is annoying
20:17:07 <monochrom> Wait, I thought I supervised Turing on writing the original Turing machine...
20:17:07 <huskle> okok, chill
20:17:18 <huskle> youd have thought so, but he was gay, so...
20:17:37 <huskle> idk, ask tolkien
20:17:42 <mauke> is this just outright trolling now?
20:17:46 <huskle> he is my go to on all things category theory
20:17:51 <huskle> mauke: i see what you did there
20:18:02 <monochrom> OK sorry I was trolling! I'll stop.
20:18:15 <huskle> you werent trolling, he was!
20:19:00 <huskle> right, anyway, "supervising" at least this is comprehensably part of the discussion
20:19:17 <huskle> iits to do with this "hands off" approach and the difficulty of colaberation
20:19:27 <mauke> what discussion?
20:20:29 <huskle> basically, i dont want to have to pluck ideas from my students heads just to get answers to questions my supervisors cant help with because they have already seen the answers - and dont have access to an energy minimisation shceme that could derive the creative input itself
20:20:33 bontaq joins (~user@ool-45779fe5.dyn.optonline.net)
20:20:41 <monochrom> No, #haskell doesn't have a "no creative input" paradox. Instead, you millenials need to drop your entitlement attitude.
20:20:54 <huskle> not this again...
20:21:04 <mauke> heh
20:21:20 <huskle> and then the mod doesnt explain what they mean, and we have to buy out twitter to make a metacomentary on class nepotism and bullying
20:21:25 <monochrom> Damn right not this again. If you drop this topic, I will drop this topic.
20:22:22 <huskle> sorry, what? if i drop the issue of "the complexity of time in the supervisation process" you will stop claiming that "this is me being *entitled* to mechanistically derived creative input" ... yeah, that kind of makes sense i guess
20:22:44 <huskle> point is, i dont have students from which i can get answers!
20:23:05 <huskle> so we are all kind of stuck wondering why the next big GHC extension is taking so long
20:23:24 <geekosaur> ?
20:23:33 <huskle> ^this
20:23:35 <geekosaur> on second thought I don't think I want to know
20:23:40 <huskle> its "informationless"
20:24:06 <huskle> "no creative input"... its a "box" thing as far as i can tell
20:24:09 <monochrom> Wow I thought I was the only one in town who play the "informationless" card.
20:24:46 <huskle> probably common to those forwards nodes in the distributed knowledge generation framework
20:25:00 <mauke> 4 informationless corners in one card
20:25:30 <huskle> "yes, but then you would think .... "
20:25:30 <EvanR> 4 simultaneous corners sun up sun down midday midnight
20:26:38 <EvanR> time is not linear, it's cubic
20:26:47 <huskle> idk, i kind of assumed that after whatever great advances we were supposed to be presiding over that were so critical for time, that we would be let off the hook and their would be a grand scale societal reconfiguration to reflect the passing of the singularity or whatever
20:26:50 <monochrom> Change of subject: Do booleans exist in the untyped lambda calculus? >:)
20:26:52 × coot quits (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot)
20:27:08 <EvanR> since booleans are a type, no
20:27:16 <huskle> aka "we can still censor you"
20:27:27 <monochrom> Ah, right. I need to improve my question.
20:27:40 <geekosaur> you can encode them in a number of ways, so yes
20:27:42 <monochrom> Do the two boolean values exist in the untyped lambda calculus?
20:27:53 <EvanR> "the" two boolean values xD
20:28:08 <mauke> yes, true and bottom
20:28:08 <monochrom> Right, so the issue is "do encodings count?"
20:28:17 <huskle> fine speak among yourselves, iv said my bit
20:28:33 <geekosaur> and I question its semantic content
20:28:58 <mauke> monochrom: obviously, I'd first ask you to define "the two boolean values"
20:29:07 <EvanR> can I derail further by asking what existence means
20:29:08 <monochrom> :)
20:29:15 <monochrom> :) :)
20:29:45 <EvanR> I feel like I may have run out of IRC fuel but huskle
20:29:54 <huskle> i was building a house of cards with a bunch of my profs, and they were like "did you know you can smash it down really easily"
20:29:56 <EvanR> I guess YMMV
20:30:30 <huskle> and i was like "yes you showed me that before" and they were like "but we cant help you build it, and i quite lake smashing it down"
20:30:53 <huskle> and i was like "but my life is dwindled already"
20:30:54 <monochrom> Are you done?
20:31:27 <EvanR> also from a structural or process metaphysics point of view, it's easy to question the idea of "boolean values" in isolation
20:31:30 <mauke> more like megabit
20:31:43 <huskle> and they were like "smashy smashy, we can escalate this etc" and i was like "but can you not" and they were like "idk, iv never known anything except to abuse my power"
20:31:55 <EvanR> the encoding that lets you case analyze is more identifiable
20:32:02 <mauke> @where ops
20:32:03 <lambdabot> byorgey Cale conal copumpkin dcoutts dibblego dolio edwardk geekosaur glguy jmcarthur johnw mniip monochrom quicksilver shachaf shapr ski
20:32:05 ChanServ sets mode +o geekosaur
20:32:08 <mauke> ah
20:32:09 <huskle> threats
20:32:14 <huskle> violence
20:32:16 <huskle> bad mods
20:32:16 <EvanR> ok monochrom is still an op, ok
20:32:25 geekosaur sets mode +b *!*@250.79-105-213.static.virginmediabusiness.co.uk
20:32:25 huskle is kicked by geekosaur (huskle)
20:33:02 <shapr> thank you geekosaur
20:33:27 <geekosaur> been sitting on that for a bit, they're annoying at best
20:33:57 <geekosaur> it's timed, they get 15m
20:34:33 <geekosaur> but with that last I may just permaban, they seem to think it's their right to just take over someone else's channel
20:34:44 <dminuoso> mauke: No you couldnt
20:34:52 <dminuoso> mauke: Or rather, it would require cooperation on your part.
20:35:22 <monochrom> haha
20:36:51 <dminuoso> mauke: the thing is, any time you save in trie based decoding, you would probably pay for in constructing that trie at runtime.
20:37:32 <EvanR> you can't memoize it?
20:37:45 <dminuoso> Sure, but that goes deeper into cooperation territory
20:38:12 <EvanR> cooperation sounds good, maybe you wanna call it collusion xD
20:38:27 <dminuoso> By that I mean you have to consciously help with memoization
20:38:55 <EvanR> if parties are allowed to collude on performance, the performance goes through the roof
20:38:57 <dminuoso> So something like the naive `asum [Foo <$ string "foo", Foobar <$ string "foobar", Fooquux <$ string ]
20:39:04 <dminuoso> So something like the naive `asum [Foo <$ string "foo", Foobar <$ string "foobar", Fooquux <$ string "fooquux" ] wouldnt work
20:39:17 <dminuoso> And as it stands right now, this type of megaparsec code will punish you twice.
20:39:42 <dminuoso> First in terms of compilation (if that list approaches 64 in some combinations of code, you will experience expoentially raising compilation time right up until 10min or so)
20:39:48 <dminuoso> and then you will suffer from poor backtracking
20:39:57 <monochrom> :(
20:41:37 <EvanR> I'm still at the last bus stop where we are using megaparsec and worrying about performance
20:41:48 <EvanR> in absolute terms
20:42:03 <dminuoso> I just named megaparsec because I know the compilation time to degrade that poorly in that particular case
20:42:10 <dminuoso> attoparsec probably has similar problems
20:42:38 <dminuoso> its just a result of the library attaching INLINE to pretty much every declaration, and then having very deep binding trees.
20:42:55 <dminuoso> (so each time you use a variable, you will drag insane amounts of code that the simplifier has to deal with)
20:43:22 <dminuoso> flatparse has inline everywhere too, but the definitions are extremely shallow
20:43:44 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
20:44:30 × motherfsck quits (~motherfsc@user/motherfsck) (Quit: quit)
20:46:05 × merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 260 seconds)
20:46:37 <mauke> what was the paper or article that did parser combinators without explicit backtracking?
20:47:07 <mauke> I can't remember the author or title :-(
20:47:37 ChanServ sets mode +o litharge
20:47:37 litharge sets mode -bo *!*@250.79-105-213.static.virginmediabusiness.co.uk litharge
20:48:55 <mauke> I think it went along the lines of data Parser a = Succeed a | Consume (Char -> Parser a) | Fail String
20:49:27 <EvanR> should work
20:49:29 <mauke> or possibly a list of successes
20:49:34 <dminuoso> mauke: `scanner` looks like that.
20:50:03 <[exa]> mauke: how much are lists an explicit backtracking?
20:50:36 <mauke> and then Consume f <|> Consume g = Consume (\c -> f c <|> g c)
20:51:30 <dminuoso> Backtracking is an interesting topic, since I spend a lot of thoughts on how to deal with stateful parsing in flatparse.
20:51:50 <dminuoso> Right now we keep an Int# worth of state around, but thats not enough for parsing whitespace sensitive languages with reasonable inputs
20:51:52 <mauke> dminuoso: scanner doesn't seem to have a <|>
20:52:45 <dminuoso> In flatparse backtracking is very cheap since all other state we have is just a pointer offset in the bytestring buffer, its essentially cost-free
20:53:34 <dminuoso> One thought I had was that you can just use IORef for all state you want, but then you must decouple state mutation from backtracking regions (which is how things like Happy or Bison work anyway)
20:53:48 <dminuoso> because in happy the backtracking happens in the BNF syntax, not in the monadic actions
20:53:49 × eggplantade quits (~Eggplanta@2600:1700:38c5:d800:cc2a:ce80:f3c:358f) (Remote host closed the connection)
20:56:39 <dminuoso> do we have a haskell aoc channel on libera?
20:57:14 coot joins (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba)
20:58:14 festive_kurbus joins (~festive_k@user/kurbus)
20:58:51 <geekosaur> doesn't seem like it
20:59:01 × festive_kurbus quits (~festive_k@user/kurbus) (Client Quit)
21:00:27 <EvanR> haskell is cheating, we shouldn't encourage it
21:03:34 <EvanR> though sometimes I think anti-haskell details are included in the puzzle, like today involves the subject of a head and a tail, which are almost language keywords, messing up your variable names
21:04:12 <dminuoso> Im just randomly poking at day 5 now.
21:04:13 <dminuoso> Think I need repa.
21:04:20 <EvanR> lol
21:05:12 <mauke> I went with STArray
21:09:09 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
21:11:37 <glguy> dminuoso: people talk about aoc here, and then there's also the generic #adventofcode and #adventofcode-spoilers that happens to have a number of haskell solvers
21:13:32 × califax quits (~califax@user/califx) (Ping timeout: 255 seconds)
21:14:55 × Chai-T-Rex quits (~ChaiTRex@user/chaitrex) (Quit: Chai-T-Rex)
21:15:29 × caef^ quits (~caef@76.145.185.103) (Ping timeout: 260 seconds)
21:16:42 eggplantade joins (~Eggplanta@2600:1700:38c5:d800:cc2a:ce80:f3c:358f)
21:17:16 jcowan joins (sid325434@2a03:5180:f:3::4:f73a)
21:17:21 ChaiTRex joins (~ChaiTRex@user/chaitrex)
21:17:43 pavonia joins (~user@user/siracusa)
21:18:07 <jcowan> To what types (other than functions) would Eq be inapplicable?
21:18:54 califax joins (~califax@user/califx)
21:19:04 <EvanR> real numbers
21:20:29 <dminuoso> Float or Double if we were being honest.
21:21:15 zant2 joins (~zant@62.214.20.26)
21:21:19 <dminuoso> Because Reflexivity doesnt hold (since NaN /= NaN)
21:21:35 <dminuoso> IO actions
21:22:56 × phma quits (phma@2001:5b0:211b:de08:e3b4:8590:6dc5:da01) (Read error: Connection reset by peer)
21:23:02 <dminuoso> jcowan: Though the Float/Double case might be a good example that it depends on the interpretation of the data.
21:23:21 <dsal> Void has an Eq instance…
21:23:27 phma joins (~phma@host-67-44-208-53.hnremote.net)
21:23:57 <dminuoso> dsal: Seems fine.
21:24:10 <dolio> That ones' easy.
21:24:48 <dsal> Oh weird. It's derived. I'd expect it to be `const True` or something.
21:25:04 <dminuoso> It's bottom.
21:25:10 <dminuoso> dsal: Consider that Void is inhabited by just bottom, which itself inhabits every other type, including say `Bool`
21:25:42 <dminuoso> Ah but you're right
21:25:44 <dsal> Yeah, it's the "you can't get there" part. But the implementation presumably would return True.
21:25:45 <dminuoso> its const True
21:25:50 <EvanR> anyway, another one is TuringMachine
21:25:50 <dminuoso> % import Data.Void
21:25:50 <yahb2> <no output>
21:25:59 <dminuoso> % (undefined :: Void) == undefined
21:25:59 <yahb2> True
21:26:27 × thegeekinside quits (~thegeekin@189.217.82.244) (Remote host closed the connection)
21:26:54 <dminuoso> I guess that follows from reflexitity and the fact that Void is inhabited by only one value
21:28:43 <EvanR> (==) :: Void -> Void -> Bool; x == y impossible
21:29:15 <EvanR> in another language maybe xD
21:29:22 <dminuoso> Which begs an interesting question
21:29:27 <dminuoso> % () == undefined
21:29:27 <yahb2> *** Exception: Prelude.undefined ; CallStack (from HasCallStack): ; error, called at libraries/base/GHC/Err.hs:74:14 in base:GHC.Err ; undefined, called at <interactive>:66:7 in interactive:Ghci13
21:29:39 <dminuoso> Mmm. Shouldnt this return True?
21:29:56 <dminuoso> Or uh. I guess this is right after all
21:29:59 <EvanR> handling bottoms can be tricky
21:32:55 <dsal> Oh, so Void is inhabited by one value, but you can't get to it, so it's *effectively* no values.
21:33:23 <dminuoso> No it has one value.
21:33:31 <mniip> what's a value anyway
21:33:32 <dminuoso> So any comparison could ever be with itself
21:33:46 <dminuoso> And by law of refl that must compare to True
21:34:09 <EvanR> > [minBound .. maxBound] :: [Void]
21:34:10 <lambdabot> error:
21:34:10 <lambdabot> • No instance for (Enum Void)
21:34:11 <lambdabot> arising from the arithmetic sequence ‘minBound .. maxBound’
21:34:13 <dminuoso> It's cunning, really
21:34:53 <dminuoso> EvanR: Heh! `fromEnum undefined = 0`?
21:34:55 <EvanR> back to the bool in untyped lambda calculus, it depends on what you're going to do with it
21:35:03 <dminuoso> Or whats the expected behavior :D
21:35:13 <dminuoso> Other than that, I think its fine
21:35:13 <EvanR> if you never used bottom, Void is what it says on the tin
21:35:18 <dminuoso> succ undefined = undefined; pred undefined = undefined
21:35:27 <dminuoso> Can even to `toEnum _ = undefined`
21:35:31 <jcowan> there should perhaps be a compiler option to treat NaN as bottom, which would be much better alignment with theory
21:35:55 <EvanR> whiney NaN
21:35:55 <dminuoso> jcowan: Float/Double are IEEE 754 primitives.
21:36:03 <dminuoso> jcowan: As such the equality respects IEE 754
21:36:09 <jcowan> I understand
21:36:17 <dminuoso> Treating NaN as bottom would be horrid.
21:36:31 <dminuoso> What *would* be useful would an option to have IEEE 754 traps
21:36:33 <EvanR> if you ever compute a NaN ghc deletes your code
21:36:47 <dminuoso> jcowan: So that would kind of fall into that idea
21:37:56 <jcowan> In typical fp code, (quiet) NaN is sticky: whatever you do to NaN it remains NaN. This is very much how bottom works (or "works")
21:38:21 <dminuoso> NaN can be compared to NaN
21:38:23 <darkling> Ah, no, you don't want NaNs, you want Nullity!
21:38:28 × codaraxis___ quits (~codaraxis@user/codaraxis) (Ping timeout: 260 seconds)
21:38:30 <dminuoso> That is one mighty difference
21:38:36 <dminuoso> Ah but hold on
21:38:45 <dminuoso> As we have established `undefined :: Void == undefined` earlier
21:38:45 <dsal> Void has one value because we can't have zero values, but it's "A logically uninhabited data type, used to indicate that a given term should not exist."
21:38:47 <dminuoso> Hah!
21:39:00 <dminuoso> (But that only works because of Void, so ignore that)
21:39:11 <dsal> The smart constructor for Void is absurd.
21:39:30 <c_wraith> no, that's the destructor
21:39:40 <jcowan> Nan == NaN is false because in an eager world it has to be something, but it should really return NaB (not a boolean)
21:39:43 <EvanR> if you want to stop anyone from observing a difference, make bottom or NaN freeze the computer. If you're have discpline you can get the same effect by just not observing a difference, and it's more flexible
21:40:01 <dsal> c_wraith: Oh yeah, I see.
21:40:08 <dminuoso> jcowan: No, it is false because whether two unknown values are the same.
21:40:09 <mniip> data Double = D1 | D1_0000000000000002 | D1_0000000000000004 | ...
21:40:14 <dminuoso> jcowan: its similar to how SQL NULL /= NULL
21:40:24 <dminuoso> (or rather, neither holds)
21:40:31 <dminuoso> they are neither equal nor not-equal
21:40:55 <dminuoso> AH I missed a portion. It is unknown whether two unknown values are the same or not.
21:41:33 <jcowan> Exactly, hence in SQL, NULL = NULL is NULL
21:42:04 merijn joins (~merijn@86-86-29-250.fixed.kpn.net)
21:42:08 <jcowan> so NaN == NaN should return a null that is typed boolean.
21:42:37 <EvanR> Bool = True | False | Null | FileNotFound
21:42:45 jcowan giggles
21:43:07 <darkling> Equal there is or not equal. There is no lattice.
21:43:45 jcowan lols outright, possibly scaring the pigeons
21:44:09 <jcowan> Except in Ireland, where the rule is "Lattice alone".
21:44:18 <dminuoso> Mmm
21:44:31 <dminuoso> % (0/0) /= (0/0)
21:44:31 <yahb2> True
21:44:35 <dminuoso> That seems wrong, no?
21:44:46 <dminuoso> Shoudlnt IEEE 754 demand this operation return False?
21:45:14 <jcowan> The /= operation isn't primitive; it is the negation of ==.
21:45:43 <EvanR> haskell is lazy, it will wait for the actual demand for that operation to yield the right answer
21:46:24 <dminuoso> jcowan: that seems irrelevant
21:46:29 <jcowan> You can model floats as intervals (although float arithmetic is not interval arithmetic). In that model, NaN is the union of the empty interval and the universal interval.
21:46:40 <dminuoso> Its a method of Eq
21:46:42 <dminuoso> As such you can override it.
21:46:45 × merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 260 seconds)
21:46:52 <dminuoso> And its not less primitive than (==) too
21:46:55 <jcowan> I was talking about IEEE
21:46:58 <dminuoso> {-# MINIMAL (==) | (/=) #-}
21:47:15 <dsal> https://hackage.haskell.org/package/base-4.17.0.0/docs/Data-Eq.html#t:Eq
21:47:33 <EvanR> jcowan, that doesn't explain why NaN /= NaN
21:47:34 <dsal> You can have things that are neither equal nor not equal.
21:47:59 <EvanR> er, doesn't ==
21:48:25 <dminuoso> Let me dig into the stndard
21:49:21 <dminuoso> `Four mutually exclusive relations are possible: less than, equal, greater than, and unordered. The last case arises when at least one operand is NaN. Every NaN shall compare unordered with everything, including itself`
21:49:57 <dminuoso> I suppose that seems faithful then, since `NaN /= NaN` does neither indicate less than, equal or greater than
21:49:58 <jcowan> EvanR: In IEEE, /= is defined as "not ==", whereas the definition of = is by fiat
21:50:32 <dminuoso> ` In contrast, the logical negation of (X = Y) might be written as either NOT(X = Y) or (X ?<> Y); in this case both expressions are functionally equivalent to (X ≠ Y).`
21:50:35 <EvanR> I'm saying if NaN is supposed to be a universal interval, it would equal itself
21:50:42 <dsal> > sort [nan, nan]
21:50:43 <lambdabot> [NaN,NaN]
21:50:58 <dsal> > sort [3, nan, 2, nan, 1]
21:50:59 <lambdabot> [1.0,NaN,2.0,NaN,3.0]
21:51:04 <dsal> neat
21:51:08 <dminuoso> EvanR: There's a very good answer from someone who was on the 754 committee on SO that goes a bit into the details why https://stackoverflow.com/a/1573715/6636995
21:52:19 <dminuoso> mauke: I guess you have two STUArrays right? One with the 2-dimensional array, and one with offsets for each stack?
21:52:35 <EvanR> > 1/0 == 1/0
21:52:35 <dminuoso> though mmm
21:52:36 <lambdabot> True
21:53:06 <EvanR> dminuoso, reading the last bit sounds like == and NaN is basically historical accident
21:53:22 <dminuoso> Not necessarily accident
21:54:13 <EvanR> a sort of calculated corner cutting
21:54:23 <dminuoso> EvanR: Did you read his Kahan quotes?
21:54:30 <dminuoso> (or paraphrasing)
21:55:21 <EvanR> "missing isnan()"
21:55:34 <EvanR> I mean come on
21:55:53 <dminuoso> That was nearly 40 years ago.
21:56:12 <EvanR> 40 years ago keeps getting more modern
21:56:13 <dminuoso> THere's also the hardware implementation argument
21:56:32 <EvanR> 40 years ago was super mario bros on NES xD
21:56:44 × jpds2 quits (~jpds@gateway/tor-sasl/jpds) (Ping timeout: 255 seconds)
21:56:44 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Ping timeout: 255 seconds)
21:58:39 <money> Yeahhhh
21:58:42 <money> What no was
21:58:44 <money> Way
22:00:18 <jcowan> IEEE 754 eliminated the chaos and confusion of earlier FPPs, and that is worth any number of cut corners to a numerical programmer, by all reports (I'm not one)
22:00:20 FinnElija joins (~finn_elij@user/finn-elija/x-0085643)
22:01:16 <jcowan> Anyway, I'm glad to know about the pragmatic argument, even if it is long obsolete
22:02:44 jpds2 joins (~jpds@gateway/tor-sasl/jpds)
22:02:58 tomokojun joins (~tomokojun@37.19.221.173)
22:08:26 × jpds2 quits (~jpds@gateway/tor-sasl/jpds) (Ping timeout: 255 seconds)
22:08:42 × takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection)
22:08:59 × darkstardevx quits (~darkstard@50.53.3.186) (Remote host closed the connection)
22:09:00 RedSwan joins (~jared@174-23-134-43.slkc.qwest.net)
22:09:21 <RedSwan> Hello World!
22:09:33 darkstardevx joins (~darkstard@50.53.3.186)
22:09:45 <geekosaur> hm
22:09:49 geekosaur sets mode -o geekosaur
22:21:55 × michalz quits (~michalz@185.246.204.72) (Remote host closed the connection)
22:23:05 × RedSwan quits (~jared@174-23-134-43.slkc.qwest.net) (Remote host closed the connection)
22:24:33 jpds2 joins (~jpds@gateway/tor-sasl/jpds)
22:25:14 <mauke> dminuoso: no, just a single mutable array of lists
22:26:42 RedSwan joins (~jared@174-23-134-43.slkc.qwest.net)
22:29:44 ddellacosta joins (~ddellacos@143.244.47.100)
22:31:51 jcowan parts (sid325434@2a03:5180:f:3::4:f73a) ()
22:37:58 wroathe joins (~wroathe@207-153-38-140.fttp.usinternet.com)
22:37:58 × wroathe quits (~wroathe@207-153-38-140.fttp.usinternet.com) (Changing host)
22:37:58 wroathe joins (~wroathe@user/wroathe)
22:39:17 bilegeek joins (~bilegeek@2600:1008:b081:6315:4a6c:8d52:e369:5a2e)
22:42:36 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection)
22:43:17 FinnElija joins (~finn_elij@user/finn-elija/x-0085643)
22:43:53 merijn joins (~merijn@86.86.29.250)
22:45:29 jmdaemon joins (~jmdaemon@user/jmdaemon)
22:47:31 <EvanR> mauke, did you have like 9 lists. Seems like an immutable update(s) would be enough?
22:48:12 <EvanR> based on nothing admittedly
22:53:22 × mncheck quits (~mncheck@193.224.205.254) (Ping timeout: 256 seconds)
22:55:21 × eggplantade quits (~Eggplanta@2600:1700:38c5:d800:cc2a:ce80:f3c:358f) (Remote host closed the connection)
22:57:17 eggplantade joins (~Eggplanta@2600:1700:38c5:d800:cc2a:ce80:f3c:358f)
22:57:56 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 265 seconds)
22:58:45 <mauke> EvanR: I wrote my first version in perl, so I reused the basic approach
22:58:50 codaraxis joins (~codaraxis@user/codaraxis)
22:58:59 <mauke> also, I'd never used STArray before, so I wanted to play around with it
22:59:04 <EvanR> ah yeah
22:59:15 <EvanR> translating an existing algorithm
22:59:26 <EvanR> yes haskell can do that!
23:00:10 × acidjnk quits (~acidjnk@p54ad5adb.dip0.t-ipconnect.de) (Ping timeout: 256 seconds)
23:00:17 × phma quits (~phma@host-67-44-208-53.hnremote.net) (Read error: Connection reset by peer)
23:00:40 phma joins (phma@2001:5b0:212a:a8b8:8561:6792:7340:d9af)
23:03:58 × use-value quits (~Thunderbi@2a00:23c6:8a03:2f01:75c2:a71f:beaa:29bf) (Remote host closed the connection)
23:04:16 use-value joins (~Thunderbi@2a00:23c6:8a03:2f01:75c2:a71f:beaa:29bf)
23:07:21 × troydm quits (~troydm@host-176-37-124-197.b025.la.net.ua) (Ping timeout: 256 seconds)
23:15:57 tremon joins (~tremon@83-84-18-241.cable.dynamic.v4.ziggo.nl)
23:16:36 ubert1 joins (~Thunderbi@p200300ecdf264edcfc4b3345093f7868.dip0.t-ipconnect.de)
23:16:38 Vajb joins (~Vajb@hag-jnsbng11-58c3a5-27.dhcp.inet.fi)
23:17:03 × merijn quits (~merijn@86.86.29.250) (Ping timeout: 260 seconds)
23:18:34 × Vajb quits (~Vajb@hag-jnsbng11-58c3a5-27.dhcp.inet.fi) (Read error: Connection reset by peer)
23:18:50 × ubert1 quits (~Thunderbi@p200300ecdf264edcfc4b3345093f7868.dip0.t-ipconnect.de) (Client Quit)
23:28:25 × wootehfoot quits (~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer)
23:38:40 × eggplantade quits (~Eggplanta@2600:1700:38c5:d800:cc2a:ce80:f3c:358f) (Remote host closed the connection)
23:43:41 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
23:45:53 × coot quits (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot)
23:57:51 Inoperable joins (~PLAYER_1@fancydata.science)
23:59:06 money_ joins (~money@user/polo)

All times are in UTC on 2022-12-09.