2025/01/08

Newest at the top

2025-01-08 06:57:52 +0100dtman34(~dtman34@2601:447:d080:1a3c:effe:71d9:1c5c:6a1a) (Ping timeout: 265 seconds)
2025-01-08 06:56:18 +0100peterbecich(~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 252 seconds)
2025-01-08 06:56:13 +0100 <haskellbridge> <yatta> maerwald: Maybe the jokes on us and his bouncer is performing exactly as planned?
2025-01-08 06:55:19 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) merijn
2025-01-08 06:50:22 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds)
2025-01-08 06:42:26 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) merijn
2025-01-08 06:39:34 +0100 <monochrom> If you want Nothing ??? pure foo = pure foo, consider using <|> instead: Nothing <|> pure foo. In other words, you are looking for { throw Exception; } catch Exception { return foo; }
2025-01-08 06:37:49 +0100 <monochrom> But if you prefer pragmatics to theory, every exception system, in every language, says that { throw Exception; return (div 5 2); } is going to throw that exception rather than return normally.
2025-01-08 06:36:40 +0100 <monochrom> Belated: Nothing >> pure foo = Nothing is pretty much forced by the monad laws. Several laws are involved, but the most damning one is k >>= pure = k, now let k be Nothing.
2025-01-08 06:31:39 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 245 seconds)
2025-01-08 06:27:03 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) merijn
2025-01-08 06:15:36 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds)
2025-01-08 06:12:17 +0100forell(~forell@user/forell) (Ping timeout: 248 seconds)
2025-01-08 06:09:00 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) merijn
2025-01-08 06:08:04 +0100 <jackdk> I like https://hackage.haskell.org/package/directory-tree for this sort of thing, unless you really need to handle large inputs (I haven't tested its lazy `readDirectoryWithL` function). Otherwise, yeah, streaming libraries would be the way to go. I tend to use package `streaming`.
2025-01-08 06:03:12 +0100eL_Bart0(eL_Bart0@dietunichtguten.org) (Ping timeout: 246 seconds)
2025-01-08 06:01:12 +0100 <hololeap> I'm ok with using conduit here
2025-01-08 06:00:36 +0100 <int-e> I'm not arguing against that, it's a separate question
2025-01-08 06:00:35 +0100 <c_wraith> that's kind of the whole point of it.
2025-01-08 05:59:48 +0100 <c_wraith> which actually won't construct the whole list in memory before moving to the next step
2025-01-08 05:59:36 +0100 <c_wraith> you have tools like https://hackage.haskell.org/package/conduit-1.3.6/docs/Data-Conduit-Combinators.html#v:sourceDirec…
2025-01-08 05:59:25 +0100 <c_wraith> I mean, conduit really is better.
2025-01-08 05:58:54 +0100Square2(~Square@user/square) (Ping timeout: 265 seconds)
2025-01-08 05:58:09 +0100 <int-e> oh it's \m -> lift m >>= fromList
2025-01-08 05:57:57 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds)
2025-01-08 05:57:00 +0100 <hololeap> this was the one use-case where ListT was actually the most elegant way to do it
2025-01-08 05:56:54 +0100Feuermagier(~Feuermagi@user/feuermagier) Feuermagier
2025-01-08 05:54:44 +0100 <lambdabot> LogicT . (. foldr) . (.) . (>>=)
2025-01-08 05:54:44 +0100 <int-e> @pl \x -> LogicT (\f c -> x >>= foldr f c)
2025-01-08 05:53:53 +0100 <c_wraith> conduit *is* overkill, but it's at least overkill designed for the job.
2025-01-08 05:53:30 +0100 <c_wraith> oh, I guess https://hackage.haskell.org/package/conduit-1.3.6/docs/Data-Conduit-Combinators.html is the better option
2025-01-08 05:53:22 +0100 <hololeap> but maybe you're right
2025-01-08 05:53:17 +0100 <hololeap> I felt like conduit would be overkill
2025-01-08 05:53:10 +0100 <c_wraith> like https://hackage.haskell.org/package/conduit-1.3.6/docs/Data-Conduit-List.html exists specifically to replace ListT
2025-01-08 05:52:42 +0100 <c_wraith> you really should be using conduit or something for that
2025-01-08 05:52:27 +0100 <hololeap> https://github.com/hololeap/cabal-portage/blob/main/portage-hs/test/Emerge/ParserTests.hs#L66-L76
2025-01-08 05:52:22 +0100 <hololeap> c_wraith: I have some old code that uses ListT, and I'm trying to replace it so that it builds on newer base (since they removed ListT)
2025-01-08 05:51:00 +0100 <c_wraith> LogicT really wants to break that apart
2025-01-08 05:50:43 +0100 <c_wraith> the issue is that m [a] is a *single* action that produces an entire list.
2025-01-08 05:50:39 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) merijn
2025-01-08 05:49:59 +0100Square2(~Square@user/square) Square
2025-01-08 05:49:50 +0100 <c_wraith> based on the type, it's not going to be as nice as you'd want
2025-01-08 05:49:38 +0100peterbecich(~Thunderbi@syn-047-229-123-186.res.spectrum.com) peterbecich
2025-01-08 05:49:35 +0100Square2(~Square@user/square) (Remote host closed the connection)
2025-01-08 05:49:31 +0100 <hololeap> blah :: IO [FilePath] -> LogicT IO FilePath
2025-01-08 05:49:01 +0100 <hololeap> d <- blah $ listDirectory dataDir
2025-01-08 05:48:39 +0100pavonia(~user@user/siracusa) (Quit: Bye!)
2025-01-08 05:47:56 +0100 <hololeap> err LogicT m a
2025-01-08 05:47:45 +0100 <hololeap> anyone know if there is a canonical way to "lift" m [a] to ListT m a
2025-01-08 05:42:57 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds)