2024/10/18

Newest at the top

2024-10-18 18:26:06 +0200 <haskellbridge> <maralorn> ncf: Yes.
2024-10-18 18:23:53 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2024-10-18 18:22:38 +0200 <c_wraith> a common pattern with iterate is to use it on (state, value) tuples then map snd to get rid of the states
2024-10-18 18:22:15 +0200 <EvanR> if so, haskell at its finest
2024-10-18 18:21:41 +0200 <EvanR> you could just map the sequence of states?
2024-10-18 18:21:29 +0200billchenchina-(~billchenc@2a0d:2580:ff0c:1:e3c9:c52b:a429:5bfe) (Remote host closed the connection)
2024-10-18 18:21:27 +0200 <EvanR> quite possible
2024-10-18 18:21:24 +0200 <c_wraith> or do you want a separate state value that's passed along?
2024-10-18 18:21:12 +0200 <lambdabot> (a -> a) -> a -> [a]
2024-10-18 18:21:11 +0200 <EvanR> :t iterate
2024-10-18 18:20:59 +0200 <c_wraith> EvanR: is that not just... iterate?
2024-10-18 18:20:30 +0200 <c_wraith> err, lens's
2024-10-18 18:20:22 +0200 <c_wraith> I'd honestly just use lenses's filtered combinator unless it doesn't work for some reason
2024-10-18 18:20:14 +0200ncfis confused about the problem
2024-10-18 18:19:44 +0200 <ncf> wait, so you need to put the filtered list back in?
2024-10-18 18:19:02 +0200 <EvanR> is there a version of unfoldr which keeps unfolding forever and doesn't need to deal with Maybe
2024-10-18 18:18:54 +0200 <haskellbridge> <maralorn> Lears: I like the traverseMaybe idea, thank you.
2024-10-18 18:18:35 +0200EvanR(~EvanR@user/evanr) EvanR
2024-10-18 18:18:25 +0200 <haskellbridge> <maralorn> c_wraith: Yeah, I know. But in the large team we have I’d rather be careful with that.
2024-10-18 18:17:23 +0200 <c_wraith> There's a reason filtered is not a Fold
2024-10-18 18:16:45 +0200chele(~chele@user/chele) (Remote host closed the connection)
2024-10-18 18:16:33 +0200 <c_wraith> The still *work*, they just can't be blindly refactored.
2024-10-18 18:16:14 +0200 <c_wraith> You won't get prosecuted for using unlawful optics
2024-10-18 18:16:09 +0200LukeHoersten(~LukeHoers@user/lukehoersten) LukeHoersten
2024-10-18 18:15:09 +0200 <Lears> I don't know about lenses, but you can write a `traverseMaybe :: Applicative f => (X -> f (Maybe X)) -> Y -> f Y` to fuse these operations.
2024-10-18 18:14:23 +0200LukeHoersten(~LukeHoers@user/lukehoersten) (Client Quit)
2024-10-18 18:13:36 +0200merijn(~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 276 seconds)
2024-10-18 18:11:51 +0200Square(~Square@user/square) Square
2024-10-18 18:10:11 +0200 <haskellbridge> <maralorn> Well, the problem is that Y is a really big datatype and the Xs are everywhere and I don’t want to repeat locating them 3 times.
2024-10-18 18:09:40 +0200LukeHoersten(~LukeHoers@user/lukehoersten) LukeHoersten
2024-10-18 18:07:59 +0200 <ncf> use an optic for step 1 and then regular haskell for steps 2 and 3?
2024-10-18 18:06:07 +0200merijn(~merijn@128-137-045-062.dynamic.caiway.nl) merijn
2024-10-18 18:05:36 +0200 <haskellbridge> <maralorn> Lens wizards, please help, I am confused. I have a multiple X in Y, and I want to do three things on all the X, 1. get, 2. map, 3. filter. I can’t write a lawful traversal because filtering reduces the number of Xs. But a Fold is not enough because it can’t be used for mutation. Is there a reasonable optic to do this?
2024-10-18 18:04:44 +0200alexherbo2(~alexherbo@2a02-8440-3207-4943-39e2-af68-9f9c-c108.rev.sfr.net) alexherbo2
2024-10-18 18:03:27 +0200billchenchina-(~billchenc@2a0d:2580:ff0c:1:e3c9:c52b:a429:5bfe) billchenchina
2024-10-18 17:55:32 +0200 <glguy> dmj`: yes, it is practical
2024-10-18 17:55:29 +0200merijn(~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 255 seconds)
2024-10-18 17:55:20 +0200euphores(~SASL_euph@user/euphores) euphores
2024-10-18 17:53:25 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2024-10-18 17:50:45 +0200merijn(~merijn@128-137-045-062.dynamic.caiway.nl) merijn
2024-10-18 17:48:46 +0200Tuplanolla(~Tuplanoll@91-159-69-59.elisa-laajakaista.fi) Tuplanolla
2024-10-18 17:46:45 +0200euphores(~SASL_euph@user/euphores) (Quit: Leaving.)
2024-10-18 17:45:58 +0200kuribas(~user@ip-188-118-57-242.reverse.destiny.be) (Remote host closed the connection)
2024-10-18 17:40:00 +0200merijn(~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds)
2024-10-18 17:35:21 +0200merijn(~merijn@128-137-045-062.dynamic.caiway.nl) merijn
2024-10-18 17:34:46 +0200rosco(~rosco@175.136.23.238) (Quit: Lost terminal)
2024-10-18 17:25:14 +0200alexherbo2(~alexherbo@2a02-8440-3207-4943-39e2-af68-9f9c-c108.rev.sfr.net) (Remote host closed the connection)
2024-10-18 17:24:24 +0200merijn(~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds)
2024-10-18 17:23:51 +0200mari-estel(~mari-este@user/mari-estel) (Remote host closed the connection)
2024-10-18 17:23:39 +0200lortabac(~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4) (Ping timeout: 260 seconds)