2025/12/02

Newest at the top

2025-12-02 11:10:13 +0100Lycurgus(~juan@user/Lycurgus) (Quit: alsoknownas.renjuan.org ( juan@acm.org ))
2025-12-02 11:08:38 +0100comerijn(~merijn@77.242.116.146) merijn
2025-12-02 11:07:27 +0100 <kuribas> lambdabot: It's a type synonym ...
2025-12-02 11:06:25 +0100 <lambdabot> • imported from ‘Control.Monad.State’ at /home/lambda/.lambdabot/State/L.hs:65:1-26
2025-12-02 11:06:25 +0100 <lambdabot> • Illegal term-level use of the type constructor ‘State’
2025-12-02 11:06:25 +0100 <lambdabot> error: [GHC-01928]
2025-12-02 11:06:23 +0100 <kuribas> :t \f l -> concat $ flip runState 1 $ traverse (State . f) l
2025-12-02 11:03:42 +0100fp1(~Thunderbi@2001:708:20:1406::1370) (Ping timeout: 252 seconds)
2025-12-02 11:03:08 +0100 <lambdabot> Suggested fix: Perhaps use ‘List’ (imported from Control.Lens)
2025-12-02 11:03:08 +0100 <lambdabot> Data constructor not in scope: ListT
2025-12-02 11:03:08 +0100 <lambdabot> error: [GHC-88464]
2025-12-02 11:03:06 +0100 <kuribas> :t ListT
2025-12-02 10:59:26 +0100vgtw(~vgtw@user/vgtw) vgtw
2025-12-02 10:58:56 +0100 <kuribas> or easier : concat $ runState $ traverse (state $ \s -> [...]) l
2025-12-02 10:58:15 +0100vgtw(~vgtw@user/vgtw) (Ping timeout: 240 seconds)
2025-12-02 10:56:41 +0100 <kuribas> Maybe ListT done right: ListT (State s) a
2025-12-02 10:56:23 +0100 <kuribas> I can make a transformer, but "StateT [] s a" would not work, as it trows away state.
2025-12-02 10:55:43 +0100 <lambdabot> Traversable t => (s -> a -> (s, b)) -> s -> t a -> (s, t b)
2025-12-02 10:55:42 +0100 <kuribas> :t mapAccumL
2025-12-02 10:55:08 +0100kuribas(~user@ip-188-118-57-242.reverse.destiny.be) kuribas
2025-12-02 10:50:47 +0100Googulator22(~Googulato@2a01-036d-0106-4ad8-d9ec-010d-f188-ffcb.pool6.digikabel.hu) (Quit: Client closed)
2025-12-02 10:50:47 +0100Googulator26(~Googulato@2a01-036d-0106-4ad8-d9ec-010d-f188-ffcb.pool6.digikabel.hu)
2025-12-02 10:49:29 +0100vgtw(~vgtw@user/vgtw) vgtw
2025-12-02 10:39:14 +0100merijn(~merijn@77.242.116.146) merijn
2025-12-02 10:38:08 +0100merijn(~merijn@77.242.116.146) (Ping timeout: 240 seconds)
2025-12-02 10:36:49 +0100DetourNetworkUK(DetourNetw@user/DetourNetworkUK) DetourNetworkUK
2025-12-02 10:35:49 +0100DetourNetworkUK(DetourNetw@user/DetourNetworkUK) (Read error: Connection reset by peer)
2025-12-02 10:34:47 +0100 <sprout> Axman6: yah, that must be the same thing
2025-12-02 10:34:37 +0100 <Lycurgus> the type sig circle jerks being a prime epiphenomon of that
2025-12-02 10:34:22 +0100 <lucabtz> i ended up doing like this Rembane https://paste.tomsmeding.com/gp5xEGzv
2025-12-02 10:34:07 +0100 <dminuoso> chromoblob: Weechat.
2025-12-02 10:33:22 +0100 <Lycurgus> *quite practical
2025-12-02 10:33:11 +0100 <Lycurgus> hs is a wonderment in that it managed to become quite practically while going full on ivory tower dont give a damn if u think it's a ball breaker
2025-12-02 10:32:34 +0100kuribas(~user@2a02:1808:d1:d243:9821:bd8c:f208:7dc) (Ping timeout: 260 seconds)
2025-12-02 10:32:25 +0100 <lambdabot> Traversable t => (s -> a -> (s, b)) -> s -> t a -> (s, t b)
2025-12-02 10:32:23 +0100 <Axman6> :t mapAccumL
2025-12-02 10:32:20 +0100 <Axman6> that definitely sounds like mapAccumL to me ...
2025-12-02 10:32:09 +0100 <sprout> not everything has to be a monad
2025-12-02 10:32:02 +0100 <sprout> I just wrote a foldl_with_state in Egel
2025-12-02 10:29:10 +0100DetourNetworkUK(DetourNetw@user/DetourNetworkUK) DetourNetworkUK
2025-12-02 10:27:53 +0100 <kuribas> But she is doing clojure now.
2025-12-02 10:27:46 +0100 <kuribas> Funny, one of my colleages went to university in Glasgow, she never did haskell because it was to complicated...
2025-12-02 10:27:17 +0100 <Axman6> or mapAccumL/R
2025-12-02 10:26:54 +0100 <kuribas> Concretely, I want to generate some SQL query, but I need to generate aliases for tables, like alias1, alias2 (the state).
2025-12-02 10:26:10 +0100 <lambdabot> (b -> a -> b) -> b -> [a] -> [b]
2025-12-02 10:26:09 +0100 <Lycurgus> state u dont even think about hardly
2025-12-02 10:26:08 +0100 <kuribas> :t scanl
2025-12-02 10:25:55 +0100chele(~chele@user/chele) chele
2025-12-02 10:25:52 +0100 <kuribas> So I could: 1) use traverse on the list, using an inner state monad, then flatten. 2) make a list and state monad. 3) do an explicit tail recursive loop.
2025-12-02 10:25:39 +0100 <merijn> kuribas: That just sounds like scanl + flatten?