2026/04/14

2026-04-14 00:06:38 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-04-14 00:09:33 +0000 <geekosaur> don't forget 29 bit minimum size for Int, vs. the Apple II having an 8-bit CPU
2026-04-14 00:09:47 +0000 <geekosaur> you could work with larger numbers but you had to chain ADD+ADC
2026-04-14 00:09:55 +0000 <EvanR> "Int" would be emulated so to speak
2026-04-14 00:09:59 +0000 <monochrom> Yeah it's going to be so slow. :)
2026-04-14 00:10:07 +0000 <EvanR> if it had to be standards conforming
2026-04-14 00:10:39 +0000 <EvanR> bonus points for the emulated Int being literally 29 bit
2026-04-14 00:10:42 +0000 <geekosaur> (I spent a lot of time doing 6502 asm back then)
2026-04-14 00:11:18 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 246 seconds)
2026-04-14 00:11:28 +0000 <geekosaur> it might be if MicroHS steals 3 bits for gc marking
2026-04-14 00:14:23 +0000czan(~czan@user/mange) czan
2026-04-14 00:22:19 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-04-14 00:30:09 +0000jmcantrell_(~weechat@user/jmcantrell) (Ping timeout: 255 seconds)
2026-04-14 00:31:17 +0000 <int-e> It's 30 bits per the Haskell 98 report (range -2^29...2^29-1)
2026-04-14 00:32:13 +0000bitdex(~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection)
2026-04-14 00:32:36 +0000bitdex(~bitdex@gateway/tor-sasl/bitdex) bitdex
2026-04-14 00:32:52 +0000califax(~califax@user/califx) (Remote host closed the connection)
2026-04-14 00:33:01 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 276 seconds)
2026-04-14 00:38:07 +0000 <geekosaur> oh, sorry, misremembeered where the 29 was
2026-04-14 00:38:59 +0000emmanuelux(~em@user/emmanuelux) emmanuelux
2026-04-14 00:43:26 +0000califax(~califax@user/califx) califx
2026-04-14 00:43:52 +0000merijn(~merijn@62.45.136.136) merijn
2026-04-14 00:45:03 +0000bitdex(~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 265 seconds)
2026-04-14 00:48:45 +0000merijn(~merijn@62.45.136.136) (Ping timeout: 268 seconds)
2026-04-14 00:51:33 +0000xff0x(~xff0x@2405:6580:b080:900:64fb:89e9:b5c1:12b3) (Ping timeout: 244 seconds)
2026-04-14 00:51:56 +0000Googulator(~Googulato@94-21-172-213.pool.digikabel.hu) (Quit: Client closed)
2026-04-14 00:52:15 +0000Googulator(~Googulato@94-21-172-213.pool.digikabel.hu)
2026-04-14 00:59:11 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-04-14 01:03:26 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
2026-04-14 01:03:52 +0000v0id_7(~v0id_7@user/v0id-7:62772) (Quit: whatever u sick fcks)
2026-04-14 01:14:33 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-04-14 01:17:19 +0000shapr(~user@130.44.148.32) (Remote host closed the connection)
2026-04-14 01:19:41 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 265 seconds)
2026-04-14 01:24:17 +0000uli-fem(~uli-fem@203.87.114.209)
2026-04-14 01:24:19 +0000bitdex(~bitdex@gateway/tor-sasl/bitdex) bitdex
2026-04-14 01:30:20 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-04-14 01:34:11 +0000Googulator(~Googulato@94-21-172-213.pool.digikabel.hu) (Quit: Client closed)
2026-04-14 01:34:27 +0000Googulator(~Googulato@94-21-172-213.pool.digikabel.hu)
2026-04-14 01:37:12 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 255 seconds)
2026-04-14 01:38:38 +0000Pixi(~Pixi@user/pixi) (Quit: Leaving)
2026-04-14 01:46:46 +0000Pixi(~Pixi@user/pixi) Pixi
2026-04-14 01:48:24 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-04-14 01:51:46 +0000polykernel_(~polykerne@user/polykernel) polykernel
2026-04-14 01:53:24 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 255 seconds)
2026-04-14 01:53:32 +0000xff0x(~xff0x@fsb6a9491c.tkyc517.ap.nuro.jp)
2026-04-14 01:54:26 +0000polykernel(~polykerne@user/polykernel) (Ping timeout: 248 seconds)
2026-04-14 01:54:27 +0000polykernel_polykernel
2026-04-14 02:04:10 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-04-14 02:08:50 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds)
2026-04-14 02:12:42 +0000synchromesh(~john@2406:5a00:2412:2c00:2c29:cc68:8842:5c05) (Quit: WeeChat 4.1.1)
2026-04-14 02:19:34 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-04-14 02:22:09 +0000synchromesh(~john@2406:5a00:2412:2c00:1067:d102:8207:7346) synchromesh
2026-04-14 02:24:36 +0000synchrom1(~john@115.69.186.131) synchromesh
2026-04-14 02:24:56 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 265 seconds)
2026-04-14 02:26:48 +0000synchromesh(~john@2406:5a00:2412:2c00:1067:d102:8207:7346) (Ping timeout: 268 seconds)
2026-04-14 02:29:56 +0000bitdex(~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 265 seconds)
2026-04-14 02:42:15 +0000terrorjack(~terrorjac@static.27.101.55.162.clients.your-server.de) (Quit: The Lounge - https://thelounge.chat)
2026-04-14 02:50:59 +0000rekahsoft(~rekahsoft@bras-base-orllon1103w-grc-20-76-67-111-168.dsl.bell.ca) (Remote host closed the connection)
2026-04-14 02:51:09 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-04-14 02:56:04 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
2026-04-14 03:02:08 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-04-14 03:06:49 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds)
2026-04-14 03:17:56 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-04-14 03:24:38 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
2026-04-14 03:27:23 +0000divlamir(~divlamir@user/divlamir) (Read error: Connection reset by peer)
2026-04-14 03:27:35 +0000divlamir(~divlamir@user/divlamir) divlamir
2026-04-14 03:34:33 +0000uli-fem(~uli-fem@203.87.114.209) (Ping timeout: 248 seconds)
2026-04-14 03:35:59 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-04-14 03:40:55 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
2026-04-14 03:51:46 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-04-14 03:55:49 +0000uli-fem(~uli-fem@203.87.114.209)
2026-04-14 03:56:25 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds)
2026-04-14 04:01:01 +0000uli-fem(~uli-fem@203.87.114.209) (Ping timeout: 276 seconds)
2026-04-14 04:07:32 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-04-14 04:12:22 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 256 seconds)
2026-04-14 04:13:21 +0000ystael(~ystael@user/ystael) (Ping timeout: 255 seconds)
2026-04-14 04:23:18 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-04-14 04:25:20 +0000pyook(~puke@user/puke) puke
2026-04-14 04:25:20 +0000pukeGuest913
2026-04-14 04:25:20 +0000pyookpuke
2026-04-14 04:27:02 +0000Guest913(~puke@user/puke) (Ping timeout: 250 seconds)
2026-04-14 04:28:02 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds)
2026-04-14 04:29:52 +0000takuan(~takuan@d8D86B9E9.access.telenet.be)
2026-04-14 04:31:20 +0000uli-fem(~uli-fem@203.87.114.209)
2026-04-14 04:35:43 +0000uli-fem(~uli-fem@203.87.114.209) (Ping timeout: 264 seconds)
2026-04-14 04:38:46 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-04-14 04:43:56 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 268 seconds)
2026-04-14 04:54:34 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-04-14 04:56:55 +0000uli-fem(~uli-fem@203.87.114.209)
2026-04-14 05:01:06 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 246 seconds)
2026-04-14 05:01:31 +0000uli-fem(~uli-fem@203.87.114.209) (Ping timeout: 244 seconds)
2026-04-14 05:03:08 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-04-14 05:07:30 +0000machinedgod(~machinedg@d172-219-48-230.abhsia.telus.net) (Ping timeout: 248 seconds)
2026-04-14 05:07:43 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
2026-04-14 05:18:56 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-04-14 05:20:40 +0000peterbecich(~Thunderbi@71.84.33.135) peterbecich
2026-04-14 05:21:51 +0000Tikosh(~Tikosh@user/Tikosh) Tikosh
2026-04-14 05:23:19 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
2026-04-14 05:23:34 +0000 <Tikosh> Hello! I was wondering if you can review a simple text game i made in haskell. see how good I did, as a programming noob of a few years. here is the code https://bpa.st/B56IQ
2026-04-14 05:25:20 +0000 <Tikosh> I do not know if i got the recursion right, though. what you guys think?
2026-04-14 05:29:22 +0000peterbecich(~Thunderbi@71.84.33.135) (Ping timeout: 248 seconds)
2026-04-14 05:30:52 +0000uli-fem(~uli-fem@203.87.114.209)
2026-04-14 05:36:48 +0000weary-traveler(~user@user/user363627) (Ping timeout: 246 seconds)
2026-04-14 05:41:48 +0000haritz(~hrtz@user/haritz) (Quit: ZNC 1.8.2+deb3.1+deb12u1 - https://znc.in)
2026-04-14 05:43:48 +0000uli-fem(~uli-fem@203.87.114.209) (Ping timeout: 246 seconds)
2026-04-14 05:46:17 +0000acidjnk_new(~acidjnk@p200300d6e700e507eac8604a20d7f4cd.dip0.t-ipconnect.de) acidjnk
2026-04-14 05:56:13 +0000 <probie> Tikosh: `isNameAction` is confusingly named, since it doesn't return a `Bool`
2026-04-14 05:57:30 +0000 <probie> Also, the `elem` function is worth knowing
2026-04-14 05:57:45 +0000 <Tikosh> probie: alright
2026-04-14 05:58:27 +0000 <probie> > "tacos" `elem` ["milanesa", "enchiladas", "torta", "tacos", "chile rellenos"]
2026-04-14 05:58:28 +0000 <lambdabot> True
2026-04-14 05:58:33 +0000 <probie> > "pizza" `elem` ["milanesa", "enchiladas", "torta", "tacos", "chile rellenos"]
2026-04-14 05:58:34 +0000 <lambdabot> False
2026-04-14 06:00:25 +0000 <Tikosh> i was attempting to use recursion and was enlightened about the thing called mutual recursion
2026-04-14 06:00:39 +0000 <Tikosh> this haskell stuff melts brains. but I'm glad i learn it!
2026-04-14 06:00:54 +0000 <Tikosh> still learning, of course
2026-04-14 06:04:09 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-04-14 06:09:06 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 256 seconds)
2026-04-14 06:13:47 +0000uli-fem(~uli-fem@203.87.114.209)
2026-04-14 06:14:55 +0000bryanv(~quassel@2603:c028:4503:7500:45b7:933:ab17:bc10) (Ping timeout: 276 seconds)
2026-04-14 06:19:55 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-04-14 06:21:00 +0000uli-fem(~uli-fem@203.87.114.209) (Ping timeout: 245 seconds)
2026-04-14 06:25:19 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 276 seconds)
2026-04-14 06:27:19 +0000tromp(~textual@2001:1c00:340e:2700:f5bd:97ff:8f76:c38c)
2026-04-14 06:29:18 +0000tusko(~uwu@user/tusko) (Remote host closed the connection)
2026-04-14 06:29:33 +0000tusko(~uwu@user/tusko) tusko
2026-04-14 06:34:11 +0000czan(~czan@user/mange) (Remote host closed the connection)
2026-04-14 06:35:04 +0000bryanv(~quassel@2603:c028:4503:7500:45b7:933:ab17:bc10)
2026-04-14 06:35:42 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-04-14 06:36:06 +0000uli-fem(~uli-fem@203.87.114.209)
2026-04-14 06:40:04 +0000Tikosh(~Tikosh@user/Tikosh) (Quit: Client closed)
2026-04-14 06:40:12 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
2026-04-14 06:40:32 +0000michalz(~michalz@185.246.207.193) (Read error: Connection reset by peer)
2026-04-14 06:40:52 +0000uli-fem(~uli-fem@203.87.114.209) (Ping timeout: 268 seconds)
2026-04-14 06:43:53 +0000michalz(~michalz@185.246.207.203)
2026-04-14 06:47:45 +0000sord937(~sord937@gateway/tor-sasl/sord937) sord937
2026-04-14 06:48:05 +0000 <[exa]> mornin'
2026-04-14 06:51:05 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-04-14 06:56:09 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds)
2026-04-14 07:05:08 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-04-14 07:11:49 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
2026-04-14 07:17:36 +0000uli-fem(~uli-fem@203.87.114.209)
2026-04-14 07:18:21 +0000Milan_Vanca(~milan@user/Milan-Vanca:32634) Milan_Vanca
2026-04-14 07:19:25 +0000sord937(~sord937@gateway/tor-sasl/sord937) (Remote host closed the connection)
2026-04-14 07:20:55 +0000CiaoSen(~Jura@p549cbfb1.dip0.t-ipconnect.de) CiaoSen
2026-04-14 07:20:58 +0000sord937(~sord937@gateway/tor-sasl/sord937) sord937
2026-04-14 07:22:17 +0000uli-fem(~uli-fem@203.87.114.209) (Ping timeout: 248 seconds)
2026-04-14 07:25:43 +0000 <Milan_Vanca> Good morning guyz! The more I read, the more confusing all sharing and evaluation is :-(
2026-04-14 07:25:56 +0000 <Milan_Vanca> > let a = [1..3] :: [Int] in (length a :: Int) == (length a :: Int)
2026-04-14 07:25:58 +0000 <lambdabot> True
2026-04-14 07:26:26 +0000 <monochrom> That example is not confusing.
2026-04-14 07:26:31 +0000 <Milan_Vanca> Will length a be evaluated twice? In means will the list be traversed twice?
2026-04-14 07:27:56 +0000 <Milan_Vanca> My expectation is that as "a" is same.. so "length a" must be same.. and thus it will be evaluated only once and then passed to comparsion
2026-04-14 07:29:32 +0000 <[exa]> Milan_Vanca: in this case you don't do anything to tell the compiler to NOT evaluate it twice; but ghc may quite safely transform the code to something like `let a=[1..3] in let tmp=length a in tmp == tmp`
2026-04-14 07:30:49 +0000leppard(~noOne@ipservice-092-208-182-236.092.208.pools.vodafone-ip.de) (Ping timeout: 248 seconds)
2026-04-14 07:31:54 +0000 <[exa]> Milan_Vanca: the rule of thumb is "let-bindings create exactly one thunk". Once thunks get evaluated for the first time, they are _rewritten_ to their results, so evaluating them for the second time "does nothing". Which gives you a pretty good tool to make sure the `length` isn't going to execute twice
2026-04-14 07:33:26 +0000Sgeo(~Sgeo@user/sgeo) (Read error: Connection reset by peer)
2026-04-14 07:33:43 +0000 <Milan_Vanca> [exa]: Yeah.. I can follow that.. but my example bound only list to variable "let a = [1..3] :: [Int]"
2026-04-14 07:33:56 +0000 <[exa]> that's ok, the list is going to get materialized only once
2026-04-14 07:33:59 +0000 <Milan_Vanca> If I want to be sure it wont be evaluated twice I need to bound it myself right?
2026-04-14 07:34:20 +0000 <Milan_Vanca> I mean "length a"
2026-04-14 07:34:42 +0000 <Milan_Vanca> You said it "may" be evaluated once as ghc does some rewriting.
2026-04-14 07:35:20 +0000 <[exa]> yeah there's some optimizations that are able to uniquify common sub-expressions a little, so chances are it might do this for you. But that's hard to rely upon tbh.
2026-04-14 07:35:54 +0000 <[exa]> anyway yeah if you make a single binding for the `length a`, it should evaluate once
2026-04-14 07:37:49 +0000 <mra> Milan_Vanca: maybe a silly question, but why does it matter if it's evaluated twice?
2026-04-14 07:39:08 +0000 <[exa]> if the list is yuge, caching the O(n) length computation may help a lot
2026-04-14 07:39:43 +0000 <[exa]> (ofc assuming some other use-case than `len==len` :D )
2026-04-14 07:40:02 +0000 <Milan_Vanca> Well for simple problems it probably does not.. for real world programming I guess it does... I would like to use ghc/haskell with real world programs
2026-04-14 07:40:19 +0000 <Milan_Vanca> [exa]: :)
2026-04-14 07:40:23 +0000 <mra> i guess that's true, yeah. i would expect GHC to factor out the common subexpression, but i guess relying on that may be unwise
2026-04-14 07:41:50 +0000uli-fem(~uli-fem@203.87.114.209)
2026-04-14 07:42:07 +0000 <Milan_Vanca> Examples.. I want to reuse one "http_manager" across different functions.. when manager is defined as let manager = getManager settings.. I want to be sure it is not always a new manager but the old manager with cached tcp connections.
2026-04-14 07:43:18 +0000 <[exa]> Milan_Vanca: in such case you might want to put the manager into some kind of MVar or IORef so that you can actually modify it later (assuming it doesn't do that internally)
2026-04-14 07:43:31 +0000alter2000(~alter2000@user/alter2000) alter2000
2026-04-14 07:43:47 +0000 <probie> It pretty much never factors out the common subexpression, since doing it carelessly can introduce space leaks. The programmer already has `let` at their disposal if that's the behaviour they want.
2026-04-14 07:44:02 +0000 <monochrom> Your example is empirically weird. (GHC 9.6.7 -O) The core code goes to the trouble of constructing [1..3] then evaluating its length. Then the answer is ignored, the code prints True without even comparing 3==3.
2026-04-14 07:44:11 +0000 <Milan_Vanca> Or just define it and then pass it to all functions that need it?
2026-04-14 07:44:25 +0000leppard(~noOne@ipservice-092-208-182-236.092.208.pools.vodafone-ip.de) Inline
2026-04-14 07:45:55 +0000terrorjack(~terrorjac@2a01:4f8:271:2d98::2) terrorjack
2026-04-14 07:46:09 +0000uli-fem(~uli-fem@203.87.114.209) (Ping timeout: 245 seconds)
2026-04-14 07:46:25 +0000 <mra> that seems messier than just wrapping it in IORef
2026-04-14 07:46:33 +0000 <Milan_Vanca> probie: So if I define top lvl function as a1 = [1..10^6] :: [Int] a2 = [1..10^6] :: [Int] there is not subexpresion elimination and in fact 2 big lists?
2026-04-14 07:46:47 +0000 <monochrom> In general, you can rely on reuse that you manually arranged for by aliasing. But you cannot rely on optimisers not being more aggressive than you.
2026-04-14 07:47:00 +0000 <Milan_Vanca> monochrom: really?
2026-04-14 07:47:52 +0000 <Milan_Vanca> why is my example empirically weird? why it wont evaluate 3==3?
2026-04-14 07:48:05 +0000 <Milan_Vanca> Like is it optimization that is sees whatever it is it must be true?
2026-04-14 07:48:17 +0000jreicher(~joelr@user/jreicher) (Quit: In transit)
2026-04-14 07:48:35 +0000 <Milan_Vanca> > (error "a" :: Int) == (error "a" :: Int)
2026-04-14 07:48:36 +0000 <lambdabot> *Exception: a
2026-04-14 07:48:36 +0000 <lambdabot> CallStack (from HasCallStack):
2026-04-14 07:48:36 +0000 <lambdabot> error, called at <interactive>:3:2 in interactive:Ghci1
2026-04-14 07:48:41 +0000 <Milan_Vanca> no it must evaluate
2026-04-14 07:48:47 +0000 <Milan_Vanca> ah no
2026-04-14 07:48:49 +0000 <monochrom> I don't know of any answer other than "read GHC source code".
2026-04-14 07:48:55 +0000 <Milan_Vanca> :D
2026-04-14 07:49:02 +0000 <Milan_Vanca> hmmm
2026-04-14 07:49:06 +0000 <Milan_Vanca> yeah ty
2026-04-14 07:49:25 +0000 <Milan_Vanca> So I can use aliasing and naming to explicitly say what I want to share
2026-04-14 07:49:28 +0000 <Milan_Vanca> got it :)
2026-04-14 07:50:35 +0000 <probie> Milan_Vanca: In your example there are two distinct thunks. There aren't any big lists until someone starts doing something with them. Sharing those would be a bad idea if you didn't know how they were going to be used
2026-04-14 07:50:49 +0000 <monochrom> or "take a code optimization course to learn that beyond the obvious you must start using heuristics that are full of false positives and false negatives and by the time you have 100 heuristics it begins to behave like randomized LLMs".
2026-04-14 07:52:53 +0000 <probie> You might end up with a big list in a case where if they weren't shared, no big list ever needed to exist in memory e.g. if you've got a reference to `a1` and have evaluated `last a2` to WHNF, if they're the same list, that reference to a1 means you can't garbage collect the list spine you evaluated as part of `last a2`
2026-04-14 07:53:26 +0000 <gentauro> I have setup emacs (I run in a terminal) with LSP to give minimalistic messages (example: Found hole: _ :: [Int] -> Int) to avoid too much "bloated" LSP stuff. However, sometimes, I would like to get the full message. Anybody know a key-combination for that?
2026-04-14 07:53:28 +0000 <probie> If in the end, the way you use `a1` is simply something like `head a1`; you've just been carrying around a big list for absolutely no reason
2026-04-14 07:53:44 +0000 <Milan_Vanca> monochrom: sounds scary :D
2026-04-14 07:54:45 +0000leppard(~noOne@ipservice-092-208-182-236.092.208.pools.vodafone-ip.de) (Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/)
2026-04-14 07:55:05 +0000 <Milan_Vanca> probie: that makes sense and that is why I want to know how something works.
2026-04-14 07:55:12 +0000merijn(~merijn@77.242.116.146) merijn
2026-04-14 07:56:05 +0000 <Milan_Vanca> probie: Either one might end up with 2x times the memory.. or retain something in memory longer.
2026-04-14 07:56:19 +0000Googulator55(~Googulato@94-21-172-213.pool.digikabel.hu)
2026-04-14 08:00:12 +0000Googulator(~Googulato@94-21-172-213.pool.digikabel.hu) (Ping timeout: 245 seconds)
2026-04-14 08:00:17 +0000 <Milan_Vanca> I did let a = 1 + 1 :: Int let b = 1 + 1 :: Int; seq b (); :sprint a; and it showed still as thunk and that confused me
2026-04-14 08:00:50 +0000 <Milan_Vanca> Anyway I think I know why.. a and b never pointed to same thunk in the first place
2026-04-14 08:00:59 +0000 <Milan_Vanca> ty guyz :)
2026-04-14 08:01:41 +0000uli-fem(~uli-fem@203.87.114.209)
2026-04-14 08:03:17 +0000 <monochrom> I am much less surprised because I've seen GCC done similar weird things before. I had "int x=1; int i=0; while (x>=0) {x*=2; ++i;} print i". gcc -O turned it into "for (i=0; i<31; i++)". gcc -O2 recognized "strictly speaking UB" so turned it into "L2: jmp L2"
2026-04-14 08:06:27 +0000uli-fem(~uli-fem@203.87.114.209) (Ping timeout: 272 seconds)
2026-04-14 08:11:14 +0000emmanuelux(~em@user/emmanuelux) (Quit: bye)
2026-04-14 08:11:32 +0000jreicher(~joelr@user/jreicher) jreicher
2026-04-14 08:14:54 +0000karenw(~karenw@user/karenw) karenw
2026-04-14 08:18:43 +0000chewybread(~chewybrea@240b:10:9502:4100:cc55:2129:18be:80a5)
2026-04-14 08:18:43 +0000chewybread(~chewybrea@240b:10:9502:4100:cc55:2129:18be:80a5) (Changing host)
2026-04-14 08:18:43 +0000chewybread(~chewybrea@user/chewybread) chewybread
2026-04-14 08:19:30 +0000s3(~s3@user/bn) (Ping timeout: 248 seconds)
2026-04-14 08:22:33 +0000tromp(~textual@2001:1c00:340e:2700:f5bd:97ff:8f76:c38c) (Quit: My iMac has gone to sleep. ZZZzzz…)
2026-04-14 08:27:55 +0000ft(~ft@p508db287.dip0.t-ipconnect.de) (Quit: leaving)
2026-04-14 08:28:48 +0000DetourNe-(~DetourNet@user/DetourNetworkUK) DetourNetworkUK
2026-04-14 08:28:55 +0000DetourNetworkUK(~DetourNet@user/DetourNetworkUK) (Read error: Connection reset by peer)
2026-04-14 08:31:02 +0000DetourNe-DetourNetworkUK
2026-04-14 08:38:07 +0000chewybread(~chewybrea@user/chewybread) (Remote host closed the connection)
2026-04-14 08:42:33 +0000uli-fem(~uli-fem@203.87.114.209)
2026-04-14 08:48:45 +0000alter2000(~alter2000@user/alter2000) (Ping timeout: 255 seconds)
2026-04-14 08:49:31 +0000uli-fem(~uli-fem@203.87.114.209) (Ping timeout: 264 seconds)
2026-04-14 08:54:09 +0000uli-fem(~uli-fem@203.87.114.209)
2026-04-14 08:54:50 +0000arandombit(~arandombi@user/arandombit) arandombit
2026-04-14 08:57:12 +0000p3n(~p3n@2a00:19a0:3:7c:0:d9c6:7cf6:1) (Quit: ZNC 1.10.1 - https://znc.in)
2026-04-14 08:58:36 +0000p3n(~p3n@2a00:19a0:3:7c:0:d9c6:7cf6:1) p3n
2026-04-14 09:02:56 +0000dutchie(~dutchie@user/dutchie) (Ping timeout: 268 seconds)
2026-04-14 09:08:16 +0000puke(~puke@user/puke) (Ping timeout: 250 seconds)
2026-04-14 09:10:22 +0000dutchie(~dutchie@user/dutchie) dutchie
2026-04-14 09:14:04 +0000CiaoSen(~Jura@p549cbfb1.dip0.t-ipconnect.de) (Ping timeout: 245 seconds)
2026-04-14 09:18:10 +0000pfc(~pfc@user/pfc) (Ping timeout: 248 seconds)
2026-04-14 09:23:32 +0000oskarw(~user@user/oskarw) oskarw
2026-04-14 09:24:54 +0000srazkvt(~sarah@user/srazkvt) srazkvt
2026-04-14 09:33:47 +0000Googulator32(~Googulato@94-21-172-213.pool.digikabel.hu)
2026-04-14 09:34:40 +0000comerijn(~merijn@77.242.116.146) merijn
2026-04-14 09:36:33 +0000tromp(~textual@2001:1c00:340e:2700:f5bd:97ff:8f76:c38c)
2026-04-14 09:37:17 +0000Googulator55(~Googulato@94-21-172-213.pool.digikabel.hu) (Ping timeout: 245 seconds)
2026-04-14 09:37:25 +0000merijn(~merijn@77.242.116.146) (Ping timeout: 244 seconds)
2026-04-14 09:38:14 +0000sdrfan123(~sdrfan123@2a01:cb15:148:1800:81dc:48b:66df:6cbd)
2026-04-14 09:41:52 +0000sdrfan123(~sdrfan123@2a01:cb15:148:1800:81dc:48b:66df:6cbd) (Client Quit)
2026-04-14 09:43:18 +0000puke(~puke@user/puke) puke
2026-04-14 09:45:14 +0000acidsys(~crameleon@openSUSE/member/crameleon) (Ping timeout: 252 seconds)
2026-04-14 09:45:30 +0000karenw(~karenw@user/karenw) (Quit: Deep into that darkness peering...)
2026-04-14 09:45:49 +0000acidsys(~crameleon@openSUSE/member/crameleon) crameleon
2026-04-14 09:51:51 +0000alter2000(~alter2000@user/alter2000) alter2000
2026-04-14 09:58:05 +0000uli-fem(~uli-fem@203.87.114.209) (Ping timeout: 244 seconds)
2026-04-14 09:59:19 +0000acidjnk_new3(~acidjnk@p200300d6e700e525da495f54e6c9df91.dip0.t-ipconnect.de)
2026-04-14 10:02:17 +0000acidjnk_new(~acidjnk@p200300d6e700e507eac8604a20d7f4cd.dip0.t-ipconnect.de) (Ping timeout: 248 seconds)
2026-04-14 10:03:52 +0000_________(~nobody@user/noodly) (Ping timeout: 244 seconds)
2026-04-14 10:06:34 +0000xff0x(~xff0x@fsb6a9491c.tkyc517.ap.nuro.jp) (Ping timeout: 245 seconds)
2026-04-14 10:28:11 +0000Square3(~Square4@user/square) Square
2026-04-14 10:28:52 +0000uli-fem(~uli-fem@203.87.114.209)
2026-04-14 10:30:50 +0000Googulator32(~Googulato@94-21-172-213.pool.digikabel.hu) (Quit: Client closed)
2026-04-14 10:31:04 +0000Googulator32(~Googulato@94-21-172-213.pool.digikabel.hu)
2026-04-14 10:31:30 +0000tremon(~tremon@83.80.159.219) tremon
2026-04-14 10:31:59 +0000bggd(~bgg@user/bggd) (Remote host closed the connection)
2026-04-14 10:33:05 +0000alter2000(~alter2000@user/alter2000) (Ping timeout: 245 seconds)
2026-04-14 10:33:19 +0000uli-fem(~uli-fem@203.87.114.209) (Ping timeout: 244 seconds)
2026-04-14 10:35:18 +0000alter2000(~alter2000@user/alter2000) alter2000
2026-04-14 10:41:35 +0000alter2000(~alter2000@user/alter2000) (Ping timeout: 244 seconds)
2026-04-14 10:42:26 +0000fun-safe-math(~fun-safe-@97.115.234.213) (Ping timeout: 252 seconds)
2026-04-14 10:43:15 +0000p3n(~p3n@2a00:19a0:3:7c:0:d9c6:7cf6:1) (Quit: ZNC 1.10.1 - https://znc.in)
2026-04-14 10:43:24 +0000fun-safe-math(~fun-safe-@71-34-105-125.ptld.qwest.net) fun-safe-math
2026-04-14 10:43:25 +0000craunts795335385(~craunts@152.32.99.2)
2026-04-14 10:43:44 +0000p3n(~p3n@2a00:19a0:3:7c:0:d9c6:7cf6:1) p3n
2026-04-14 10:45:26 +0000uli-fem(~uli-fem@203.87.114.209)
2026-04-14 10:49:54 +0000uli-fem(~uli-fem@203.87.114.209) (Ping timeout: 245 seconds)
2026-04-14 10:49:54 +0000Googulator32Googulator
2026-04-14 10:58:01 +0000uli-fem(~uli-fem@203.87.114.209)
2026-04-14 11:00:48 +0000_________(~nobody@user/noodly) _________
2026-04-14 11:01:55 +0000fun-safe-math(~fun-safe-@71-34-105-125.ptld.qwest.net) ()
2026-04-14 11:02:47 +0000uli-fem(~uli-fem@203.87.114.209) (Ping timeout: 252 seconds)
2026-04-14 11:03:58 +0000fun-safe-math(~fun-safe-@71-34-105-125.ptld.qwest.net) fun-safe-math
2026-04-14 11:04:40 +0000uli-fem(~uli-fem@203.87.114.209)
2026-04-14 11:05:13 +0000xff0x(~xff0x@2405:6580:b080:900:763c:362b:b9c4:6a52)
2026-04-14 11:09:07 +0000divlamir(~divlamir@user/divlamir) (Ping timeout: 268 seconds)
2026-04-14 11:09:19 +0000uli-fem(~uli-fem@203.87.114.209) (Ping timeout: 264 seconds)
2026-04-14 11:09:46 +0000divlamir(~divlamir@user/divlamir) divlamir
2026-04-14 11:09:48 +0000alter2000(~alter2000@user/alter2000) alter2000
2026-04-14 11:11:56 +0000CiaoSen(~Jura@p549cbfb1.dip0.t-ipconnect.de) CiaoSen
2026-04-14 11:22:19 +0000jreicher(~joelr@user/jreicher) (Quit: In transit)
2026-04-14 11:29:15 +0000nschoe(~nschoe@2a01:e0a:8e:a190:8b07:b321:e715:9a8a) (Quit: ZNC 1.8.2 - https://znc.in)
2026-04-14 11:29:32 +0000nschoe(~nschoe@82-65-202-30.subs.proxad.net) nschoe
2026-04-14 11:30:59 +0000__monty__(~toonn@user/toonn) toonn
2026-04-14 11:33:15 +0000weary-traveler(~user@user/user363627) user363627
2026-04-14 11:57:18 +0000CiaoSen(~Jura@p549cbfb1.dip0.t-ipconnect.de) (Ping timeout: 255 seconds)
2026-04-14 11:58:11 +0000 <Milan_Vanca> Hmm is output of +RTS -N4 -s in line that talks about sparks SPARKS: 49151 (7336 converted, 855 overflowed, 0 dud, 0 GC'd, 0 fizzled)
2026-04-14 11:58:25 +0000 <Milan_Vanca> > 49151 == 7336 + 855
2026-04-14 11:58:27 +0000 <lambdabot> False
2026-04-14 11:58:40 +0000haritz(~hrtz@140.228.70.141)
2026-04-14 11:58:40 +0000haritz(~hrtz@140.228.70.141) (Changing host)
2026-04-14 11:58:40 +0000haritz(~hrtz@user/haritz) haritz
2026-04-14 11:59:00 +0000humasect(~humasect@dyn-192-249-132-90.nexicom.net) humasect
2026-04-14 11:59:40 +0000 <Milan_Vanca> I mean it should sum right? Or is overflowed counted as more than converted?
2026-04-14 12:00:28 +0000jreicher(~joelr@user/jreicher) jreicher
2026-04-14 12:00:51 +0000tromp(~textual@2001:1c00:340e:2700:f5bd:97ff:8f76:c38c) (Quit: My iMac has gone to sleep. ZZZzzz…)
2026-04-14 12:01:14 +0000arandombit(~arandombi@user/arandombit) (Remote host closed the connection)
2026-04-14 12:01:52 +0000 <Milan_Vanca> Maybe info in () shows last known state, and first number is total for whole program run.
2026-04-14 12:02:57 +0000uli-fem(~uli-fem@203.87.114.209)
2026-04-14 12:07:52 +0000uli-fem(~uli-fem@203.87.114.209) (Ping timeout: 276 seconds)
2026-04-14 12:12:20 +0000 <ski> > 49151 - (7336 + 855)
2026-04-14 12:12:21 +0000oskarw(~user@user/oskarw) (ERC 5.6.1 (IRC client for GNU Emacs 30.2))
2026-04-14 12:12:21 +0000 <lambdabot> 40960
2026-04-14 12:13:11 +0000 <Milan_Vanca> I have found this in ghc docs Any remaining sparks are discarded at the end of execution, so “converted” plus “pruned” does not necessarily add up to the total.