2026/01/02

Newest at the top

2026-01-02 22:02:58 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-01-02 22:02:46 +0100wennefer0(~wennefer0@user/wennefer0) (Client Quit)
2026-01-02 22:02:04 +0100wennefer0(~wennefer0@user/wennefer0) wennefer0
2026-01-02 21:58:13 +0100wennefer0(~wennefer0@user/wennefer0) (Client Quit)
2026-01-02 21:57:56 +0100kuribas(~user@2a02-1810-2825-6000-f2d4-59c7-29a4-df97.ip6.access.telenet.be) (Remote host closed the connection)
2026-01-02 21:56:47 +0100wennefer0(~wennefer0@user/wennefer0) wennefer0
2026-01-02 21:53:01 +0100 <yahb2> [1,2]
2026-01-02 21:53:01 +0100 <kuribas> % [y | x <- [Just 1, Nothing, Just 2], Just y <- [x]]
2026-01-02 21:52:23 +0100 <kuribas> Shouldn't it partial match on Just?
2026-01-02 21:51:43 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds)
2026-01-02 21:51:16 +0100 <yahb2> *** Exception: <interactive>:143:42-51: Non-exhaustive patterns in Just y ; ; ; HasCallStack backtrace: ; collectBacktraces, called at libraries/ghc-internal/src/GHC/Internal/Exception.hs:169:1...
2026-01-02 21:51:15 +0100 <monochrom> % [y | x <- [Just 1, Nothing, Just 2], let Just y = x]
2026-01-02 21:51:09 +0100 <yahb2> 2
2026-01-02 21:51:09 +0100 <monochrom> % 1+1
2026-01-02 21:51:02 +0100 <monochrom> Oh lambdabot is away
2026-01-02 21:50:59 +0100califax(~califax@user/califx) califx
2026-01-02 21:50:37 +0100 <kuribas> > [y | x <- [Just 1, Nothing, Just 2], let Just y = x]
2026-01-02 21:50:01 +0100califax(~califax@user/califx) (Remote host closed the connection)
2026-01-02 21:49:44 +0100kuribas(~user@2a02-1810-2825-6000-f2d4-59c7-29a4-df97.ip6.access.telenet.be) kuribas
2026-01-02 21:48:05 +0100wennefer0(~wennefer0@user/wennefer0) (Client Quit)
2026-01-02 21:47:11 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-01-02 21:46:51 +0100wennefer0(~wennefer0@user/wennefer0) wennefer0
2026-01-02 21:43:30 +0100wennefer0(~wennefer0@user/wennefer0) (Client Quit)
2026-01-02 21:41:47 +0100wennefer0(~wennefer0@user/wennefer0) wennefer0
2026-01-02 21:36:13 +0100wennefer0(~wennefer0@user/wennefer0) (Client Quit)
2026-01-02 21:35:35 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds)
2026-01-02 21:34:54 +0100wennefer0(~wennefer0@user/wennefer0) wennefer0
2026-01-02 21:29:55 +0100 <Milan_Vanca> I didn't expect that! This is really cool.
2026-01-02 21:29:26 +0100 <monochrom> Then yes the prefix can be freed.
2026-01-02 21:29:08 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-01-02 21:28:58 +0100 <Milan_Vanca> Imagine I would split this big list at 10^6 index and then only used everithing after. Could from start to split be garbage collected if it is not used in other functions?
2026-01-02 21:28:15 +0100L29Ah(~L29Ah@wikipedia/L29Ah) L29Ah
2026-01-02 21:27:51 +0100 <Milan_Vanca> So by introducing new function I can enforce what is shared.
2026-01-02 21:26:25 +0100 <monochrom> If you want something reused but don't want to bet, "let x = l !! bignumber in x + x" is the way. (Or "where".)
2026-01-02 21:25:41 +0100L29Ah(~L29Ah@wikipedia/L29Ah) ()
2026-01-02 21:24:29 +0100 <monochrom> So you lose both memory and time. Congratulations.
2026-01-02 21:24:17 +0100 <monochrom> If "l !! bignumber" is not shared but l is, then what happens is the worst of both worlds. First time, l is expanded and occupies 10^6 units of memory, and since it is to be shared, it won't be freed. Second time, you traverse that existing allocated memory from start to finish again.
2026-01-02 21:24:06 +0100mmohammadi9812(~mohammad@104.28.214.168) mmohammadi9812
2026-01-02 21:22:14 +0100 <monochrom> The common subexpression "l !! bignumber" is unlikely to be shared. This is at the whim of the code optimizer, but I bet unlikely. (But you should check empirically.)
2026-01-02 21:21:09 +0100 <monochrom> l is shared. That actually is worse news than you think.
2026-01-02 21:20:45 +0100 <monochrom> This is more nuisanced than one single boolean "is/not shared". (But you just need a multitude of booleans.)
2026-01-02 21:18:07 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds)
2026-01-02 21:17:03 +0100epitron(epi@user/epitron) epitron
2026-01-02 21:16:59 +0100wennefer0(~wennefer0@user/wennefer0) (Client Quit)
2026-01-02 21:16:16 +0100wennefer0(~wennefer0@user/wennefer0) wennefer0
2026-01-02 21:14:17 +0100 <Milan_Vanca> hmm
2026-01-02 21:13:21 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-01-02 21:10:00 +0100pavonia(~user@user/siracusa) siracusa
2026-01-02 21:09:22 +0100 <ncf> well you could extract the indices you need in one run
2026-01-02 21:07:39 +0100 <Milan_Vanca> If you look at page 5 of this document https://www.rfc-editor.org/rfc/rfc1321 There T[i] is value from list. I probably can't use `map` as function is always different. Or maybe I could zip it with index and then have case of to use correct function.