2025/11/11

2025-11-11 00:00:58 +0100emmanuelux(~emmanuelu@user/emmanuelux) emmanuelux
2025-11-11 00:01:04 +0100tromp(~textual@2001:1c00:3487:1b00:5862:9c78:2f27:3ade) (Quit: My iMac has gone to sleep. ZZZzzz…)
2025-11-11 00:01:25 +0100CiaoSen(~Jura@2a02:8071:64e1:da0:5a47:caff:fe78:33db) (Ping timeout: 240 seconds)
2025-11-11 00:06:27 +0100bggd(~bgg@2a01:e0a:819:1510:285c:2d19:95b6:2c5) (Quit: std::move)
2025-11-11 00:16:01 +0100anselmschueler(~Thunderbi@user/schuelermine) schuelermine
2025-11-11 00:18:37 +0100mreh(~matthew@host86-146-25-125.range86-146.btcentralplus.com) (Ping timeout: 244 seconds)
2025-11-11 00:23:38 +0100shr\ke(~shrike@user/shrke:31298) (Remote host closed the connection)
2025-11-11 00:29:31 +0100peterbecich(~Thunderbi@172.222.148.214) peterbecich
2025-11-11 00:31:14 +0100gmg(~user@user/gehmehgeh) (Remote host closed the connection)
2025-11-11 00:31:14 +0100ec(~ec@gateway/tor-sasl/ec) (Remote host closed the connection)
2025-11-11 00:31:46 +0100Ranhir(~Ranhir@157.97.53.139) (Quit: KVIrc 5.2.6 Quasar http://www.kvirc.net/)
2025-11-11 00:31:47 +0100ec(~ec@gateway/tor-sasl/ec) ec
2025-11-11 00:31:55 +0100gmg(~user@user/gehmehgeh) gehmehgeh
2025-11-11 00:32:28 +0100Ranhir(~Ranhir@157.97.53.139) Ranhir
2025-11-11 00:32:33 +0100Anarchos(~Anarchos@91-161-254-16.subs.proxad.net) Anarchos
2025-11-11 00:42:53 +0100lisbeths(uid135845@id-135845.lymington.irccloud.com) (Quit: Connection closed for inactivity)
2025-11-11 00:50:11 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn
2025-11-11 00:55:13 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 256 seconds)
2025-11-11 00:55:25 +0100haltingsolver(~cmo@2604:3d09:207f:8000::d1dc)
2025-11-11 00:57:53 +0100Square3(~Square@user/square) Square
2025-11-11 00:58:19 +0100malte(~malte@mal.tc) (Remote host closed the connection)
2025-11-11 01:02:36 +0100Anarchos(~Anarchos@91-161-254-16.subs.proxad.net) (Quit: Vision[]: i've been blurred!)
2025-11-11 01:03:36 +0100malte(~malte@mal.tc) malte
2025-11-11 01:05:35 +0100anselmschueler(~Thunderbi@user/schuelermine) (Remote host closed the connection)
2025-11-11 01:05:40 +0100Googulator30(~Googulato@2a01-036d-0106-0180-8127-ba79-55a7-6f29.pool6.digikabel.hu)
2025-11-11 01:05:44 +0100Googulator21(~Googulato@2a01-036d-0106-0180-8127-ba79-55a7-6f29.pool6.digikabel.hu) (Quit: Client closed)
2025-11-11 01:07:13 +0100hiredman(~hiredman@frontier1.downey.family) (Ping timeout: 264 seconds)
2025-11-11 01:08:31 +0100hiredman(~hiredman@frontier1.downey.family) hiredman
2025-11-11 01:08:49 +0100Sidney(~Sidney@2600:4040:2678:9600:b1c4:ced3:242d:1252)
2025-11-11 01:10:07 +0100 <Sidney> Hi, I am trying to learn how to think in the Haskell way (I don't know the precise term), but I am having difficultly solving leetcode problem which require stateful operations such as problems which requires the two pointers technique. Is there pattern/mindset to solve inherently stateful problems elegantly and with good time complexity? I tried
2025-11-11 01:10:07 +0100 <Sidney> recursion but I does not feel like the right tool. Thanks!
2025-11-11 01:10:50 +0100Googulator9(~Googulato@2a01-036d-0106-0180-8127-ba79-55a7-6f29.pool6.digikabel.hu)
2025-11-11 01:11:16 +0100Googulator30(~Googulato@2a01-036d-0106-0180-8127-ba79-55a7-6f29.pool6.digikabel.hu) (Quit: Client closed)
2025-11-11 01:15:27 +0100 <L29Ah> Sidney: there's ST if you find you want to have a state for efficiency in your black-boxable algorithm
2025-11-11 01:18:18 +0100sprout(~sprout@84-80-106-227.fixed.kpn.net) sprout
2025-11-11 01:29:25 +0100peterbecich(~Thunderbi@172.222.148.214) (Ping timeout: 240 seconds)
2025-11-11 01:31:07 +0100comonad(~comonad@2003:d0:2741:a000:c693:4c09:e8b4:6dfd)
2025-11-11 01:35:07 +0100 <mange> While Haskell has ST and the like, if you're trying to think "in the Haskell way" then you probably don't want to be using ST.
2025-11-11 01:37:18 +0100ttybitnik(~ttybitnik@user/wolper) (Quit: Fading out...)
2025-11-11 01:40:42 +0100Googulator9(~Googulato@2a01-036d-0106-0180-8127-ba79-55a7-6f29.pool6.digikabel.hu) (Quit: Client closed)
2025-11-11 01:40:47 +0100Googulator65(~Googulato@2a01-036d-0106-0180-8127-ba79-55a7-6f29.pool6.digikabel.hu)
2025-11-11 01:41:31 +0100 <EvanR> Sidney, if the algorithm specifically calls for something like an array of A and numerical indexes, you can pretty easily translate that to a Map Int A and some Ints
2025-11-11 01:41:57 +0100 <EvanR> (or IntMap A)
2025-11-11 01:43:04 +0100 <EvanR> for the stateful part, there are several ways to "keep the current state", whatever it is. E.g. pass the latest values to a recursive function which stands for the loop body
2025-11-11 01:44:43 +0100 <EvanR> another way is to use a State monad, there are other ways
2025-11-11 01:44:48 +0100gf3(~gf3@user/gf3) (Ping timeout: 256 seconds)
2025-11-11 01:47:40 +0100Tuplanolla(~Tuplanoll@91-159-187-167.elisa-laajakaista.fi) (Quit: Leaving.)
2025-11-11 01:48:14 +0100gf3(~gf3@user/gf3) gf3
2025-11-11 01:49:18 +0100 <jreicher> Sidney: what do you need stateful operations for? (Really this is just a polite way for met to ask, are you really really sure you need stateful operations? You might be wrong, and if you're wrong, it's easier to do things without them.)
2025-11-11 01:52:27 +0100 <mange> In general I would say "the Haskell way" is to avoid state, and to think about functional transformations/reductions instead. Even if it's possible to write programs with state in Haskell, you're usually going against the grain of the language.
2025-11-11 01:59:57 +0100 <Sidney> I agree, I don't want to use stateful operations. I'm missing something because I don't see an alternate. For example `move zeros` (https://leetcode.com/problems/move-zeroes/description/) requires constant space complexity and I don't how `two sum` (https://leetcode.com/problems/two-sum/description/) could be solved with less than O(N^2) time
2025-11-11 01:59:58 +0100 <Sidney> complexity without a for loop and a hash table.
2025-11-11 02:00:18 +0100jle`(~jle`@2603:8001:3b00:11:5098:4041:9bc7:9b0d) (Ping timeout: 244 seconds)
2025-11-11 02:00:31 +0100Googulator65(~Googulato@2a01-036d-0106-0180-8127-ba79-55a7-6f29.pool6.digikabel.hu) (Quit: Client closed)
2025-11-11 02:00:39 +0100Googulator65(~Googulato@2a01-036d-0106-0180-8127-ba79-55a7-6f29.pool6.digikabel.hu)
2025-11-11 02:00:47 +0100spew(~spew@user/spew) spew
2025-11-11 02:01:30 +0100jle`(~jle`@2603:8001:3b00:11:c2d0:7f27:fab9:22ae) jle`
2025-11-11 02:04:29 +0100xff0x(~xff0x@2405:6580:b080:900:2473:b259:8788:143a) (Ping timeout: 260 seconds)
2025-11-11 02:05:43 +0100Googulator65(~Googulato@2a01-036d-0106-0180-8127-ba79-55a7-6f29.pool6.digikabel.hu) (Quit: Client closed)
2025-11-11 02:05:50 +0100Googulator91(~Googulato@2a01-036d-0106-0180-8127-ba79-55a7-6f29.pool6.digikabel.hu)
2025-11-11 02:05:53 +0100Sidney(~Sidney@2600:4040:2678:9600:b1c4:ced3:242d:1252) (Ping timeout: 250 seconds)
2025-11-11 02:07:16 +0100Sidney(~Sidney@2600:4040:2678:9600:b1c4:ced3:242d:1252)
2025-11-11 02:10:50 +0100Googulator91(~Googulato@2a01-036d-0106-0180-8127-ba79-55a7-6f29.pool6.digikabel.hu) (Quit: Client closed)
2025-11-11 02:10:59 +0100Googulator91(~Googulato@2a01-036d-0106-0180-8127-ba79-55a7-6f29.pool6.digikabel.hu)
2025-11-11 02:15:37 +0100tabaqui(~tabaqui@167.71.80.236) (Ping timeout: 264 seconds)
2025-11-11 02:15:42 +0100Googulator83(~Googulato@2a01-036d-0106-0180-8127-ba79-55a7-6f29.pool6.digikabel.hu)
2025-11-11 02:16:09 +0100Googulator91(~Googulato@2a01-036d-0106-0180-8127-ba79-55a7-6f29.pool6.digikabel.hu) (Quit: Client closed)
2025-11-11 02:18:55 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn
2025-11-11 02:19:28 +0100 <mange> Sidney: You can use recursion, building up a hash table as you go. The two sum problem, for instance, could be like this: http://paste.debian.net/1405577/ (I'm using Map because it was easier, but you can see the idea).
2025-11-11 02:20:26 +0100 <mange> The move zeros one you linked to is explicitly about mutating an array, so obviously you can't do that without mutation.
2025-11-11 02:22:45 +0100DetourNetworkUK(DetourNetw@user/DetourNetworkUK) (Read error: Connection reset by peer)
2025-11-11 02:22:47 +0100DetourNe-(DetourNetw@user/DetourNetworkUK) DetourNetworkUK
2025-11-11 02:23:26 +0100Starving_Drummer(~berke@user/Starving-Drummer:76786) (Remote host closed the connection)
2025-11-11 02:23:58 +0100 <mange> Oh, wait, sorry, I misread your message. You don't want to use a hash table. That makes sense.
2025-11-11 02:24:49 +0100Googulator83(~Googulato@2a01-036d-0106-0180-8127-ba79-55a7-6f29.pool6.digikabel.hu) (Quit: Client closed)
2025-11-11 02:25:04 +0100Googulator83(~Googulato@2a01-036d-0106-0180-8127-ba79-55a7-6f29.pool6.digikabel.hu)
2025-11-11 02:25:04 +0100DetourNe-DetourNetworkUK
2025-11-11 02:25:32 +0100Googulator83(~Googulato@2a01-036d-0106-0180-8127-ba79-55a7-6f29.pool6.digikabel.hu) (Client Quit)
2025-11-11 02:25:43 +0100Googulator83(~Googulato@2a01-036d-0106-0180-8127-ba79-55a7-6f29.pool6.digikabel.hu)
2025-11-11 02:25:53 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 256 seconds)
2025-11-11 02:28:17 +0100 <int-e> sorting can help with two-sum
2025-11-11 02:30:36 +0100 <int-e> > let (xs,ys) = partition (/= 0) [0,1,0,3,12] in xs ++ ys -- yes it's not in-place, but whatever
2025-11-11 02:30:37 +0100 <lambdabot> [1,3,12,0,0]
2025-11-11 02:31:23 +0100spew(~spew@user/spew) (Quit: WeeChat 4.6.3)
2025-11-11 02:37:42 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn
2025-11-11 02:40:27 +0100 <jreicher> two-sum doesn't have to be in-place I think. So you can ignore the "array" part and just think in terms of lists.
2025-11-11 02:40:43 +0100 <monochrom> partition is probably still constant-space and linear-time.
2025-11-11 02:40:58 +0100 <mange> Sidney: still not in-place (because it would require changing the input), but this should solve the two-sum problem by iterating through the list in both directions: http://paste.debian.net/1405581/
2025-11-11 02:41:07 +0100 <mange> ... After sorting it, that is.
2025-11-11 02:41:31 +0100 <int-e> jreicher: yes, but the code snippet was for move-zeroes
2025-11-11 02:41:55 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds)
2025-11-11 02:41:57 +0100gorignak(~gorignak@user/gorignak) (Quit: quit)
2025-11-11 02:42:04 +0100 <Sidney> Okay, thank you for the help.
2025-11-11 02:42:05 +0100 <Sidney> Regarding two-pointer questions: is it possible to use recursion to get a single pass with the left and right pointers as function parameters?
2025-11-11 02:42:05 +0100 <Sidney> I tried to solve the "Best Time to Buy and Sell Stock" problem (https://leetcode.com/problems/best-time-to-buy-and-sell-stock/description/) using a fold to calculate the profit each day, but that resulted in O(n²) complexity because I needed to calculate the maximum value for the remainder of the collection. Lastly I have heard some people say
2025-11-11 02:42:06 +0100 <Sidney> that some things are 'inherently stateful' so functional programming is not capable of solving the problem elegantly. Is that true? It seems arbitrary that a `for loop` is the only tool that can solve these problems compared behaviors in mathematics such as recursion but I am ignorant and would like to know what you have to say.
2025-11-11 02:42:13 +0100gorignak(~gorignak@user/gorignak) gorignak
2025-11-11 02:42:25 +0100 <monochrom> "in-place" is an over-specification. Externally you can only observe space growth or lack-of, not how it is achieved.
2025-11-11 02:42:27 +0100 <EvanR> whether you are using explicit recursion or a folding combinator or whatever it's still stateful in spirit
2025-11-11 02:42:51 +0100 <int-e> mange: well those indices are wrong, because sorting changes the order of things
2025-11-11 02:42:52 +0100 <EvanR> actually "state" is heavily overloaded and can mean many things
2025-11-11 02:43:11 +0100 <int-e> mange: reconstructing indices makes this a tad annoying
2025-11-11 02:43:13 +0100 <jreicher> Sidney: coincidentally I recently watched this. https://youtu.be/QNM-njddhIw?t=970&si=tWEcEVmsr44nKlVs
2025-11-11 02:43:19 +0100 <EvanR> Sidney, yeah, that's incorrect
2025-11-11 02:43:27 +0100 <mange> Oh yeah, obviously! Thanks int-e. I'm not going to fix it, because I can't be bothered right now.
2025-11-11 02:43:29 +0100 <jreicher> The middle of that section of the video covers something very similar to move-zeroes
2025-11-11 02:43:45 +0100 <int-e> mange: That's okay :P
2025-11-11 02:44:33 +0100 <int-e> mange: FWIW, I'd probably just search for the found elements in the original list.
2025-11-11 02:44:56 +0100 <int-e> :t findIndex
2025-11-11 02:44:57 +0100 <lambdabot> (a -> Bool) -> [a] -> Maybe Int
2025-11-11 02:45:10 +0100 <int-e> :t elemIndex
2025-11-11 02:45:12 +0100 <lambdabot> Eq a => a -> [a] -> Maybe Int
2025-11-11 02:45:40 +0100 <EvanR> there's much less difference between mutating an array and updating a Map than you think there is. There much less difference between a recursive program and a for loop than you think there is
2025-11-11 02:45:51 +0100 <jreicher> Sidney: In my opinion (and not everyone will agree with this I think) even if you write "statelessly", the computation is still stateful. That's never in doubt. A computer executes in the real world by changing state moment to moment. So the question is not whether you have state, but whether you have to write it explicitly or whether the language (Haskell) can figure it out for you. A lot of the time it can.
2025-11-11 02:47:17 +0100gorignak(~gorignak@user/gorignak) (Quit: quit)
2025-11-11 02:47:33 +0100gorignak(~gorignak@user/gorignak) gorignak
2025-11-11 02:47:38 +0100 <EvanR> folding over a list of things using "a state" accomplishes the same thing as looping over the things and mutating variables
2025-11-11 02:47:52 +0100 <monochrom> I feel like "there is no royal road" applies. How to think in French? By immersing in French for weeks, months, years. How to think in Japanese? By immersing in Japanese for weeks, months, years. How to think in Haskell? By immersing... you get my point.
2025-11-11 02:47:56 +0100 <EvanR> sometimes it's more convenient sometimes it's not
2025-11-11 02:48:30 +0100 <EvanR> yes keep writing programs (and reading programs)
2025-11-11 02:48:57 +0100 <monochrom> But I do tell my students: Think of Haskell functions as math functions, not C "functions". Think algebra.
2025-11-11 02:50:05 +0100 <EvanR> ^ this very good advice has no effect on people who hate math
2025-11-11 02:50:38 +0100 <monochrom> Oh if you hate math, there is nothing in Haskell for you.
2025-11-11 02:50:45 +0100 <EvanR> though maybe subjecting them to enough haskell gives them a better appreciation for mathematical thinking
2025-11-11 02:51:12 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn
2025-11-11 02:51:56 +0100int-ewonders when he last used the term "procedure" for an imperative "function".
2025-11-11 02:51:56 +0100synchromesh(~john@2406:5a00:2412:2c00:c5a6:321c:259:76f2) (Read error: Connection reset by peer)
2025-11-11 02:52:17 +0100 <monochrom> We should do that more!
2025-11-11 02:52:27 +0100 <int-e> (A Pascal remnant, though Pascal's distinction based on whether a function returns a value or not is odd too.)
2025-11-11 02:52:37 +0100gorignak(~gorignak@user/gorignak) (Quit: quit)
2025-11-11 02:52:51 +0100 <monochrom> If foo :: IO Int, what do you call foo, i.e., what is the name of the kind of things like foo? Answer: procedure.
2025-11-11 02:52:52 +0100synchromesh(~john@2406:5a00:2412:2c00:ed84:4ebe:de81:99a2) synchromesh
2025-11-11 02:52:54 +0100gorignak(~gorignak@user/gorignak) gorignak
2025-11-11 02:53:07 +0100 <int-e> And sorry, I believe "function" is too ingrained in my brain by now.
2025-11-11 02:53:18 +0100 <int-e> It's an overloaded concept, one of many.
2025-11-11 02:54:00 +0100 <monochrom> The Algol people got it wrong in the first place. They said "side-effecting functions" [sic], just because there is a "return value".
2025-11-11 02:54:56 +0100 <EvanR> returning a value was undervalued all the way even until ruby
2025-11-11 02:55:07 +0100 <monochrom> If the null pointer was a billion-dollar mistake, I invoke Sapir-Worf and call that a priceless mistake.
2025-11-11 02:55:09 +0100 <EvanR> so many forms in ruby return nothing useful and so can't be combined
2025-11-11 02:55:34 +0100 <int-e> EvanR: can't wait for the paper on the trillion-dollar mistake in about 50 years
2025-11-11 02:55:53 +0100 <EvanR> the 1 TRILLION dollar mistake *crowd laughs*
2025-11-11 02:56:30 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 256 seconds)
2025-11-11 02:56:41 +0100 <int-e> (adjusted for inflation relative to 2025)
2025-11-11 02:56:59 +0100 <int-e> (and possibly new currencies)
2025-11-11 02:57:23 +0100 <EvanR> or old currencies, because the euro was abandoned
2025-11-11 03:01:00 +0100 <jreicher> monochrom: I think Haskell functions are a third kind of function. Math functions are often (infinite) sets. Haskell functions describe a construction of the set, which is a little. But they do it declarative, which is why they're not like C functions.
2025-11-11 03:01:11 +0100 <jreicher> ...a little different...
2025-11-11 03:01:43 +0100otto_s(~user@p4ff2712e.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
2025-11-11 03:01:46 +0100 <monochrom> About many ruby forms can't be combined. Yeah even the javascript community discovered long ago that if an object method returns the object itself, then you can write obj.method1().method2().method3(), it's pretty neat.
2025-11-11 03:03:37 +0100 <int-e> jreicher: I think the point is that math functions are a better model for what Haskell functions are than C functions.
2025-11-11 03:03:41 +0100otto_s(~user@p4ff27119.dip0.t-ipconnect.de)
2025-11-11 03:04:13 +0100 <int-e> (they do a decent job capturing purity)
2025-11-11 03:05:20 +0100 <jreicher> No argument with that, but there are still problems with the math model. You can define a non-computable function mathematically.
2025-11-11 03:05:43 +0100 <int-e> I didn't say that you're wrong (you aren't)
2025-11-11 03:05:57 +0100 <monochrom> No worries. I say "think math functions, algebra" to students who are too used to imperative thinking. They already can't escaping thinking of recipes for explicit construction. So telling them "like algebra" will get the right result.
2025-11-11 03:06:01 +0100 <int-e> monochrom's teaching this stuff
2025-11-11 03:06:30 +0100 <jreicher> monochrom: do you teach Haskell, or some of the other languages and/or lambda calculus/semantics?
2025-11-11 03:06:53 +0100 <int-e> And it's common that you use flawed analogies for new concepts when teaching.
2025-11-11 03:06:56 +0100 <monochrom> For students who are too used to pure math, especially the non-constructive one, I will have to bias them towards more explicit construction, even constructivism, yeah.
2025-11-11 03:07:14 +0100 <jreicher> It cheers me even that those words might enter the classroom.
2025-11-11 03:08:41 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn
2025-11-11 03:09:31 +0100xff0x(~xff0x@fsb6a9491c.tkyc517.ap.nuro.jp)
2025-11-11 03:09:40 +0100 <monochrom> I teach basic Haskell and basic Curry. And some PL topics, e.g., grammars, parsing, type inference, parametricity.
2025-11-11 03:10:04 +0100 <monochrom> Actually this! https://www.cs.utoronto.ca/~trebla/CSCC24-latest/
2025-11-11 03:12:04 +0100peterbecich(~Thunderbi@172.222.148.214) peterbecich
2025-11-11 03:12:55 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds)
2025-11-11 03:13:28 +0100 <jreicher> Thanks for the link!
2025-11-11 03:15:42 +0100Googulator53(~Googulato@2a01-036d-0106-0180-8127-ba79-55a7-6f29.pool6.digikabel.hu)
2025-11-11 03:15:46 +0100Googulator83(~Googulato@2a01-036d-0106-0180-8127-ba79-55a7-6f29.pool6.digikabel.hu) (Quit: Client closed)
2025-11-11 03:24:24 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn
2025-11-11 03:26:35 +0100 <jreicher> What's the current implementation of delimited continuations in Haskell? Is it CC-delcont?
2025-11-11 03:28:24 +0100 <jreicher> I thought there were ghc primops for them now...
2025-11-11 03:28:48 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 256 seconds)
2025-11-11 03:30:20 +0100tabemann(~tabemann@172-13-49-137.lightspeed.milwwi.sbcglobal.net) (Remote host closed the connection)
2025-11-11 03:30:54 +0100tabemann(~travisb@172-13-49-137.lightspeed.milwwi.sbcglobal.net)
2025-11-11 03:31:17 +0100 <geekosaur> there are, but they have some limitations (for example, they have to be used in IO)
2025-11-11 03:32:32 +0100 <jreicher> Do you know what happens if there's a different prompt between a control and its matching prompt? I imagine that "foreign" prompt is captured, but I wouldn't mind finding an explicit discussion of that case.
2025-11-11 03:32:53 +0100 <jreicher> (I should rewatch Alex King's talk, probably)
2025-11-11 03:32:56 +0100 <jreicher> Alexis
2025-11-11 03:33:25 +0100 <Leary> Of course, it's captured.
2025-11-11 03:33:48 +0100 <monochrom> Captured in the middle. The control searches for the matching prompt, captures everything between now and that.
2025-11-11 03:34:36 +0100 <EvanR> jreicher, a function is not always implemented as a set in math
2025-11-11 03:35:13 +0100 <Leary> jreicher: You might be interested in my (as yet unpublished) https://github.com/LSLeary/native-cont library; it provides a safe non-IO interface to the primops.
2025-11-11 03:35:14 +0100 <jreicher> monochrom: yeah, that's what I expected. Can't shake the feeling it deserves explicit discussion, but maybe not.
2025-11-11 03:35:41 +0100Googulator92(~Googulato@2a01-036d-0106-0180-8127-ba79-55a7-6f29.pool6.digikabel.hu)
2025-11-11 03:35:42 +0100 <EvanR> e.g. it could be implemented as a relation plus the functional condition, where relations are primitive
2025-11-11 03:35:43 +0100Googulator53(~Googulato@2a01-036d-0106-0180-8127-ba79-55a7-6f29.pool6.digikabel.hu) (Quit: Client closed)
2025-11-11 03:35:45 +0100 <jreicher> Leary: yes, thank you.
2025-11-11 03:35:58 +0100 <EvanR> it could even be abstractified using category theory
2025-11-11 03:36:21 +0100 <jreicher> EvanR: true, but I think even for relations I've seen more set-theoretic presentations than not.
2025-11-11 03:36:31 +0100 <EvanR> which gives haskell room to call functions functions
2025-11-11 03:36:35 +0100 <monochrom> Oh, type theory says functions are primitive. :)
2025-11-11 03:37:27 +0100 <jreicher> I'm tempted to say that's because the type theory doesn't need to know the details... ;)
2025-11-11 03:37:42 +0100 <EvanR> the structural set theory with sets elements and relations gets closer to type theory by emphasizing the domain and codomain of functions (relations) as the important part
2025-11-11 03:37:56 +0100 <EvanR> instead of the implementation
2025-11-11 03:38:58 +0100 <EvanR> even in "normal math" you really rarely care about what a function "really is"
2025-11-11 03:39:49 +0100 <EvanR> even in normal programming, you rarely care about what an array "really is", hence the big O 1 array myth
2025-11-11 03:40:10 +0100 <monochrom> Hell, s/array/hash table/g
2025-11-11 03:40:25 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn
2025-11-11 03:40:29 +0100monochromis looking at Python and Perl.
2025-11-11 03:41:38 +0100 <EvanR> so perl and PHP were justified in calling their hashtable "array" xD
2025-11-11 03:42:31 +0100 <geekosaur> perl didn't call it array, @x is not %x
2025-11-11 03:42:42 +0100 <geekosaur> they called it list
2025-11-11 03:43:32 +0100humasect(~humasect@dyn-192-249-132-90.nexicom.net) humasect
2025-11-11 03:44:09 +0100 <EvanR> oh list is a hashtable?
2025-11-11 03:44:20 +0100 <EvanR> even better
2025-11-11 03:44:31 +0100 <monochrom> What have I done?! >:)
2025-11-11 03:45:02 +0100 <geekosaur> you're still stuck somewhere insane
2025-11-11 03:45:13 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 256 seconds)
2025-11-11 03:45:15 +0100 <geekosaur> there are three types: scalar, list, hash
2025-11-11 03:46:11 +0100 <geekosaur> you would not normally use a hash as a list unless it's sparse
2025-11-11 03:47:00 +0100 <jreicher> I thought the original sin belonged to awk?
2025-11-11 03:47:07 +0100 <geekosaur> yes
2025-11-11 03:47:19 +0100 <jreicher> Personally I'm a fan of that bad boy.
2025-11-11 03:47:37 +0100 <geekosaur> awk doesn't have arrays/lists, so you use its "associative arrays" as if they were
2025-11-11 03:47:39 +0100 <monochrom> No no no, the original sin belonged to BASIC and Lisp. Yes I'm putting them on the same line.
2025-11-11 03:48:03 +0100 <monochrom> Lisp: Every name has two independent bindings: value and function.
2025-11-11 03:48:16 +0100 <monochrom> BASIC: Every name has two independent bindings: number and string.
2025-11-11 03:48:17 +0100 <jreicher> That's Lisp-2. Lisp-1 is not like that
2025-11-11 03:48:50 +0100 <monochrom> Criminals.
2025-11-11 03:49:14 +0100 <EvanR> every [capitalized] name has two independent bindings, type and constructor
2025-11-11 03:49:32 +0100 <geekosaur> module name/qualifier
2025-11-11 03:49:33 +0100 <EvanR> shoot
2025-11-11 03:49:46 +0100 <EvanR> up to three
2025-11-11 03:50:11 +0100 <jreicher> The thing that really broke my brain when I looked at Lisp (after doing functional) is that there isn't an implicit eval of an expression in head possition.
2025-11-11 03:50:14 +0100 <geekosaur> and patsyns
2025-11-11 03:50:18 +0100 <jreicher> Took me ages to unlearn that expectation
2025-11-11 03:50:21 +0100 <geekosaur> typeclasses
2025-11-11 03:56:56 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn
2025-11-11 04:01:25 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds)
2025-11-11 04:02:09 +0100Sidney(~Sidney@2600:4040:2678:9600:b1c4:ced3:242d:1252) (Quit: Client closed)
2025-11-11 04:02:30 +0100 <EvanR> also haskell has "infinite sets" (types with infinite inhabitants) so that's not a deal breaker
2025-11-11 04:02:47 +0100 <jreicher> Are they only denumerable?
2025-11-11 04:03:12 +0100 <EvanR> depends on your metatheory?
2025-11-11 04:04:18 +0100 <EvanR> if you tried to form a list of all Sequence of Bool, you'd fail to list them all
2025-11-11 04:05:08 +0100 <EvanR> diagonalization could be used to construct a missed sequence
2025-11-11 04:05:32 +0100 <EvanR> I meant Stream of Bool
2025-11-11 04:05:37 +0100Googulator92(~Googulato@2a01-036d-0106-0180-8127-ba79-55a7-6f29.pool6.digikabel.hu) (Quit: Client closed)
2025-11-11 04:05:42 +0100Googulator68(~Googulato@2a01-036d-0106-0180-8127-ba79-55a7-6f29.pool6.digikabel.hu)
2025-11-11 04:06:19 +0100 <jreicher> That's why I was asking about what haskell is representing with these "infinite sets".
2025-11-11 04:06:48 +0100 <EvanR> I saw a constructive notion of "uncountable" floating around called "sequence avoiding" set, maybe could be repurposed for types
2025-11-11 04:07:41 +0100 <jreicher> It can be countable but still not recursive. That's the really surprising case IMO.
2025-11-11 04:08:04 +0100 <EvanR> for all streams of A, say xs, there exists an x such that for all i, x "does not equal" xs !! i
2025-11-11 04:08:30 +0100Square2(~Square4@user/square) Square
2025-11-11 04:09:55 +0100 <EvanR> then A is sequence avoiding
2025-11-11 04:10:28 +0100bggd(~bgg@2a01:e0a:819:1510:c077:be4f:997f:e54a)
2025-11-11 04:11:51 +0100Square3(~Square@user/square) (Ping timeout: 256 seconds)
2025-11-11 04:13:10 +0100 <EvanR> A = Stream Bool would satisfy this using diagonalization to prove the existence part, if you could somehow get the "does not equal" to make sense
2025-11-11 04:31:25 +0100td_(~td@i5387093B.versanet.de) (Ping timeout: 250 seconds)
2025-11-11 04:33:12 +0100td_(~td@i53870938.versanet.de)
2025-11-11 04:36:08 +0100qqe(~qqq@185.54.21.203)
2025-11-11 04:40:43 +0100Googulator96(~Googulato@2a01-036d-0106-0180-8127-ba79-55a7-6f29.pool6.digikabel.hu)
2025-11-11 04:40:44 +0100Googulator68(~Googulato@2a01-036d-0106-0180-8127-ba79-55a7-6f29.pool6.digikabel.hu) (Quit: Client closed)
2025-11-11 04:45:38 +0100bionade24(~quassel@server2.oscloud.info) (Quit: Apocalypse Incoming!)
2025-11-11 04:45:49 +0100bionade24(~quassel@server2.oscloud.info) bionade24
2025-11-11 04:46:23 +0100deptype(~deptype@2406:b400:3a:73c2:87a5:b5f2:d68c:7c8)
2025-11-11 04:54:50 +0100bitdex(~bitdex@gateway/tor-sasl/bitdex) bitdex
2025-11-11 04:54:56 +0100peterbecich(~Thunderbi@172.222.148.214) (Ping timeout: 256 seconds)
2025-11-11 04:56:44 +0100sp1ff(~user@2601:1c2:4c00:6820::8bad) (Read error: Connection reset by peer)
2025-11-11 05:00:36 +0100trickard(~trickard@cpe-62-98-47-163.wireline.com.au) (Read error: Connection reset by peer)
2025-11-11 05:00:49 +0100trickard_(~trickard@cpe-62-98-47-163.wireline.com.au)
2025-11-11 05:05:42 +0100haltingsolver(~cmo@2604:3d09:207f:8000::d1dc) (Ping timeout: 256 seconds)
2025-11-11 05:14:25 +0100machinedgod(~machinedg@d75-159-126-101.abhsia.telus.net) (Ping timeout: 240 seconds)
2025-11-11 05:14:27 +0100sm(znc@plaintextaccounting/sm) ()
2025-11-11 05:17:23 +0100trickard_(~trickard@cpe-62-98-47-163.wireline.com.au) (Read error: Connection reset by peer)
2025-11-11 05:17:36 +0100trickard_(~trickard@cpe-62-98-47-163.wireline.com.au)
2025-11-11 05:25:33 +0100polykernel_(~polykerne@user/polykernel) polykernel
2025-11-11 05:25:47 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn
2025-11-11 05:27:34 +0100polykernel(~polykerne@user/polykernel) (Ping timeout: 246 seconds)
2025-11-11 05:27:35 +0100polykernel_polykernel
2025-11-11 05:30:37 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 256 seconds)
2025-11-11 05:32:21 +0100 <Square2> I'm going to give a talk at my company about Haskell to inspire some people to learn it, cause we'll be needing it for a DSL library. How would you pitch Haskell to middle age people that might not be you most curious programmers?
2025-11-11 05:32:48 +0100 <Square2> be your*
2025-11-11 05:33:21 +0100 <mange> What DSL library are you using that needs Haskell, if you're not already using Haskell?
2025-11-11 05:34:22 +0100 <jreicher> Square2: what language(s) do they already know?
2025-11-11 05:34:26 +0100 <Square2> It's a DSL written in Haskell. It's not in production yet.
2025-11-11 05:34:34 +0100 <Square2> jreicher, java
2025-11-11 05:34:46 +0100 <jreicher> "Impossible to have a null pointer exception"
2025-11-11 05:35:00 +0100 <Square2> That's a good one!
2025-11-11 05:35:20 +0100 <jreicher> This I would not repeat, but it's how I think about this stuff...
2025-11-11 05:36:02 +0100 <jreicher> What garbage collection did for memory management, pure functional languages do for every aspect of data structure management. So the entire class of reference-management mistakes get eliminated. Null references is the most common of those.
2025-11-11 05:37:20 +0100spew(~spew@user/spew) spew
2025-11-11 05:38:45 +0100 <jreicher> The type system SHOULD be a selling point for Haskell too, but I'm not sure it is.
2025-11-11 05:39:03 +0100spew(~spew@user/spew) (Client Quit)
2025-11-11 05:39:19 +0100 <Square2> Personally I feel learning Haskell was a milestone of my work life. Wo exaggerating. It made me better creating programs I wanted and also gave me a better sense of what is possible (and what's not) when it comes to modeling.
2025-11-11 05:39:47 +0100 <Square2> But I guess that's a bit vague.
2025-11-11 05:40:26 +0100 <jreicher> Does your audience care about being better at creating programs? (I know that's a cynical question.)
2025-11-11 05:41:13 +0100 <geekosaur> "writing code with fewer bugs"
2025-11-11 05:42:00 +0100 <Square2> It's not your worst devs, but some are definitely more interested in the daily coffee break than learning new things.
2025-11-11 05:42:04 +0100 <jreicher> Not all programmers do, unfortunately. And even worse, not all jobs require it.
2025-11-11 05:42:38 +0100 <Square2> geekosaur, good point. Sleep better. I actually already had that in my list.
2025-11-11 05:42:56 +0100 <Square2> ...or less stress, imho.
2025-11-11 05:43:24 +0100 <geekosaur> more time writing code, less time debugging
2025-11-11 05:43:39 +0100 <geekosaur> (doesn't work if they can push debugging off onto the junior in the group…)
2025-11-11 05:46:49 +0100 <jreicher> Square2: if you can find a way to describe the composability of Haskell then they might see how much more reuse you can get out of existing code. That appeals to lazy (in a good way) programmers.
2025-11-11 05:48:08 +0100geekosaursuddenly wonders f we could adopt or mangle lwall's triptych
2025-11-11 05:52:13 +0100trickard_(~trickard@cpe-62-98-47-163.wireline.com.au) (Read error: Connection reset by peer)
2025-11-11 05:52:26 +0100trickard_(~trickard@cpe-62-98-47-163.wireline.com.au)
2025-11-11 05:53:25 +0100deptype(~deptype@2406:b400:3a:73c2:87a5:b5f2:d68c:7c8) (Ping timeout: 240 seconds)
2025-11-11 05:58:43 +0100 <Square2> jreicher, Great point. I semi had that in my list.
2025-11-11 05:58:59 +0100 <Square2> thank you all for your input appreciated
2025-11-11 05:59:58 +0100deptype(~deptype@2406:b400:3a:73c2:5ccb:d911:3632:6880)
2025-11-11 06:00:32 +0100 <Leary> Square2: See what you can steal from the OG: John Hughes's "Why Functional Programming Matters"
2025-11-11 06:02:35 +0100 <Square2> Leary, this https://www.youtube.com/watch?v=FGQAP0GxlW8 ?
2025-11-11 06:03:23 +0100jreicher(~user@user/jreicher) (Read error: Connection reset by peer)
2025-11-11 06:04:22 +0100jreicher(~user@user/jreicher) jreicher
2025-11-11 06:05:01 +0100 <Leary> There's an old paper, and various versions of the talk. If you're going to watch one of the talks, best to pick the most recent you can find.
2025-11-11 06:14:42 +0100Nachtgespenst(~user@user/siracusa) (Quit: Bye!)
2025-11-11 06:15:41 +0100Googulator63(~Googulato@2a01-036d-0106-0180-8127-ba79-55a7-6f29.pool6.digikabel.hu)
2025-11-11 06:15:45 +0100Googulator96(~Googulato@2a01-036d-0106-0180-8127-ba79-55a7-6f29.pool6.digikabel.hu) (Quit: Client closed)
2025-11-11 06:20:03 +0100sp1ff(~user@2601:1c2:4c00:6820::8bad) sp1ff
2025-11-11 06:20:37 +0100Googulator63(~Googulato@2a01-036d-0106-0180-8127-ba79-55a7-6f29.pool6.digikabel.hu) (Quit: Client closed)
2025-11-11 06:20:53 +0100Googulator63(~Googulato@2a01-036d-0106-0180-8127-ba79-55a7-6f29.pool6.digikabel.hu)
2025-11-11 06:22:37 +0100 <fgarcia> pitching haskell? :O one that could be nice is supporting both prefix and infix notation
2025-11-11 06:22:58 +0100 <fgarcia> pattern matching is amazing as well
2025-11-11 06:28:30 +0100trickard_trickard
2025-11-11 06:30:27 +0100 <jreicher> Java is getting pattern matching. :)
2025-11-11 06:32:42 +0100ec(~ec@gateway/tor-sasl/ec) (Remote host closed the connection)
2025-11-11 06:32:42 +0100chexum_(~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection)
2025-11-11 06:32:55 +0100chexum(~quassel@gateway/tor-sasl/chexum) chexum
2025-11-11 06:33:04 +0100ec(~ec@gateway/tor-sasl/ec) ec
2025-11-11 06:35:38 +0100Googulator63(~Googulato@2a01-036d-0106-0180-8127-ba79-55a7-6f29.pool6.digikabel.hu) (Quit: Client closed)
2025-11-11 06:35:39 +0100Googulator34(~Googulato@2a01-036d-0106-0180-8127-ba79-55a7-6f29.pool6.digikabel.hu)
2025-11-11 06:40:27 +0100mange(~mange@user/mange) (Remote host closed the connection)
2025-11-11 06:42:31 +0100 <EvanR> I know, tell them how you can define arbitrary brand new operators
2025-11-11 06:42:38 +0100 <EvanR> everybody loves that
2025-11-11 06:48:36 +0100 <Square2> Everyone's nostalgic from learning C++? =D
2025-11-11 06:50:12 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn
2025-11-11 06:50:20 +0100 <jreicher> I miss having a compiler I can crash
2025-11-11 06:52:30 +0100jmcantrell(~weechat@user/jmcantrell) (Ping timeout: 256 seconds)
2025-11-11 06:54:55 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds)
2025-11-11 06:56:14 +0100trickard(~trickard@cpe-62-98-47-163.wireline.com.au) (Read error: Connection reset by peer)
2025-11-11 06:56:28 +0100trickard_(~trickard@cpe-62-98-47-163.wireline.com.au)
2025-11-11 06:57:42 +0100chexum(~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection)
2025-11-11 06:57:50 +0100chexum(~quassel@gateway/tor-sasl/chexum) chexum
2025-11-11 06:57:54 +0100Googulator34(~Googulato@2a01-036d-0106-0180-8127-ba79-55a7-6f29.pool6.digikabel.hu) (Quit: Client closed)
2025-11-11 06:58:12 +0100Googulator34(~Googulato@2a01-036d-0106-0180-8127-ba79-55a7-6f29.pool6.digikabel.hu)
2025-11-11 07:00:16 +0100synchromesh(~john@2406:5a00:2412:2c00:ed84:4ebe:de81:99a2) (Read error: Connection reset by peer)
2025-11-11 07:01:30 +0100synchromesh(~john@2406:5a00:2412:2c00:ed84:4ebe:de81:99a2) synchromesh
2025-11-11 07:20:40 +0100Googulator34(~Googulato@2a01-036d-0106-0180-8127-ba79-55a7-6f29.pool6.digikabel.hu) (Quit: Client closed)
2025-11-11 07:20:43 +0100Googulator33(~Googulato@2a01-036d-0106-0180-8127-ba79-55a7-6f29.pool6.digikabel.hu)
2025-11-11 07:22:01 +0100chexum(~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection)
2025-11-11 07:22:10 +0100chexum(~quassel@gateway/tor-sasl/chexum) chexum
2025-11-11 07:22:58 +0100sm(znc@plaintextaccounting/sm) sm
2025-11-11 07:28:06 +0100jreicher(~user@user/jreicher) (Quit: Beer)
2025-11-11 07:29:28 +0100humasect(~humasect@dyn-192-249-132-90.nexicom.net) (Quit: Leaving...)
2025-11-11 07:30:00 +0100takuan(~takuan@d8D86B9E9.access.telenet.be)
2025-11-11 07:50:10 +0100sord937(~sord937@gateway/tor-sasl/sord937) sord937
2025-11-11 07:52:03 +0100sord937(~sord937@gateway/tor-sasl/sord937) (Remote host closed the connection)
2025-11-11 07:52:21 +0100sord937(~sord937@gateway/tor-sasl/sord937) sord937
2025-11-11 07:52:46 +0100jreicher(~user@user/jreicher) jreicher
2025-11-11 07:53:01 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn
2025-11-11 07:53:25 +0100CiaoSen(~Jura@2a02:8071:64e1:da0:5a47:caff:fe78:33db) CiaoSen
2025-11-11 07:56:37 +0100gmg(~user@user/gehmehgeh) (Remote host closed the connection)
2025-11-11 07:57:17 +0100gmg(~user@user/gehmehgeh) gehmehgeh
2025-11-11 07:57:55 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds)
2025-11-11 08:07:50 +0100 <dibblego> data X f a b = X (a, f b) -- what is X?
2025-11-11 08:08:17 +0100trickard_(~trickard@cpe-62-98-47-163.wireline.com.au) (Read error: Connection reset by peer)
2025-11-11 08:08:31 +0100trickard_(~trickard@cpe-62-98-47-163.wireline.com.au)
2025-11-11 08:09:46 +0100Lord_of_Life(~Lord@user/lord-of-life/x-2819915) (Quit: Laa shay'a waqi'un moutlaq bale kouloun moumkine)
2025-11-11 08:11:10 +0100Lord_of_Life(~Lord@user/lord-of-life/x-2819915) Lord_of_Life
2025-11-11 08:20:23 +0100xff0x_(~xff0x@fsb6a9491c.tkyc517.ap.nuro.jp)
2025-11-11 08:21:46 +0100xff0x(~xff0x@fsb6a9491c.tkyc517.ap.nuro.jp) (Ping timeout: 256 seconds)
2025-11-11 08:27:59 +0100divlamir(~divlamir@user/divlamir) (Ping timeout: 256 seconds)
2025-11-11 08:29:59 +0100divlamir(~divlamir@user/divlamir) divlamir
2025-11-11 08:32:36 +0100Sgeo(~Sgeo@user/sgeo) (Read error: Connection reset by peer)
2025-11-11 08:34:25 +0100 <jreicher> I think this is what I was after earlier https://hackage.haskell.org/package/ghc-prim-0.13.0/docs/GHC-Prim.html#g:24
2025-11-11 08:34:35 +0100 <jreicher> dibblego: what's the context for your question? Where did that snippet come from?
2025-11-11 08:34:57 +0100 <dibblego> I made it up, I want the data type X from a library
2025-11-11 08:38:11 +0100divlamir(~divlamir@user/divlamir) (Ping timeout: 256 seconds)