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)