Home liberachat/#haskell: Logs Calendar

Logs on 2025-01-08 (liberachat/#haskell)

00:02:28 × merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 245 seconds)
00:05:24 × dsrt^ quits (~dsrt@c-98-242-74-66.hsd1.ga.comcast.net) (Ping timeout: 252 seconds)
00:11:44 × connrs quits (~connrs@user/connrs) (Read error: Connection reset by peer)
00:14:32 dsrt^ joins (dsrt@c-98-242-74-66.hsd1.ga.comcast.net)
00:15:41 merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl)
00:16:47 × kaskal quits (~kaskal@84-115-237-124.cable.dynamic.surfer.at) (Quit: ZNC - https://znc.in)
00:17:19 kaskal joins (~kaskal@84-115-237-124.cable.dynamic.surfer.at)
00:21:28 × merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds)
00:24:11 connrs joins (~connrs@user/connrs)
00:24:23 × whatsupdoc_ quits (uid509081@id-509081.hampstead.irccloud.com) (Quit: Connection closed for inactivity)
00:24:32 × JuanDaugherty quits (~juan@user/JuanDaugherty) (Quit: JuanDaugherty)
00:24:49 × xff0x_ quits (~xff0x@2405:6580:b080:900:7a35:e66e:66c0:36ee) (Ping timeout: 260 seconds)
00:31:55 <danso> i'm confused about why this line defines a function which returns Nothing for all inputs
00:32:01 <danso> safediv :: Int -> Int -> Maybe Int; safediv x y = Nothing >> pure (x `div` y)
00:32:05 merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl)
00:32:52 <danso> i expected (>>) to discard the nothing and return pure (div x y) for all inputs (sometimes failing)
00:33:53 × ljdarj quits (~Thunderbi@user/ljdarj) (Ping timeout: 248 seconds)
00:36:33 × merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds)
00:38:10 <orangeFlu> You are basically making a chain of monads, piping the result from one to the other. if any of those Maybe's is Nothing, the whole thing is Nothing. It's just how this monad works
00:41:13 <ncf> if you think of Maybe as an exception/failure monad, then your program is do fail; pure ...
00:41:23 <ncf> this fails instead of returning anything, as in every language
00:41:48 <ncf> in other words >> discards values, not effects
00:42:45 <orangeFlu> If you know >>=, then >> is like it except it discards the result of the computation, like ncf said, it doesn't 'bind' it to anything
00:45:21 × ft quits (~ft@p4fc2a354.dip0.t-ipconnect.de) (Remote host closed the connection)
00:45:25 notzmv joins (~umar@user/notzmv)
00:45:55 <EvanR> what did you want Nothing >> something to do
00:46:10 <EvanR> if it was like 0 + something... it would have no effect
00:46:34 <EvanR> though it's acting more like 0 * something = 0
00:47:28 merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl)
00:49:16 ft joins (~ft@p4fc2a354.dip0.t-ipconnect.de)
00:55:16 × merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds)
00:57:21 × prasad quits (~Thunderbi@c-73-75-25-251.hsd1.in.comcast.net) (Ping timeout: 248 seconds)
01:07:08 merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl)
01:08:48 prasad joins (~Thunderbi@c-73-75-25-251.hsd1.in.comcast.net)
01:12:21 × merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 276 seconds)
01:12:46 xff0x joins (~xff0x@fsb6a9491c.tkyc517.ap.nuro.jp)
01:22:30 merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl)
01:22:56 × Tuplanolla quits (~Tuplanoll@91-159-69-59.elisa-laajakaista.fi) (Quit: Leaving.)
01:26:54 × merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds)
01:32:26 × doyougnu quits (~doyougnu@syn-045-046-170-068.res.spectrum.com) (Quit: ZNC 1.8.2 - https://znc.in)
01:32:53 × lbseale quits (~quassel@user/ep1ctetus) (Quit: No Ping reply in 180 seconds.)
01:33:00 saulosilva joins (~saulosilv@181.216.220.21)
01:34:18 lbseale joins (~quassel@user/ep1ctetus)
01:34:43 doyougnu joins (~doyougnu@syn-045-046-170-068.res.spectrum.com)
01:35:00 <sim590> I'm presently looking at how to make Haskell bindings for a C++ library. I'm reading https://wiki.haskell.org/Cxx_foreign_function_interface and I see that there are many approaches. From the history of the page, fficxx seems to have been brought up most recently. It doesn't mean it's best. I'm looking for an opinion as to what to look at first.
01:37:53 merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl)
01:40:15 × otto_s quits (~user@p5de2f2cf.dip0.t-ipconnect.de) (Ping timeout: 265 seconds)
01:41:53 otto_s joins (~user@p4ff2701d.dip0.t-ipconnect.de)
01:42:35 × merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 260 seconds)
01:48:36 Jeanne-Kamikaze joins (~Jeanne-Ka@79.127.217.40)
01:53:15 merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl)
01:54:30 Too2manyQ5 joins (~Too2manyQ@mwg-w15.infosec.fedex.com)
01:57:41 × merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds)
02:02:43 × xdminsy quits (~xdminsy@117.147.71.200) (Read error: Connection reset by peer)
02:03:46 xdminsy joins (~xdminsy@117.147.71.200)
02:04:23 <sim590> I guess that the page hints on the approach of making C++ look like C. They say "This seems to be the standard technique for bridging the gap between Haskell and C++.". I guess, I will look into that first.
02:06:10 × m1dnight_ quits (~m1dnight@d8D861908.access.telenet.be) (Read error: Connection reset by peer)
02:08:38 merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl)
02:11:50 × saulosilva quits (~saulosilv@181.216.220.21) (Quit: Client closed)
02:12:06 m1dnight_ joins (~m1dnight@d8D861908.access.telenet.be)
02:13:36 × merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds)
02:21:52 Smiles joins (uid551636@id-551636.lymington.irccloud.com)
02:24:00 merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl)
02:30:45 × merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds)
02:37:41 × Too2manyQ5 quits (~Too2manyQ@mwg-w15.infosec.fedex.com) (Quit: Client closed)
02:38:40 OftenFaded48 joins (~OftenFade@user/tisktisk)
02:42:02 merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl)
02:45:36 weary-traveler joins (~user@user/user363627)
02:46:22 × merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds)
02:49:43 merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl)
02:55:17 × merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds)
02:57:52 × OftenFaded48 quits (~OftenFade@user/tisktisk) (Quit: Client closed)
03:06:07 merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl)
03:07:07 JuanDaugherty joins (~juan@user/JuanDaugherty)
03:10:52 × merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds)
03:15:03 × Square quits (~Square@user/square) (Ping timeout: 246 seconds)
03:15:15 × machinedgod quits (~machinedg@d108-173-18-100.abhsia.telus.net) (Ping timeout: 252 seconds)
03:19:45 × prasad quits (~Thunderbi@c-73-75-25-251.hsd1.in.comcast.net) (Ping timeout: 276 seconds)
03:21:30 merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl)
03:23:41 <haskellbridge> <maerwald> When will merijn fix his bouncer?
03:25:49 × merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds)
03:35:36 Square joins (~Square@user/square)
03:36:54 merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl)
03:41:18 × merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 246 seconds)
03:47:57 × Square quits (~Square@user/square) (Ping timeout: 246 seconds)
03:49:29 × Jeanne-Kamikaze quits (~Jeanne-Ka@79.127.217.40) (Quit: Leaving)
03:52:17 merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl)
03:55:14 caconym3 joins (~caconym@user/caconym)
03:56:33 × merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds)
03:57:05 × caconym quits (~caconym@user/caconym) (Ping timeout: 248 seconds)
03:57:06 caconym3 is now known as caconym
04:00:36 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
04:00:59 huhu joins (~huhu@2605:52c0:2:4de:f040:60ff:fe3f:6e4a)
04:02:36 lianhuayu joins (~lianhuayu@2605:52c0:2:4de:f040:60ff:fe3f:6e4a)
04:04:43 × huhu quits (~huhu@2605:52c0:2:4de:f040:60ff:fe3f:6e4a) (Client Quit)
04:04:48 × lianhuayu quits (~lianhuayu@2605:52c0:2:4de:f040:60ff:fe3f:6e4a) (Client Quit)
04:07:40 merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl)
04:08:03 aforemny joins (~aforemny@i59F4C56A.versanet.de)
04:08:53 × aforemny_ quits (~aforemny@2001:9e8:6cc4:4700:8cff:3cd6:574c:3859) (Ping timeout: 248 seconds)
04:12:34 × merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 272 seconds)
04:14:00 × nkatte quits (~nkatte@user/nkatte) (Quit: nkatte)
04:17:49 × notzmv quits (~umar@user/notzmv) (Ping timeout: 265 seconds)
04:23:12 merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl)
04:24:19 × caconym quits (~caconym@user/caconym) (Quit: bye)
04:24:44 caconym3 joins (~caconym@user/caconym)
04:25:21 caconym3 is now known as caconym
04:26:08 Square joins (~Square4@user/square)
04:27:02 × Square quits (~Square4@user/square) (Quit: Leaving)
04:27:52 Square joins (~Square4@user/square)
04:27:58 × merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds)
04:32:12 Square2 joins (~Square@user/square)
04:36:29 × JuanDaugherty quits (~juan@user/JuanDaugherty) (Quit: JuanDaugherty)
04:38:34 merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl)
04:41:00 × Smiles quits (uid551636@id-551636.lymington.irccloud.com) (Quit: Connection closed for inactivity)
04:42:57 × merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds)
04:47:45 <hololeap> anyone know if there is a canonical way to "lift" m [a] to ListT m a
04:47:56 <hololeap> err LogicT m a
04:48:39 × pavonia quits (~user@user/siracusa) (Quit: Bye!)
04:49:01 <hololeap> d <- blah $ listDirectory dataDir
04:49:31 <hololeap> blah :: IO [FilePath] -> LogicT IO FilePath
04:49:35 × Square2 quits (~Square@user/square) (Remote host closed the connection)
04:49:38 peterbecich joins (~Thunderbi@syn-047-229-123-186.res.spectrum.com)
04:49:50 <c_wraith> based on the type, it's not going to be as nice as you'd want
04:49:59 Square2 joins (~Square@user/square)
04:50:39 merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl)
04:50:43 <c_wraith> the issue is that m [a] is a *single* action that produces an entire list.
04:51:00 <c_wraith> LogicT really wants to break that apart
04:52:22 <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)
04:52:27 <hololeap> https://github.com/hololeap/cabal-portage/blob/main/portage-hs/test/Emerge/ParserTests.hs#L66-L76
04:52:42 <c_wraith> you really should be using conduit or something for that
04:53:10 <c_wraith> like https://hackage.haskell.org/package/conduit-1.3.6/docs/Data-Conduit-List.html exists specifically to replace ListT
04:53:17 <hololeap> I felt like conduit would be overkill
04:53:22 <hololeap> but maybe you're right
04:53:30 <c_wraith> oh, I guess https://hackage.haskell.org/package/conduit-1.3.6/docs/Data-Conduit-Combinators.html is the better option
04:53:53 <c_wraith> conduit *is* overkill, but it's at least overkill designed for the job.
04:54:44 <int-e> @pl \x -> LogicT (\f c -> x >>= foldr f c)
04:54:44 <lambdabot> LogicT . (. foldr) . (.) . (>>=)
04:56:54 Feuermagier joins (~Feuermagi@user/feuermagier)
04:57:00 <hololeap> this was the one use-case where ListT was actually the most elegant way to do it
04:57:57 × merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds)
04:58:09 <int-e> oh it's \m -> lift m >>= fromList
04:58:54 × Square2 quits (~Square@user/square) (Ping timeout: 265 seconds)
04:59:25 <c_wraith> I mean, conduit really is better.
04:59:36 <c_wraith> you have tools like https://hackage.haskell.org/package/conduit-1.3.6/docs/Data-Conduit-Combinators.html#v:sourceDirectory
04:59:48 <c_wraith> which actually won't construct the whole list in memory before moving to the next step
05:00:35 <c_wraith> that's kind of the whole point of it.
05:00:36 <int-e> I'm not arguing against that, it's a separate question
05:01:12 <hololeap> I'm ok with using conduit here
05:03:12 × eL_Bart0 quits (eL_Bart0@dietunichtguten.org) (Ping timeout: 246 seconds)
05:08:04 <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`.
05:09:00 merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl)
05:12:17 × forell quits (~forell@user/forell) (Ping timeout: 248 seconds)
05:15:36 × merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds)
05:27:03 merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl)
05:31:39 × merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 245 seconds)
05:36:40 <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.
05:37:49 <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.
05:39:34 <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; }
05:42:26 merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl)
05:50:22 × merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds)
05:55:19 merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl)
05:56:13 <haskellbridge> <yatta> maerwald: Maybe the jokes on us and his bouncer is performing exactly as planned?
05:56:18 × peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 252 seconds)
05:57:52 × dtman34 quits (~dtman34@2601:447:d080:1a3c:effe:71d9:1c5c:6a1a) (Ping timeout: 265 seconds)
05:59:58 × merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds)
06:00:22 michalz joins (~michalz@185.246.207.221)
06:10:28 peterbecich joins (~Thunderbi@syn-047-229-123-186.res.spectrum.com)
06:10:50 sord937 joins (~sord937@gateway/tor-sasl/sord937)
06:11:18 merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl)
06:11:42 × Eoco quits (~ian@128.101.131.218) (Ping timeout: 252 seconds)
06:12:44 Eoco joins (~ian@128.101.131.218)
06:15:48 × merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds)
06:15:59 × hgolden quits (~hgolden@2603:8000:9d00:3ed1:6ff3:8389:b901:6363) (Ping timeout: 260 seconds)
06:16:42 hgolden joins (~hgolden@2603:8000:9d00:3ed1:6ff3:8389:b901:6363)
06:17:52 dtman34 joins (~dtman34@2601:447:d080:1a3c:6104:fe1a:e15b:6312)
06:18:09 takuan joins (~takuan@178-116-218-225.access.telenet.be)
06:22:01 <hololeap> this looks a lot cleaner with conduit: https://github.com/hololeap/cabal-portage/blob/c85bc09e23514d816b6d1936b7ebbacb058fe58a/portage-hs/test/Emerge/ParserTests.hs#L61-L75
06:22:35 <hololeap> my only question is if Data.Text.IO.readFile makes sense here
06:23:44 <haskellbridge> <maerwald> jackdk: Uh... directory-tree uses lazy IO. That's not the same as a proper streaming library. It just blows up randomly in your face.
06:24:02 <hololeap> I tried using (\f -> sourceFile f .| decodeUtf8Lenient .| mapC (f,)), but for some reason it only read part of the file when I tested it
06:26:40 × peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 260 seconds)
06:26:41 merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl)
06:27:56 rvalue- joins (~rvalue@user/rvalue)
06:28:43 × rvalue quits (~rvalue@user/rvalue) (Ping timeout: 244 seconds)
06:31:17 × merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds)
06:32:32 rvalue- is now known as rvalue
06:42:05 merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl)
06:46:28 × merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds)
06:52:41 merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl)
06:54:46 acidjnk_new joins (~acidjnk@p200300d6e7283f6814cd06cb5011f3d5.dip0.t-ipconnect.de)
06:55:35 × hughjfchen quits (~hughjfche@vmi556545.contaboserver.net) (Quit: WeeChat 4.2.2)
06:56:05 hughjfchen joins (~hughjfche@vmi556545.contaboserver.net)
06:57:41 Square2 joins (~Square@user/square)
06:59:15 × famubu quits (~julinuser@user/famubu) (Ping timeout: 265 seconds)
06:59:24 × merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 246 seconds)
07:01:37 × hughjfchen quits (~hughjfche@vmi556545.contaboserver.net) (Quit: WeeChat 4.2.2)
07:02:09 × Square quits (~Square4@user/square) (Ping timeout: 265 seconds)
07:04:33 hughjfchen joins (~hughjfche@vmi556545.contaboserver.net)
07:06:26 CiaoSen joins (~Jura@2a05:5800:213:8800:ca4b:d6ff:fec1:99da)
07:09:13 <jackdk> maerwald: True, but for simple directory-walking things I don't mind it as a way to get started, and then replace it once I've written a program that I've liked and used enough to have it blow up in my face.
07:09:51 <haskellbridge> <maerwald> I'd be surprised if you go back and actually replace it
07:09:57 <haskellbridge> <maerwald> most people never replace their prototypes
07:11:29 merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl)
07:15:49 × merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 245 seconds)
07:23:19 × agent314 quits (~quassel@138.199.43.74) (Read error: Connection reset by peer)
07:26:51 merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl)
07:29:28 <jackdk> And to be fair, I didn't either. But I never had the lazy i/o blow up in my face, which was the forcing function to replace it with a proper streaming abstraction
07:30:53 × lbseale quits (~quassel@user/ep1ctetus) (Ping timeout: 252 seconds)
07:32:47 × merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds)
07:32:49 Guest5708 joins (~guest5708@117.222.137.69)
07:42:53 mchav joins (~mchav@197.221.255.246)
07:43:49 merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl)
07:46:08 × Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer)
07:47:40 × mchav quits (~mchav@197.221.255.246) (Ping timeout: 240 seconds)
07:48:05 × merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds)
07:53:42 merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl)
07:58:12 × merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 246 seconds)
08:00:00 × caconym quits (~caconym@user/caconym) (Quit: bye)
08:00:40 caconym joins (~caconym@user/caconym)
08:06:55 × Square2 quits (~Square@user/square) (Ping timeout: 265 seconds)
08:08:17 alist joins (~alist@108-224-153-186.lightspeed.cicril.sbcglobal.net)
08:08:56 alist parts (~alist@108-224-153-186.lightspeed.cicril.sbcglobal.net) ()
08:09:01 alist joins (~alist@108-224-153-186.lightspeed.cicril.sbcglobal.net)
08:09:14 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
08:09:38 <alist> hi all, im looking for help understanding the paper theorema for free
08:10:10 <alist> is this the right channel? haskell-in-depth seems to have very few people comparatively
08:11:01 × weary-traveler quits (~user@user/user363627) (Quit: Konversation terminated!)
08:11:29 <mauke> potentially yes, but personally I'm not familiar with the paper (beyond the title)
08:12:15 <alist> ok, to be fair its a pretty specific question so no worries if you cant help
08:13:50 <alist> basically, on the top of page 6 the author expands the forall quantifier for relations by specializing the fold function for the types A and B.
08:14:55 <alist> but the definition of fold in that example is defined as (a->b->b)->a etc., where a, b are functions from A->A', B->B'
08:16:41 <alist> the previous page defines forall expansion and i think accordingly fold should be specialized to a, b (lowercase) in this instance my question
08:17:09 <alist> *my question is what am i missing, or did the author make a mistake
08:17:27 × CiaoSen quits (~Jura@2a05:5800:213:8800:ca4b:d6ff:fec1:99da) (Ping timeout: 276 seconds)
08:20:20 <mauke> I don't know, but I'm reading the paper and I already found a bug on page 1
08:21:06 <alist> where? i thought i found a bug earlier than 6 too
08:23:09 <mauke> the inc*/odds ≠ odds/inc* example shows incoherent intermediate results
08:23:32 <mauke> it's true that the results are not the same, but I don't see how they can be [2,4] and [4], respectively
08:24:46 <mauke> it's either [2,4] and [3], or [3] and [2,4], depending on how odds is defined
08:24:55 <mauke> but I have no idea how you can get [4]
08:25:57 <alist> youre right, that makes no sense
08:26:51 <alist> by saying odds "removes all odd elements from a list of integers" id argue it has to be [3], right
08:28:26 <alist> i thought this paper was very popular. maybe im sounding mean but is this like a preprint or something that is circulating online? ive never read a paper with such obvious typos
08:34:04 <mauke> I'm looking at https://www2.cs.sfu.ca/CourseCentral/831/burton/Notes/July14/free.pdf, which is a "revised version"
08:38:15 <alist> i have the same problem with its version of page 6
08:40:01 <alist> i am disappointed because im reading a book on haskell and was interested in the fact that there is only one functiom of typs a -> a. someone recommended me this paper
08:40:12 <ncf> alist: what's wrong with page 6?
08:40:34 <ncf> the specialisation looks correct to me
08:40:42 <alist> oh i see
08:40:57 mari-estel joins (~mari-este@user/mari-estel)
08:41:41 <alist> i think the specialization should be fold_{ab} since on the previous page, expanding the forall quantifier requires specializing on the type(s) it depends on
08:42:19 <ncf> what
08:43:31 <ncf> (fold, fold) : ∀ X. ∀ Y. (X → Y → Y) → Y → X* → Y
08:43:32 merijn joins (~merijn@77.242.116.146)
08:43:54 <ncf> (fold_A, fold_A') : ∀ Y. (a → Y → Y) → Y → a* → Y
08:44:09 <ncf> (fold_AB, fold_A'B') : (a → b → b) → b → a* → b
08:44:48 <ncf> i don't see how fold_ab would be defined in the notation of the paper
08:48:28 <alist> well for one, immediately prior the author writes fold_AB is specialized to functions
08:48:52 <alist> neither A nor B are types of functions, right?
08:49:06 <ncf> no, a and b are functions
08:49:52 <alist> rigfold_AB is the specialization of fold to the types
08:50:14 <ncf> instead of relations 𝒜 : A ⇔ A', ℬ : B ⇔ B' we use functions a : A → A', b : B → B'
08:50:27 <alist> oh hm
08:50:29 <ncf> i.e. functional relations
08:51:09 <alist> OH i see
08:51:16 <alist> because functions are relations hehe
08:51:37 <mari-estel> hm sortof
08:51:49 <alist> well they correspond directly
08:52:02 <mari-estel> functions are unidirectional
08:52:32 <mauke> unidirectional relations are valid. we don't discriminate
08:53:05 <alist> well really in the authors definition of relation as just a subset of the cross product they are
08:53:10 <mari-estel> well then yes, functions are relations, but relations are not functions
08:53:26 <alist> so either way i understand what hes writing better
08:53:47 <ncf> a white horse is a horse
08:54:39 Guest5708 parts (~guest5708@117.222.137.69) (Leaving)
08:54:57 <alist> ncf: thanks for the help!!
08:56:30 machinedgod joins (~machinedg@d108-173-18-100.abhsia.telus.net)
09:00:26 × alist quits (~alist@108-224-153-186.lightspeed.cicril.sbcglobal.net) (Remote host closed the connection)
09:01:00 <monochrom> Sometimes you really want to use a non-function relation, e.g., when proving that e :: forall a. Maybe (a->a) can only be Nothing or Just id.
09:02:00 <monochrom> Err, that one still works with a function relation.
09:03:02 lortabac joins (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4)
09:03:59 <monochrom> But if you replace Maybe by the System F encoding, i.e., prove that e :: forall a. forall b. b -> ((a -> a) -> b) -> b has only two possibilities, that will require you to use a non-function relation for b.
09:05:14 <monochrom> But the paper doesn't contain such advanced examples. All examples are basically natural transformations like "oh rev is a natural transformation". Those don't need arbitrary relations, just functions.
09:10:34 alist joins (~alist@108-224-153-186.lightspeed.cicril.sbcglobal.net)
09:18:11 l__k joins (~student@85.172.111.143)
09:18:14 × l_k quits (~student@85.172.76.134) (Read error: Connection reset by peer)
09:22:49 Smiles joins (uid551636@id-551636.lymington.irccloud.com)
09:28:00 <monochrom> @free fold :: (x -> y -> y) -> y -> [x] -> y
09:28:00 <lambdabot> (forall x. g . h x = k (f x) . g) => g . fold h y = fold k (g y) . $map f
09:31:56 lxsameer joins (~lxsameer@Serene/lxsameer)
09:33:28 eL_Bart0 joins (eL_Bart0@dietunichtguten.org)
09:34:56 ash3en joins (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207)
09:36:44 × tzh quits (~tzh@c-76-115-131-146.hsd1.or.comcast.net) (Quit: zzz)
09:36:48 mari-estel is now known as m_
09:37:16 m_ is now known as mari-estel
09:37:49 × merijn quits (~merijn@77.242.116.146) (Ping timeout: 244 seconds)
09:41:21 jespada joins (~jespada@2800:a4:f9:a300:c8c1:20a5:1a94:f1)
09:43:31 <ncf> monochrom: what relation do you use for b? i'd think a function Bool → b is enough
09:44:08 × p3n quits (~p3n@2a00:19a0:3:7c:0:d9c6:7cf6:1) (Quit: ZNC 1.8.2 - https://znc.in)
09:44:41 p3n joins (~p3n@217.198.124.246)
09:44:47 × mud quits (~mud@user/kadoban) (Remote host closed the connection)
09:45:12 mud joins (~mud@user/kadoban)
09:46:01 Guest17 joins (~Guest17@91.243.81.204)
09:46:58 × ash3en quits (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) (Ping timeout: 265 seconds)
09:51:14 merijn joins (~merijn@77.242.116.146)
09:55:22 CiaoSen joins (~Jura@2a05:5800:213:8800:ca4b:d6ff:fec1:99da)
09:55:43 forell joins (~forell@user/forell)
09:57:56 × merijn quits (~merijn@77.242.116.146) (Ping timeout: 252 seconds)
09:58:36 × xff0x quits (~xff0x@fsb6a9491c.tkyc517.ap.nuro.jp) (Ping timeout: 246 seconds)
10:01:01 merijn joins (~merijn@77.242.116.146)
10:04:23 × tomsmeding quits (~tomsmedin@2a01:4f8:c0c:5e5e::2) (Quit: ZNC 1.9.1 - https://znc.in)
10:06:06 tomsmeding joins (~tomsmedin@2a01:4f8:c0c:5e5e::2)
10:07:16 <haskellbridge> <magic_rb> is there no way to directly read from a Unboxed Mutable Vector using Int# as the index and read the undoxed type directly? https://hackage.haskell.org/package/vector-0.13.2.0/docs/Data-Vector-Unboxed-Mutable.html i dont see anything in the module
10:13:34 × tnt1 quits (~Thunderbi@user/tnt1) (Ping timeout: 272 seconds)
10:13:37 tnt2 joins (~Thunderbi@user/tnt1)
10:15:55 tnt2 is now known as tnt1
10:17:22 × Guest17 quits (~Guest17@91.243.81.204) (Quit: Client closed)
10:17:34 Guest17 joins (~Guest17@91.243.81.204)
10:19:20 <tomsmeding> are you sure you need that for performance?
10:19:31 <tomsmeding> recall my earlier comments on the ghc unboxer
10:20:10 <tomsmeding> but unboxed types in an unboxed vector (as opposed to a _storable_ vector) are stored in struct-of-arrays format
10:20:29 <tomsmeding> and also, the 'a' here is a boxed type
10:21:28 <tomsmeding> an `MVector s (Int, Int)` in the end consists of _two_ `MutableByteArray s`es
10:21:43 <tomsmeding> one containing the fst components, the other containing the snd components
10:22:38 <tomsmeding> are you sure you're not looking for Data.Vector.Storable.Mutable?
10:23:14 <tomsmeding> if you want to read manually from a MutableByteArray, https://hackage.haskell.org/package/base-4.19.0.0/docs/GHC-Exts.html#v:readInt64Array-35-
10:26:03 <tomsmeding> https://hackage.haskell.org/package/vector-0.13.2.0/src/internal/unbox-tuple-instances
10:28:58 × Guest17 quits (~Guest17@91.243.81.204) (Quit: Client closed)
10:29:55 × jespada quits (~jespada@2800:a4:f9:a300:c8c1:20a5:1a94:f1) (Quit: My Mac has gone to sleep. ZZZzzz…)
10:33:27 __monty__ joins (~toonn@user/toonn)
10:33:38 mari50420 joins (~mari-este@user/mari-estel)
10:34:30 <haskellbridge> <magic_rb> tomsmeding i looked at the core and its doing boxing unboxing in a single call to exists, i counted 3 or 4 boxes unboxes
10:34:42 <haskellbridge> <magic_rb> Which is a lot if exists is called hundreds of times per frame
10:35:45 × mari-estel quits (~mari-este@user/mari-estel) (Ping timeout: 260 seconds)
10:37:03 <merijn> magic_rb: You should probably take some time browsing ghc-prim if you haven't yet :)
10:37:32 <haskellbridge> <magic_rb> yeah i didnt want to go that deep, was hoping i could avoid it :)
10:37:37 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
10:37:54 <tomsmeding> I see
10:38:36 <merijn> magic_rb: Once you start wondering "how do I avoid boxing/reboxing" you can't really avoid looking at that kinda stuff ;)
10:39:00 <haskellbridge> <magic_rb> yeah fair, loking at the primitive package and PrimArray, i think thats what i need
10:39:03 <merijn> That said, (most of) ghc-prim is perfectly safe and really not that complicated
10:39:24 <haskellbridge> <magic_rb> should i not be using primitive?
10:39:26 <merijn> Just not very portable, but that only matters in a universe where we still pretend anything but GHC matters :P
10:39:34 <merijn> primitive is fine too
10:39:47 <merijn> it's a slightly higher wrapper around stuff like ghc-prim
10:42:06 <haskellbridge> <magic_rb> Im kind of tempted to implement the sparse sets as foreign primops in C
10:42:28 <haskellbridge> <magic_rb> But that would then mean id have to write different preambles per architecture which i dont really feel like doing :)
10:43:36 <merijn> magic_rb: Right, but that's basically the same as writing it directly using ghc-prim, except then the portability problem is outsourced to GHC ;)
10:43:42 ubert joins (~Thunderbi@2a02:8109:ab8a:5a00:bcbc:bf70:1416:c809)
10:44:08 <haskellbridge> <magic_rb> Benefit of doing it in C is that there is only one implementation that i can call into from C for free
10:45:06 <haskellbridge> <magic_rb> For certain systems it might be beneficial to do the bulk of the logic in C. Currently the way the renderer works is it every frame copies all my entities that need to be rendered into a storable array of structs and then passes that to C which loops over it. Its surprisingly fast lol
10:45:10 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
10:54:02 notzmv joins (~umar@user/notzmv)
10:54:04 siborg parts (sid630849@user/rawles) ()
10:56:49 xff0x joins (~xff0x@2405:6580:b080:900:6a01:c501:bf5a:df58)
10:57:49 × dsrt^ quits (dsrt@c-98-242-74-66.hsd1.ga.comcast.net) (Ping timeout: 252 seconds)
11:02:19 kuribas joins (~user@ptr-17d51eo5v3yo1z5ic8l.18120a2.ip6.access.telenet.be)
11:05:51 tomsmeding . o O ( if the point was to implement a filesystem in haskell, why is there a bunch of C code )
11:06:52 <kuribas> Anyone going to FP dag?
11:07:24 <tomsmeding> o/
11:07:32 <tomsmeding> saw you were a speaker :)
11:07:52 <kuribas> yeah :)
11:08:50 <mari50420> Kristof Bastiaensen?
11:08:56 <kuribas> it's me.
11:10:29 <mari50420> hm the idea of a layered SQL generator is compelling
11:13:49 <kuribas> I had hoped to work on the postgresql version, but I've been sick last week.
11:16:49 <kuribas> The mysql version is usable though.
11:17:07 × mari50420 quits (~mari-este@user/mari-estel) (Remote host closed the connection)
11:17:23 mari-estel joins (~mari-este@user/mari-estel)
11:22:04 × xff0x quits (~xff0x@2405:6580:b080:900:6a01:c501:bf5a:df58) (Ping timeout: 245 seconds)
11:23:12 × paotsaq quits (~paotsaq@127.209.37.188.rev.vodafone.pt) (Quit: ZNC 1.9.0 - https://znc.in)
11:23:30 paotsaq joins (~paotsaq@127.209.37.188.rev.vodafone.pt)
11:26:47 × ubert quits (~Thunderbi@2a02:8109:ab8a:5a00:bcbc:bf70:1416:c809) (Remote host closed the connection)
11:27:00 ubert joins (~Thunderbi@2a02:8109:ab8a:5a00:13a7:b05b:d8a6:72f8)
11:27:47 × p3n quits (~p3n@217.198.124.246) (Quit: ZNC 1.8.2 - https://znc.in)
11:31:37 p3n joins (~p3n@217.198.124.246)
11:34:29 × paotsaq quits (~paotsaq@127.209.37.188.rev.vodafone.pt) (Ping timeout: 260 seconds)
11:34:41 homo joins (~homo@user/homo)
11:36:14 paotsaq joins (~paotsaq@127.209.37.188.rev.vodafone.pt)
11:40:48 × paotsaq quits (~paotsaq@127.209.37.188.rev.vodafone.pt) (Ping timeout: 246 seconds)
11:40:50 × Smiles quits (uid551636@id-551636.lymington.irccloud.com) (Quit: Connection closed for inactivity)
11:46:16 Nixkernal joins (~Nixkernal@90.74.198.178.dynamic.cust.swisscom.net)
11:48:23 jespada joins (~jespada@2800:a4:f9:a300:c8c1:20a5:1a94:f1)
11:55:35 dsrt^ joins (dsrt@c-98-242-74-66.hsd1.ga.comcast.net)
11:57:19 paotsaq joins (~paotsaq@127.209.37.188.rev.vodafone.pt)
12:00:14 AlexNoo_ joins (~AlexNoo@94.233.240.147)
12:02:35 × AlexZenon quits (~alzenon@5.139.233.96) (Ping timeout: 252 seconds)
12:03:45 × AlexNoo quits (~AlexNoo@5.139.233.96) (Ping timeout: 265 seconds)
12:04:23 <merijn> kuribas: I didn't get around to arranging time to get there, sadly
12:06:33 AlexZenon joins (~alzenon@94.233.240.147)
12:07:45 JuanDaugherty joins (~juan@user/JuanDaugherty)
12:07:49 <haskellbridge> <magic_rb> tomsmeding: nah this is my game engine :)
12:08:38 <JuanDaugherty> i have looked for a thing and not found it so asking
12:09:43 <JuanDaugherty> which is somekina pkg which is a generalization of content mgt or of actual dataschemes, e.g. relational ones
12:10:29 Smiles joins (uid551636@id-551636.lymington.irccloud.com)
12:10:38 <JuanDaugherty> the hs content mgt things i found just do CMS housekeeping and dont do anything about the above
12:11:06 <JuanDaugherty> *or even of
12:11:59 ash3en joins (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207)
12:12:08 × Nixkernal quits (~Nixkernal@90.74.198.178.dynamic.cust.swisscom.net) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
12:12:34 <JuanDaugherty> 40 years ago i did a project which i called 'matadatabase' because it's charter was to abstract of over a variety of sources of DOD training data
12:13:27 <JuanDaugherty> so that's an example use case, a generalization is called for there to abstract over the different actual, in that case, mainframe, data systems
12:14:12 <JuanDaugherty> i haven found anything substantailly in that direction on hackage or elsewhere
12:15:11 xff0x joins (~xff0x@2405:6580:b080:900:6d94:dd0b:4250:b8b3)
12:15:58 <JuanDaugherty> and ofc not a hs monoglot so anything highly relevant is good but a hs pkg would be ideal
12:16:46 × cjay quits (cjay@nerdbox.nerd2nerd.org) (Remote host closed the connection)
12:19:51 <albet70> async used for client, is simple, can async used for server since server's connection is always making?
12:21:42 <JuanDaugherty> thx in advance for any responses that come later which i'll see on the log
12:22:11 <ash3en> can anyone help with this issue in tidal cycles? https://github.com/tidalcycles/Tidal/issues/1094
12:24:03 × p3n quits (~p3n@217.198.124.246) (Quit: ZNC 1.8.2 - https://znc.in)
12:27:58 <JuanDaugherty> https://github.com/polyfy/polylith this closure thing is as close as i've found sofar and again not on the money of practical data scheme generalization
12:28:17 <JuanDaugherty> *clojure
12:28:50 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
12:29:39 <JuanDaugherty> just doin a last call due dili for prior art
12:36:19 × Sciencentistguy quits (~sciencent@hacksoc/ordinary-member) (Ping timeout: 252 seconds)
12:38:23 JuanDaugherty also to be clear, training data above was data about training programs not its current common usage
12:38:36 p3n joins (~p3n@217.198.124.246)
12:40:18 × p3n quits (~p3n@217.198.124.246) (Remote host closed the connection)
12:41:09 Sciencentistguy joins (~sciencent@hacksoc/ordinary-member)
12:43:43 avdb13 joins (~avdb13@2001-14ba-a0a9-f200--18c.rev.dnainternet.fi)
12:49:12 × kuribas quits (~user@ptr-17d51eo5v3yo1z5ic8l.18120a2.ip6.access.telenet.be) (Ping timeout: 244 seconds)
12:51:43 AlexNoo_ is now known as AlexNoo
12:53:17 p3n joins (~p3n@2a00:19a0:3:7c:0:d9c6:7cf6:1)
12:59:23 × JuanDaugherty quits (~juan@user/JuanDaugherty) (Quit: JuanDaugherty)
13:02:25 × merijn quits (~merijn@77.242.116.146) (Ping timeout: 244 seconds)
13:05:25 × CiaoSen quits (~Jura@2a05:5800:213:8800:ca4b:d6ff:fec1:99da) (Ping timeout: 248 seconds)
13:05:52 nkatte joins (~nkatte@user/nkatte)
13:11:16 × homo quits (~homo@user/homo) (Read error: Connection reset by peer)
13:12:35 merijn joins (~merijn@77.242.116.146)
13:13:37 l_k joins (~student@213.24.135.42)
13:17:06 × l__k quits (~student@85.172.111.143) (Ping timeout: 276 seconds)
13:40:28 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
13:49:10 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Quit: = "")
13:51:41 weary-traveler joins (~user@user/user363627)
13:51:42 × weary-traveler quits (~user@user/user363627) (Remote host closed the connection)
13:52:46 pavonia joins (~user@user/siracusa)
13:54:16 weary-traveler joins (~user@user/user363627)
13:57:18 × weary-traveler quits (~user@user/user363627) (Remote host closed the connection)
13:59:00 weary-traveler joins (~user@user/user363627)
14:00:57 × acidjnk_new quits (~acidjnk@p200300d6e7283f6814cd06cb5011f3d5.dip0.t-ipconnect.de) (Ping timeout: 272 seconds)
14:05:04 × merijn quits (~merijn@77.242.116.146) (Ping timeout: 252 seconds)
14:06:24 merijn joins (~merijn@77.242.116.146)
14:10:01 × lortabac quits (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4) (Quit: WeeChat 4.4.2)
14:11:17 acidjnk_new joins (~acidjnk@p200300d6e7283f68a1608a41cd6a32b2.dip0.t-ipconnect.de)
14:21:45 × yaroot quits (~yaroot@p3031163-ipngn4701souka.saitama.ocn.ne.jp) (Remote host closed the connection)
14:22:27 yaroot joins (~yaroot@p3031163-ipngn4701souka.saitama.ocn.ne.jp)
14:25:57 l__k joins (~student@213.24.135.58)
14:29:01 × l_k quits (~student@213.24.135.42) (Ping timeout: 252 seconds)
14:30:16 l_k joins (~student@85.172.77.82)
14:32:54 × gmg quits (~user@user/gehmehgeh) (Remote host closed the connection)
14:33:21 × l__k quits (~student@213.24.135.58) (Ping timeout: 244 seconds)
14:34:03 mari70558 joins (~mari-este@user/mari-estel)
14:35:06 × merijn quits (~merijn@77.242.116.146) (Ping timeout: 276 seconds)
14:36:14 × mari-estel quits (~mari-este@user/mari-estel) (Ping timeout: 245 seconds)
14:38:11 gmg joins (~user@user/gehmehgeh)
14:46:17 merijn joins (~merijn@77.242.116.146)
14:53:18 × mari70558 quits (~mari-este@user/mari-estel) ()
15:00:55 JuanDaugherty joins (~juan@user/JuanDaugherty)
15:01:15 × lxsameer quits (~lxsameer@Serene/lxsameer) (Ping timeout: 244 seconds)
15:09:41 l__k joins (~student@217.107.124.218)
15:12:44 × l_k quits (~student@85.172.77.82) (Ping timeout: 265 seconds)
15:14:02 l_k joins (~student@81.177.126.233)
15:15:03 saulosilva joins (~saulosilv@181.216.220.21)
15:16:38 hseg joins (~gesh@46.120.21.249)
15:16:56 × l__k quits (~student@217.107.124.218) (Ping timeout: 252 seconds)
15:17:45 <hseg> Just realized a potential legal problem with distributing statically-linked haskell code -- how am I supposed to comply with the obligation to distribute the licenses for all the dependencies?
15:18:51 <merijn> hseg: That depends on said licenses
15:19:16 <merijn> hseg: Generally they require an "About" function in the binary with the licenses
15:20:17 <hseg> I mean, I already distribute the top-level package's LICENSE file in the tarball
15:21:01 <hseg> presumably, I'd need to have a directory LICENSES/$dep ?
15:22:06 <hseg> (at least for those dependencies that require distribution of their license, eg MIT, BSD-n with n>=2, GPL, ...)
15:28:17 <haskellbridge> <magic_rb> Realistically no one does this, so unless youve a very good reason to do it, i wouldnt worry about it
15:28:33 <haskellbridge> <magic_rb> Especially if your project is also free software
15:29:43 <hseg> Fair enough. The topic came to mind because Arch just started demanding packaging files be licensed, and the train of thought got me there
15:37:04 × saulosilva quits (~saulosilv@181.216.220.21) (Quit: Client closed)
15:40:08 <merijn> hseg: Realistically, if you ship GPL in a binary you're already kinda hosed :p
15:40:44 <merijn> hseg: btw, I vaguelly recall cabal-plan having a command for collecting all transitive dependencies
15:41:01 <hseg> Yup -- cabal plan license-report
15:42:06 <hseg> Which looks official and nice, but given BSD, MIT, ISC all require you to distribute their copyright notices, is still slightly off what's technically needed
15:42:34 <hseg> Still, that's better than stack ls dependencies --license which just gives the author's spelling of their licenses
15:42:54 <merijn> hseg: I mean, that's pretty much the way to go, tbh
15:43:09 <merijn> Do you have a library or a binary?
15:43:16 <hseg> binary
15:43:35 <hseg> Ah, dammit -- hledger *is* GPL
15:43:42 <hseg> at least it's a top-level dep
15:44:01 <hseg> s/a top-level dep/the package I'm building/
15:45:08 <merijn> hseg: having a --about or --licenses that prints out all licenses seems the most correct way to comply
15:45:45 <sm> that sounds nice
15:46:17 <hseg> yeah. Or I was thinking of installing something like https://hackage.haskell.org/package/src/example/cabal-plan.html next to hledger's LICENSE file
15:46:29 <hseg> problem is that that doesn't really satisfy obligations
15:47:29 <sm> stack ls dependencies --license looks excellent, isn't that a good starting point ?
15:47:45 <sm> group them by license, then add the texts ?
15:49:46 <sm> stack ls dependencies --license | awk '{print $2 " " $1}' | sed -E 's/(BSD|GPL)-/\1/' | sort
15:49:55 <hseg> two problems. 1) non-canonical license names -- am seeing BSD2, BSD-2. That's OK, but with GPL there's a significant difference between GPL3 and GPL3+ which needs to be reflected
15:50:33 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
15:50:39 <sm> hledger itself is the only GPL thing (!)
15:50:58 <sm> and for the record it's GPLv3+ (cabal format can't express that IIRC)
15:51:08 <hseg> 2) as mentioned above -- some licenses require distributing their copyright notices, it is insufficient to have a report saying "I depend on the BSD-licensed foo package"
15:51:23 <hseg> sm: that's true of hledger, and makes my life easier
15:52:03 <hseg> it can! license: GPL-3.0-or-later
15:55:23 <yushyin> glad to see that cabal adopted spdx ids
15:55:49 <sm> hseg: good to know, thanks!
15:57:03 <sm> do you know the earliest version of cabal-install that supports that ?
15:57:30 <tomsmeding> https://cabal.readthedocs.io/en/stable/cabal-package-description-file.html#pkg-field-license
15:58:19 <tomsmeding> it's with reference to a `cabal-version` version, not cabal-install, but perhaps those are synchronised?
15:58:25 <sm> 🙏🏻
15:58:36 <tomsmeding> in any case, long
15:58:52 × rachelambda8 quits (~rachelamb@cust-95-80-25-71.csbnet.se) (Quit: β reduced)
15:59:40 <sm> next I hunt for cabal-version release dates
15:59:56 <sm> nobody puts those in their docs :)
16:00:38 <tomsmeding> naturally :)
16:00:50 × Smiles quits (uid551636@id-551636.lymington.irccloud.com) (Quit: Connection closed for inactivity)
16:00:54 <tomsmeding> > The sequence of specification version numbers is not contiguous because it’s synchronised with the version of the Cabal library.
16:00:54 <hseg> The earliest commit I see in the cabal repo mentioning SPDX is 3dfc0ea466d254fcefb3826d6f15cda30d95cc0a
16:00:56 <tomsmeding> https://cabal.readthedocs.io/en/stable/file-format-changelog.html#spec-history
16:00:59 mari-estel joins (~mari-este@user/mari-estel)
16:01:26 <hseg> https://0x0.st/8-sC.txt is the list of tags containing that commit
16:02:00 <tomsmeding> looks like 2.2 and onwards?
16:02:02 <sm> it became supported in https://github.com/haskell/cabal/blob/master/Cabal/ChangeLog.md#2200-mikhail-glushenkov-march-2018 I think
16:02:09 <sm> yup, thanks
16:02:27 <tomsmeding> which is consistent with the `cabal-version: 2.2` note and the fact that the two are synchronised
16:02:38 sm didn't want to assume
16:02:39 <hseg> yay!
16:03:44 × alecs quits (~alecs@nat16.software.imdea.org) (Ping timeout: 264 seconds)
16:04:23 <tomsmeding> nice
16:09:54 <hseg> hm, actually just realized the licenses appear under ~/.cabal/store/$HC/$PKG/share/doc/LICENSE
16:10:59 × merijn quits (~merijn@77.242.116.146) (Ping timeout: 260 seconds)
16:11:18 <hseg> so in theory, cabal-plan's report could copy them into the license directory
16:12:46 × jespada quits (~jespada@2800:a4:f9:a300:c8c1:20a5:1a94:f1) (Ping timeout: 244 seconds)
16:13:03 lxsameer joins (~lxsameer@Serene/lxsameer)
16:13:20 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
16:14:01 rachelambda8 joins (~rachelamb@cust-95-80-25-71.csbnet.se)
16:14:20 Square2 joins (~Square@user/square)
16:17:19 jespada joins (~jespada@2800:a4:113:8c00:655c:4889:ada3:2b47)
16:23:04 Smiles joins (uid551636@id-551636.lymington.irccloud.com)
16:23:36 × JuanDaugherty quits (~juan@user/JuanDaugherty) (Quit: JuanDaugherty)
16:23:49 merijn joins (~merijn@77.242.116.146)
16:24:00 <__monty__> What if the PKG lists multiple license-files?
16:25:15 <hseg> then all would need to be copied, presumably
16:25:25 saulosilva joins (~saulosilv@181.216.220.21)
16:27:30 <__monty__> Maybe it's worth looking into some of the reproducible builds stuff? SALSA and the like? They tend to care about source provenance and licensing is part of that so maybe they have tools that make this easy.
16:30:44 × merijn quits (~merijn@77.242.116.146) (Ping timeout: 264 seconds)
16:32:51 target_i joins (~target_i@user/target-i/x-6023099)
16:34:02 <hseg> I thought https://reuse.software might have something, but apparently not
16:34:06 merijn joins (~merijn@77.242.116.146)
16:35:22 <merijn> sm: to add onto tomsmeding answer, cabal-version refers to the cabal *spec* i.e. supported features, (generally equal to "the earliest cabal version that supports it")
16:35:40 <tomsmeding> merijn: "generally"?
16:35:48 <merijn> tomsmeding: I'm not 100% it's guaranteed
16:36:27 <merijn> tomsmeding: In general there's no real reason the spec and cabal-install versions should correspond (they always have and do at the moment, but there's no specific reason)
16:36:29 <tomsmeding> merijn: the Note here seems to give more certainty https://cabal.readthedocs.io/en/stable/file-format-changelog.html#spec-history
16:36:43 <tomsmeding> ah
16:36:52 <merijn> ah, right
16:38:06 <merijn> sm: At any rate, the core idea is that the semantics of a field will never change for a specific cabal-version, so even if field "foo" changes behaviour in a later version of the spec, any file declaring version X will always use the semantics of 'foo' at time X
16:39:24 <merijn> anyway, cabal 2.2 is over a decade old, so :p
16:39:36 <merijn> 2.4 is the version I used at the start of my phd in 2014
16:40:05 <merijn> sm: So that should be MORE than old enough to require ;)
16:41:04 <merijn> ah, no I'm misremebering it seems, it's from 2018
16:41:24 × saulosilva quits (~saulosilv@181.216.220.21) (Quit: Client closed)
16:42:42 jokoon joins (~jokoon@2a01:cb1d:8f84:4f00:60a2:6701:a66e:bb95)
16:42:56 <jokoon> can I access the first element of a list without the head function?
16:43:41 <tomsmeding> pattern-match on it?
16:44:28 <jokoon> https://bpa.st/KICQ like this?
16:44:47 <tomsmeding> f8 (a : _) = a
16:44:55 <tomsmeding> which will still crash if f8 gets an empty list
16:45:18 <jokoon> and how can I raise an error if the list is empty?
16:45:25 <tomsmeding> what have you tried?
16:45:26 <jokoon> put some if?
16:45:34 <jokoon> I will try to put an if
16:45:42 <tomsmeding> you can give multiple equations to a function
16:45:56 <tomsmeding> foo 1 = "was one"
16:45:59 <tomsmeding> foo 2 = "was two"
16:46:02 × merijn quits (~merijn@77.242.116.146) (Ping timeout: 252 seconds)
16:46:03 <tomsmeding> foo n = "was something else: " ++ show n
16:49:06 <jokoon> like this then https://bpa.st/SDXA
16:49:09 <jokoon> that works
16:49:26 <mauke> yes, that's pretty much how head is defined
16:49:51 <jokoon> you can guess that I am doing homework haha
16:50:14 <jokoon> although to be fair I just had a student send me his haskell homework
16:50:20 <mauke> @src head
16:50:20 <lambdabot> head (x:_) = x
16:50:21 <lambdabot> head [] = error "Prelude.head: empty list"
16:50:49 <jokoon> no idea if he will solve this with chatpgt without help
16:51:41 saulosilva joins (~saulosilv@181.216.220.21)
16:51:46 <tomsmeding> much as I am usually condescending about the abilities of LLMs, I'm quite sure it can generate the source for `head`. :)
16:53:07 <int-e> . o O ( or a good approximation thereof )
16:53:18 <mauke> <insert nsfw joke here>
16:53:32 <int-e> does it involve giving
16:55:07 homo joins (~homo@user/homo)
16:57:01 × mari-estel quits (~mari-este@user/mari-estel) (Remote host closed the connection)
16:57:16 mari-estel joins (~mari-este@user/mari-estel)
17:02:17 × ubert quits (~Thunderbi@2a02:8109:ab8a:5a00:13a7:b05b:d8a6:72f8) (Quit: ubert)
17:07:17 × homo quits (~homo@user/homo) (Ping timeout: 252 seconds)
17:11:31 homo_ joins (~homo@user/homo)
17:13:35 × machinedgod quits (~machinedg@d108-173-18-100.abhsia.telus.net) (Ping timeout: 260 seconds)
17:17:42 econo_ joins (uid147250@id-147250.tinside.irccloud.com)
17:26:21 <hseg> For some reason, ghcup's ghc 9.8.4 compiles to store the Cabal store under ghc-9.8.4-c895 Any idea why?
17:27:00 × jokoon quits (~jokoon@2a01:cb1d:8f84:4f00:60a2:6701:a66e:bb95) (Quit: Leaving)
17:28:53 × ChaiTRex quits (~ChaiTRex@user/chaitrex) (Remote host closed the connection)
17:29:20 ChaiTRex joins (~ChaiTRex@user/chaitrex)
17:30:12 <geekosaur> because that's the correct thing to do but wasn't possible in earlier versions
17:30:21 <geekosaur> the store is very sensitive to ghc abi
17:32:28 <hseg> Oh? Wait, is that c895 a truncated hash?
17:35:18 <geekosaur> yes
17:35:46 <hseg> ah. OK, making a symlink there works, but I've reported this upstream to cabal-plan
17:36:03 <hseg> how is one supposed to find that store, then?
17:36:06 <geekosaur> you will find it in the package.conf for the "ghc" package, since that's the closest we currentlhy get to an ABI for a full GHC install
17:36:35 <hseg> which is where?
17:37:00 × euphores quits (~SASL_euph@user/euphores) (Ping timeout: 252 seconds)
17:38:05 <hseg> answer: ghc-pkg list ghc
17:38:22 <hseg> any way of getting that location programmatically
17:38:24 <hseg> ?
17:39:53 homo_ is now known as homo
17:40:16 <int-e> run ghc-pkg and parse the output programmatically. --simple-output helps with that
17:40:43 <geekosaur> if you want the file, ghc --print-global-package-db
17:40:43 <hseg> no, I meant from within haskell source
17:40:56 <hseg> cabal-plan needs to be able to find the Cabal store
17:41:32 <int-e> I'm pretty sure the Cabal library interrogates ghc-pkg too.
17:42:06 <hseg> what, with system("ghc-pkg ...")? I doubt that
17:42:47 <geekosaur> it runs a lot of external programs, actually
17:42:54 <int-e> well using System.Process
17:43:00 <geekosaur> that said, it does not use ghc-pkg because it *is* ghc-pkg
17:43:22 <geekosaur> that si, ghc-pkg is a wrapper around the Cabal library's package db management
17:45:41 <hseg> OK, I don't quite follow, but that's as deep as I can afford to go down this rabbit hole right now
17:47:48 <int-e> There's also some baked-in paths here: ghc --print-global-package-db
17:48:19 <int-e> geekosaur: I don't think that's correct. Yes, ghc-pkg uses (parts of) the Cabal library. But it's still invoked by Cabal or at least cabal-install anyway.
17:49:07 <int-e> geekosaur: I guess partly because the Cabal versions used may be different.
17:49:54 <int-e> But also because the ghc-pkg wrapper script sets a bunch of paths that are hard to figure out otherwise.
17:58:43 euphores joins (~SASL_euph@user/euphores)
18:03:47 prasad joins (~Thunderbi@c-73-75-25-251.hsd1.in.comcast.net)
18:05:30 sprotte24 joins (~sprotte24@p200300d16f1e660091235e642331973a.dip0.t-ipconnect.de)
18:14:08 × L29Ah quits (~L29Ah@wikipedia/L29Ah) (Read error: Connection reset by peer)
18:16:19 × plitter quits (~plitter@user/plitter) (Ping timeout: 264 seconds)
18:19:29 L29Ah joins (~L29Ah@wikipedia/L29Ah)
18:22:01 ljdarj joins (~Thunderbi@user/ljdarj)
18:26:38 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
18:33:10 Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915)
18:33:58 mari41300 joins (~mari-este@user/mari-estel)
18:34:57 × Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 276 seconds)
18:34:57 Lord_of_Life_ is now known as Lord_of_Life
18:35:21 × mari-estel quits (~mari-este@user/mari-estel) (Read error: Connection reset by peer)
18:38:42 × fun-safe-math quits (~fun-safe-@2601:1c2:1b7f:801f:25c5:ab3d:d3f4:6796) (Ping timeout: 246 seconds)
18:38:51 <smiesner> does anyone have a tip how i can use cabal repl effectively with happy and alex? how can i regenerate .hs files, build and reload?
18:39:23 <smiesner> i have to use cabal build, cabal repl, :l Parser all the time
18:39:57 <mari41300> huh, :r not enough, i guess
18:40:03 <smiesner> sadly no
18:40:41 <smiesner> ah but wait
18:40:47 <smiesner> maybe its :l Parser again
18:41:11 mari41300 crosses fingers
18:43:02 <smiesner> nope..
18:43:09 <mari41300> meh
18:44:21 <mari41300> not sure, i think recompiling worked fine for me when i had the chance to leverage the repl. Maybe a complex project with multiple packages?
18:44:40 fun-safe-math joins (~fun-safe-@2601:1c2:1b7f:801f:9be8:50a:7d0a:fa49)
18:45:18 <smiesner> my project? so far only happy and alex files :)
18:45:39 <smiesner> :r does not rebuild the parsers
18:45:40 <mari41300> hmm single package then
18:46:33 <smiesner> i list Lexer and Parser (as i named the modules) in exposed-modules of the library in my cabal file
18:46:43 <smiesner> maybe that's the wrong way?
18:48:05 tzh joins (~tzh@c-76-115-131-146.hsd1.or.comcast.net)
18:51:53 <mari41300> well does not sound wrong but not sure whether the structure of the cabal file could affect compilation in the interpreter. I would be surprised
18:55:53 Guest20 joins (~Guest20@136.158.16.131)
18:56:11 × dolio quits (~dolio@130.44.140.168) (Quit: ZNC 1.9.1 - https://znc.in)
18:56:21 Guest20 parts (~Guest20@136.158.16.131) ()
19:02:30 dolio joins (~dolio@130.44.140.168)
19:05:39 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
19:05:51 × ljdarj quits (~Thunderbi@user/ljdarj) (Ping timeout: 244 seconds)
19:06:11 <c_wraith> huh. I found a case where I'd really like to benchmark the difference between -O2 and default in a single criterion suite, but... uh... The levels don't work right for that.
19:06:16 <haskellbridge> <sm> smiesner: ghcid is flexible in which ghci commands it can run on change, including :! shell commands I expect. I'd try to get that working in a side window. Then if you :r in your ghci window the parser will already be regenerated.
19:07:16 <smiesner> thanks, will look into it!
19:08:01 <haskellbridge> <sm> I meant, try to get ghcid doing the regeneration as well as compilation. Or, and this might be simpler, run watchexec to regenerate the parser continually, and just reload ghci when you need
19:08:34 × ash3en quits (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) (Quit: ash3en)
19:08:57 <haskellbridge> <sm> also, if you are reloading a lot, I find this really useful in .ghci: :def rmain \args -> return $ ":reload\n:main "<>args
19:10:04 <mari41300> hm but odd that the cabal repl does not detect changes cabal build would
19:10:14 × saulosilva quits (~saulosilv@181.216.220.21) (Quit: Client closed)
19:11:24 l__k joins (~student@188.254.126.139)
19:11:26 <mari41300> i did not get what you meant c_wraith
19:13:34 OftenFaded53 joins (~OftenFade@user/tisktisk)
19:13:55 <c_wraith> mari41300: I can't compile my test suite with -O1 and -O2 simultaneously. The best I could manage is moving it into multiple modules with different ghc options per module and duplicating the definition between multiple modules. That's not great for maintainability
19:14:02 <c_wraith> err, benchmark suite
19:14:10 × l_k quits (~student@81.177.126.233) (Ping timeout: 252 seconds)
19:14:55 <mari41300> well i guess it would be common for benchs to be run multiple times with different opts
19:15:49 <c_wraith> usually you'd only run benchmarks with the options you're actually using. My case is uncommon in that what I really want to demonstrate is the difference between them. (One benchmark is unaffected, a different one improves immensely)
19:17:11 <c_wraith> (my point is to demonstrate how much easier a time GHC has when you write code that's easily amenable to optimization, instead of making it apply the slow -O2 stuff to find places to optimize)
19:17:20 OftenFaded53 parts (~OftenFade@user/tisktisk) ()
19:18:23 plitter joins (~plitter@user/plitter)
19:18:53 l_k joins (~student@213.24.133.217)
19:21:37 × l__k quits (~student@188.254.126.139) (Ping timeout: 252 seconds)
19:23:13 <tomsmeding> smiesner: also try running 'cabal build' in another terminal, and then :r
19:23:37 × sord937 quits (~sord937@gateway/tor-sasl/sord937) (Quit: sord937)
19:24:02 <tomsmeding> if that works, then you can `:def R \_ -> Prelude.return ":!cabal build\n:r"` to define a ghci command :R that first builds and then reloads ;)
19:27:08 <smiesner> tomsmeding: will try that for sure!
19:27:21 <smiesner> thanks all :)
19:27:37 <tomsmeding> c_wraith: is it just one function? mark them as INLINE, use them (trivially, in a wrapper function) in two separate modules, compile those two modules with different options?
19:27:51 <mari41300> exit
19:27:55 <mari41300> :P
19:28:06 <mari41300> sorry i'm tired. See you all o/
19:28:10 × mari41300 quits (~mari-este@user/mari-estel) (Remote host closed the connection)
19:28:16 <tomsmeding> ctrl-D is often faster than typing "exit" ... oh too late
19:30:11 ljdarj joins (~Thunderbi@user/ljdarj)
19:33:15 <c_wraith> Huh. Not sure how INLINE interacts with this.
19:35:15 <tomsmeding> yeah this may be too much trickery
19:35:44 <tomsmeding> but the GHC user's guide says: ( https://downloads.haskell.org/ghc/latest/docs/users_guide/exts/pragmas.html#inline-and-noinline-pragmas )
19:35:51 <tomsmeding> > So GHC guarantees to inline precisely the code that you wrote, no more and no less.
19:35:57 <tomsmeding> which sounds like what you want here
19:41:28 raym joins (~ray@user/raym)
19:52:07 × weary-traveler quits (~user@user/user363627) (Remote host closed the connection)
19:53:26 <c_wraith> Huh. Looks like cabal might override the -O2 in an OPTIONS_GHC pragma
19:53:50 <c_wraith> I might need to compile it as a sublibrary
19:55:26 × rvalue quits (~rvalue@user/rvalue) (Read error: Connection reset by peer)
19:55:56 rvalue joins (~rvalue@user/rvalue)
20:00:04 × caconym quits (~caconym@user/caconym) (Quit: bye)
20:00:35 visilii_ joins (~visilii@188.254.110.9)
20:00:44 caconym joins (~caconym@user/caconym)
20:03:50 × hseg quits (~gesh@46.120.21.249) (Ping timeout: 272 seconds)
20:04:40 × visilii quits (~visilii@213.24.125.237) (Ping timeout: 265 seconds)
20:07:00 ash3en joins (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207)
20:09:51 <c_wraith> Oh. No, I think this idea just doesn't work.
20:09:51 × ash3en quits (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) (Client Quit)
20:10:21 <c_wraith> I think the INLINE pragma is being ignored because the definition it would need to apply to is directly recursive
20:10:38 <c_wraith> It needs a worker/wrapper transform for GHC to inline it at all
20:11:05 <c_wraith> And while it can do that in a single module with -O2, it does not appear to do it cross-module with -O2
20:12:59 gorignak joins (~gorignak@user/gorignak)
20:14:40 JuanDaugherty joins (~juan@user/JuanDaugherty)
20:15:58 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
20:17:00 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
20:17:39 cjay joins (cjay@nerdbox.nerd2nerd.org)
20:17:46 <c_wraith> And, yeah. OPTIONS_GHC -O2 does in fact override cabal's global optimization level. It just wasn't visible because of the cross-module stuff
20:18:43 weary-traveler joins (~user@user/user363627)
20:21:40 <c_wraith> Oh, right. "GHC tries not to select a function with an INLINE pragma as a loop breaker, but when there is no choice even an INLINE function can be selected, in which case the INLINE pragma is ignored. For example, for a self-recursive function, the loop breaker can only be the function itself, so an INLINE pragma is always ignored."
20:21:58 <c_wraith> So yeah... When *that* is the issue I'm trying to demonstrate, INLINE is useless.
20:25:58 <EvanR> a self recursive function can't be inlined
20:26:03 <EvanR> I guess that makes sense on multiple levels
20:26:25 <EvanR> wait a minute, isn't that what loop unrolling is
20:27:12 <c_wraith> it is.
20:29:32 l__k joins (~student@217.107.126.148)
20:32:08 × l_k quits (~student@213.24.133.217) (Ping timeout: 244 seconds)
20:32:09 × Digit quits (~user@user/digit) (Read error: Connection reset by peer)
20:32:56 Digit joins (~user@user/digit)
20:35:00 <c_wraith> within a single module, GHC will do a worker-wrapper transform to inline directly recursive definitions at -O2. But making that optimization fire across modules seems hard.
20:36:14 <c_wraith> Further reading of the docs suggests you might be able to do it with INLINEABLE *and* the magic inline function. https://hackage.haskell.org/package/base-4.21.0.0/docs/GHC-Base.html#v:inline
20:36:28 <c_wraith> But that means you need to cooperate at the call site. eww.
20:37:43 <Leary> Perhaps artificially introduce a loop breaker: `bar = ... bar ...` --> `foo = bar; {-# INLINE bar #-}; bar = ... foo ...`
20:51:19 <hololeap> JuanDaugherty: are you aware of https://en.wikipedia.org/wiki/Relational_algebra
20:51:37 <c_wraith> Leary: if you're rewriting it to make it inline properly, you might as well worker/wrapper it yourself
20:53:23 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
20:53:56 <Leary> Well, worker/wrapper only lets you inline the wrapper. This would let you inline the entire body, so your other module can optimise it differently.
20:54:46 × avdb13 quits (~avdb13@2001-14ba-a0a9-f200--18c.rev.dnainternet.fi) (Remote host closed the connection)
20:54:47 machinedgod joins (~machinedg@d108-173-18-100.abhsia.telus.net)
20:55:14 × Digit quits (~user@user/digit) (Read error: Connection reset by peer)
20:55:25 <c_wraith> inlining the wrapper copies in the worker definition so that things can be inlined into it.
20:55:57 <c_wraith> The only thing it doesn't do is any kind of unrolling
20:56:03 Digit joins (~user@user/digit)
20:56:14 × lxsameer quits (~lxsameer@Serene/lxsameer) (Ping timeout: 245 seconds)
20:56:38 <JuanDaugherty> hololeap, ofc, i;m juan@acm.org
20:58:13 <JuanDaugherty> to be clear, i did not go to the damn enwiki relational algebra article
21:01:40 <JuanDaugherty> but ty anyway
21:03:18 <JuanDaugherty> pretty sure i looked for hs things that woulda done integration based on relational algebra with null result
21:05:14 <JuanDaugherty> and i apologize for being a bore on this because i know i've asked b4 and wont again
21:06:05 <hololeap> I think it's just very niche and if someone who does know doesn't catch it, it will just get lost in the IRC backlog
21:06:42 <JuanDaugherty> well it woulda been before the current public log i think, nyefs
21:07:26 <JuanDaugherty> it is niche but ofc there's a huge draw for the end function and actual commercial products targetting the task in various ways
21:08:16 <hololeap> asking on the haskell discourse or the subreddit _might_ get you more responses simply because of better retention
21:08:44 <JuanDaugherty> stuff is only bridged one way from there here?
21:09:52 <hololeap> there's a matrix bridge
21:10:02 <JuanDaugherty> although actually haven seen bridged stuff lately and heard theres some maint goin on
21:11:25 <hc> Hello, I would like to use the uniform function (System.Random) with a custom enum, how?
21:13:31 <JuanDaugherty> my understanding is the #haskelll name space here is still the main hs community thing
21:15:11 <hololeap> I'm just saying chat has its shortcomings compared to something like https://discourse.haskell.org/ where people can go back and read old threads
21:15:17 <haskellbridge> <sm> JuanDaugherty: I wouldn't say that, haskell community is a bit more spread out these days
21:15:29 <haskellbridge> <sm> scattered, some might say
21:15:48 <haskellbridge> <sm> and hololeap is right
21:16:39 <hc> Ah lol, the answer to my question seems to be hidden in the System.Random.hs source code and is more involved (generics) than I had anticipated =)
21:17:05 × econo_ quits (uid147250@id-147250.tinside.irccloud.com) (Quit: Connection closed for inactivity)
21:19:02 <JuanDaugherty> sm noted
21:21:11 <JuanDaugherty> yeah 10 or so ago there would have been 3X as many in this channel
21:21:22 <JuanDaugherty> *10 y
21:22:10 <haskellbridge> <sm> we have a lot more communication channels now
21:25:26 <EvanR> I'm going down with the ship tyvm
21:26:44 <Leary> hc: https://play.haskell.org/saved/gE2vt5ch
21:29:22 <glguy> hololeap: I think discourse different. Similarly it has shortcomings with its threaded structure compared to the conversation that can happen in something like IRC
21:30:21 <hololeap> I agree
21:30:32 <glguy> *is just different*
21:30:39 <hc> Leary: Thanks! Much simpler :)
21:31:01 <hc> Discourse is neither free nor distributed, is it?
21:31:44 × jespada quits (~jespada@2800:a4:113:8c00:655c:4889:ada3:2b47) (Quit: My Mac has gone to sleep. ZZZzzz…)
21:33:43 <hololeap> it's the closest thing to an official haskell forum that I know of
21:34:47 <mauke> Discourse is jeffware
21:37:06 <hc> (using haskell first day after long while) what's the operator again that applies a function to the 1st element of a tuple and keeps the 2nd element untouched?
21:37:48 <glguy> You could use first: https://hackage.haskell.org/package/base-4.21.0.0/docs/Data-Bifunctor.html#t:Bifunctor
21:39:05 <hololeap> mauke: jeffware?
21:39:41 <mauke> jeff atwood
21:40:17 <EvanR> hc, if you are not picky about the 1st or 2nd element, there's fmap, which applies to the 2nd
21:40:29 <EvanR> > fmap (+1) (0,0)
21:40:30 <lambdabot> (0,1)
21:40:41 <EvanR> the operator is <$>
21:41:35 <hololeap> I see
21:41:39 × michalz quits (~michalz@185.246.207.221) (Remote host closed the connection)
21:42:28 <hololeap> well, it looks like discourse is at least foss (https://github.com/discourse/discourse)
21:42:28 × ThePenguin quits (~ThePengui@cust-95-80-24-166.csbnet.se) (Remote host closed the connection)
21:42:50 × JuanDaugherty quits (~juan@user/JuanDaugherty) (Quit: JuanDaugherty)
21:43:03 ThePenguin joins (~ThePengui@cust-95-80-24-166.csbnet.se)
21:43:12 × ThePenguin quits (~ThePengui@cust-95-80-24-166.csbnet.se) (Remote host closed the connection)
21:43:35 <mauke> > over _1 (+1) (0,0)
21:43:37 <lambdabot> (1,0)
21:43:46 ThePenguin joins (~ThePengui@cust-95-80-24-166.csbnet.se)
21:43:55 × ThePenguin quits (~ThePengui@cust-95-80-24-166.csbnet.se) (Remote host closed the connection)
21:44:42 ThePenguin joins (~ThePengui@cust-95-80-24-166.csbnet.se)
21:44:43 × ThePenguin quits (~ThePengui@cust-95-80-24-166.csbnet.se) (Remote host closed the connection)
21:45:16 ThePenguin joins (~ThePengui@cust-95-80-24-166.csbnet.se)
21:45:25 × ThePenguin quits (~ThePengui@cust-95-80-24-166.csbnet.se) (Remote host closed the connection)
21:45:58 ThePenguin joins (~ThePengui@cust-95-80-24-166.csbnet.se)
21:46:08 × ThePenguin quits (~ThePengui@cust-95-80-24-166.csbnet.se) (Remote host closed the connection)
21:46:33 user363627 joins (~user@user/user363627)
21:47:24 ThePenguin joins (~ThePengui@cust-95-80-24-166.csbnet.se)
21:47:34 × ThePenguin quits (~ThePengui@cust-95-80-24-166.csbnet.se) (Remote host closed the connection)
21:48:09 ThePenguin joins (~ThePengui@cust-95-80-24-166.csbnet.se)
21:48:18 × ThePenguin quits (~ThePengui@cust-95-80-24-166.csbnet.se) (Remote host closed the connection)
21:48:50 ThePenguin joins (~ThePengui@cust-95-80-24-166.csbnet.se)
21:48:59 × ThePenguin quits (~ThePengui@cust-95-80-24-166.csbnet.se) (Remote host closed the connection)
21:50:40 × weary-traveler quits (~user@user/user363627) (Ping timeout: 252 seconds)
21:51:17 ThePenguin joins (~ThePengui@cust-95-80-24-166.csbnet.se)
21:51:17 × ThePenguin quits (~ThePengui@cust-95-80-24-166.csbnet.se) (Remote host closed the connection)
21:51:49 ThePenguin joins (~ThePengui@cust-95-80-24-166.csbnet.se)
21:51:55 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
21:51:59 × ThePenguin quits (~ThePengui@cust-95-80-24-166.csbnet.se) (Remote host closed the connection)
21:52:29 merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl)
21:52:32 ThePenguin joins (~ThePengui@cust-95-80-24-166.csbnet.se)
21:52:33 × ThePenguin quits (~ThePengui@cust-95-80-24-166.csbnet.se) (Remote host closed the connection)
21:53:50 <hc> glguy: Thanks, I used first, works
21:54:24 <hc> EvanR: thanks also, I prefer first over <$> in this case :) I vaguely remember there used to be some arrow functions
21:54:51 <mauke> > fst $ do ("no", "harm")
21:54:52 <lambdabot> "no"
21:56:36 <tomsmeding> hc: there's also 'second', which does... the obvious other thing
21:56:48 × merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 246 seconds)
21:56:56 ThePenguin joins (~ThePengui@cust-95-80-24-166.csbnet.se)
21:56:57 × ThePenguin quits (~ThePengui@cust-95-80-24-166.csbnet.se) (Remote host closed the connection)
21:57:31 ThePenguin joins (~ThePengui@cust-95-80-24-166.csbnet.se)
21:57:32 × ThePenguin quits (~ThePengui@cust-95-80-24-166.csbnet.se) (Remote host closed the connection)
21:58:05 ThePenguin joins (~ThePengui@cust-95-80-24-166.csbnet.se)
21:58:07 × ThePenguin quits (~ThePengui@cust-95-80-24-166.csbnet.se) (Remote host closed the connection)
21:59:42 × takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection)
22:00:11 × ystael quits (~ystael@user/ystael) (Ping timeout: 265 seconds)
22:00:52 <EvanR> > swap (fmap (+1) (swap (0,0)))
22:00:53 <lambdabot> (1,0)
22:01:19 <EvanR> > (swap . fmap (+1) . swap) (0,0)
22:01:19 <lambdabot> (1,0)
22:06:30 ThePenguin joins (~ThePengui@cust-95-80-24-166.csbnet.se)
22:06:39 × ThePenguin quits (~ThePengui@cust-95-80-24-166.csbnet.se) (Remote host closed the connection)
22:07:13 ThePenguin joins (~ThePengui@cust-95-80-24-166.csbnet.se)
22:07:14 × ThePenguin quits (~ThePengui@cust-95-80-24-166.csbnet.se) (Remote host closed the connection)
22:07:49 ThePenguin joins (~ThePengui@cust-95-80-24-166.csbnet.se)
22:07:54 merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl)
22:07:58 × ThePenguin quits (~ThePengui@cust-95-80-24-166.csbnet.se) (Remote host closed the connection)
22:07:59 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
22:10:25 × esph quits (~weechat@user/esph) (Remote host closed the connection)
22:12:42 × merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 276 seconds)
22:15:12 peterbecich joins (~Thunderbi@syn-047-229-123-186.res.spectrum.com)
22:17:31 biberao joins (~m@user/biberao)
22:20:26 Guest87 joins (~Guest87@89.104.243.92)
22:21:02 × Guest87 quits (~Guest87@89.104.243.92) (Client Quit)
22:21:48 saulosilva joins (~saulosilv@181.216.220.21)
22:24:21 ThePenguin joins (~ThePengui@cust-95-80-24-166.csbnet.se)
22:24:22 × ThePenguin quits (~ThePengui@cust-95-80-24-166.csbnet.se) (Remote host closed the connection)
22:24:54 ThePenguin joins (~ThePengui@cust-95-80-24-166.csbnet.se)
22:25:03 × ThePenguin quits (~ThePengui@cust-95-80-24-166.csbnet.se) (Remote host closed the connection)
22:25:07 merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl)
22:25:37 ThePenguin joins (~ThePengui@cust-95-80-24-166.csbnet.se)
22:25:39 × ThePenguin quits (~ThePengui@cust-95-80-24-166.csbnet.se) (Remote host closed the connection)
22:27:55 econo_ joins (uid147250@id-147250.tinside.irccloud.com)
22:29:37 × merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds)
22:30:42 × target_i quits (~target_i@user/target-i/x-6023099) (Ping timeout: 252 seconds)
22:33:37 ystael joins (~ystael@user/ystael)
22:39:42 esph joins (~weechat@user/esph)
22:40:28 merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl)
22:43:32 × connrs quits (~connrs@user/connrs) (Quit: ZNC 1.9.1 - https://znc.in)
22:44:59 × merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds)
22:48:06 connrs joins (~connrs@user/connrs)
22:55:52 merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl)
22:57:21 × ystael quits (~ystael@user/ystael) (Ping timeout: 248 seconds)
22:58:10 <haskellbridge> <magic_rb> im writing a event sourcing system and i need a channel with the semantics of:
22:58:10 <haskellbridge> ... long message truncated: https://kf8nh.com/_heisenbridge/media/kf8nh.com/ZpxKULZbBMxcIbDRETdKUiGp/m2LCtTKP5Ac (3 lines)
22:58:28 <haskellbridge> <magic_rb> of course this means a thread can miss an event, but thats a problem for another day
22:58:40 <haskellbridge> <magic_rb> anyone know a channel/queue with these semantics?
22:58:45 ThePenguin joins (~ThePengui@cust-95-80-24-166.csbnet.se)
22:58:46 × ThePenguin quits (~ThePengui@cust-95-80-24-166.csbnet.se) (Remote host closed the connection)
22:59:21 ThePenguin joins (~ThePengui@cust-95-80-24-166.csbnet.se)
22:59:30 × ThePenguin quits (~ThePengui@cust-95-80-24-166.csbnet.se) (Remote host closed the connection)
23:00:34 × biberao quits (~m@user/biberao) (Quit: WeeChat 3.8)
23:00:44 × merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 264 seconds)
23:04:16 × Square2 quits (~Square@user/square) (Remote host closed the connection)
23:05:16 × esph quits (~weechat@user/esph) (Quit: WeeChat 4.5.1)
23:05:32 esph joins (~weechat@user/esph)
23:05:52 omegatron joins (~some@user/omegatron)
23:06:49 Square joins (~Square@user/square)
23:07:56 × esph quits (~weechat@user/esph) (Client Quit)
23:07:57 × peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 276 seconds)
23:08:01 × acidjnk_new quits (~acidjnk@p200300d6e7283f68a1608a41cd6a32b2.dip0.t-ipconnect.de) (Ping timeout: 248 seconds)
23:08:17 esph joins (~weechat@user/esph)
23:09:12 <geekosaur> https://downloads.haskell.org/ghc/latest/docs/libraries/stm-2.5.3.1-9996/Control-Concurrent-STM-TChan.html#v:newBroadcastTChan ?
23:09:43 <geekosaur> don't think it supports #2 though
23:09:57 <geekosaur> I'm not aware of a channel type that supports both of those
23:11:14 merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl)
23:11:21 <EvanR> attach a timestamp to each event and use this to filter out events "in the past" you want to ignore
23:11:56 × esph quits (~weechat@user/esph) (Client Quit)
23:12:07 <geekosaur> that'd pretty much be it, otherwise the writer would need to know what threads were blocked so it could deliver the event only to them
23:12:23 <EvanR> where timestamp is like, the applications globally agreed incrementing counter defining time
23:12:38 <haskellbridge> <magic_rb> i dont know if i even need 2 to be honest
23:12:56 <haskellbridge> <magic_rb> the only issue i can see is if "TChan" is never read from, then it'll pile up
23:13:01 <c_wraith> Honestly, this seems like something easy enough to do yourself
23:13:16 <haskellbridge> <geekosaur> I don't think TBChan has a broadcast variant
23:13:23 <c_wraith> You'd want to be a little careful with finalizers so that things don't leak, though
23:13:31 <haskellbridge> <magic_rb> I'm also kind of having issues with "the channels are per _what_"
23:13:33 <EvanR> if no one is reading from a broadcast tchan then the event goes into the ether
23:13:34 <haskellbridge> <geekosaur> er, TBQueue
23:13:49 <haskellbridge> <magic_rb> EvanR: i mean from one of the dupchans
23:15:31 <haskellbridge> <magic_rb> the only real reason why i have to bother with "channels are per what" is because they have buffers. If 2. was satisfied i wouldn't have to bother with "per what"
23:16:04 <haskellbridge> <magic_rb> ie whenever a thread tries to read from the channel, it throws its hat in the ring and waits for an event, simple
23:17:38 <geekosaur> sadly I think the only way you can accomplish that without the event sender knowing is for only one reader to be awakened
23:17:55 <haskellbridge> <magic_rb> the event sender can know, i think
23:18:03 <geekosaur> (where the choice of which depends on the implementation and may e.g. be thundering herd)
23:18:06 × __monty__ quits (~toonn@user/toonn) (Quit: leaving)
23:18:11 <hololeap> it sounds a lot like ghc's sparks system to me
23:18:17 <haskellbridge> <magic_rb> i want this to be eventually extendable across multiple machines, think kafka
23:18:21 × merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 276 seconds)
23:18:35 × saulosilva quits (~saulosilv@181.216.220.21) (Quit: Client closed)
23:18:48 <c_wraith> well then you're just entering a world of different complications and should use an existing complicated product
23:18:51 <geekosaur> then I wouldn't even start with any of ghc's channels
23:19:03 <geekosaur> or, what c_wraith said
23:19:28 <geekosaur> you're better off using an existing cross-machine messaging system
23:19:31 <hololeap> yeah I wasn't suggesting that just thinking about it
23:20:06 <haskellbridge> <magic_rb> im not going to implement kafka myself, but for the single machine situation which is what im focusing on, i need something with the same semantics
23:20:15 <haskellbridge> <magic_rb> dont feel like throwing kafka immediately into this mess
23:21:09 <haskellbridge> <magic_rb> so i need something which behaves like a "whatever kafka is" (the term eludes me right now) but on a single machine
23:22:53 esph joins (~weechat@user/esph)
23:23:10 acidjnk_new joins (~acidjnk@p200300d6e7283f68a1608a41cd6a32b2.dip0.t-ipconnect.de)
23:24:26 <hololeap> I think EvanR's idea along with TChan could work even if it's a bit of a kludge
23:24:28 <c_wraith> I mean, if you're dropping the "receive past events" part, you don't have most of the complexities of a channel
23:24:38 × hgolden quits (~hgolden@2603:8000:9d00:3ed1:6ff3:8389:b901:6363) (Remote host closed the connection)
23:25:14 × sabathan quits (~sabathan@acaen-652-1-335-197.w83-115.abo.wanadoo.fr) (Ping timeout: 272 seconds)
23:27:51 <hololeap> there's also FRP, where events affect every defined behavior as they happen in real time, and new behaviors that are brought online can attach to existing events without affecting other existing behaviors
23:27:53 saulosilva joins (~saulosilv@181.216.220.21)
23:28:09 <hololeap> which might be what you're looking for?
23:28:22 <hololeap> sorry, I suck at explaining technical things
23:29:17 merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl)
23:29:31 hgolden joins (~hgolden@2603:8000:9d00:3ed1:6ff3:8389:b901:6363)
23:30:20 <haskellbridge> <magic_rb> im familiar with the concept of FRP, though im not sure that it applies here nor do i want to open that can of worms
23:30:32 <haskellbridge> <magic_rb> i need to get something functional-ish quite quickly
23:30:53 <haskellbridge> <magic_rb> so ill do the minimum of a event sourcing architecture and see where that takes me
23:32:27 <haskellbridge> <magic_rb> hololeap: seeing past events doesnt matter, its just wholly unnecessary, since the channel might get duped right after the event youre interested in happened and so you need to first check the database anyway
23:33:21 <haskellbridge> <magic_rb> right, what i want is a lastEvent MVar and some kind of thundering herd inducing semaphore
23:33:57 × merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds)
23:34:17 vanishingideal joins (~vanishing@user/vanishingideal)
23:34:18 <hololeap> speaking of, this looks interesting: https://github.com/turion/rhine
23:34:51 <hololeap> > Haskell Functional Reactive Programming framework with type-level clocks
23:34:53 <lambdabot> <hint>:1:56: error: parse error on input ‘type’
23:37:35 <c_wraith> magic_rb: like, https://paste.tomsmeding.com/ov7bxeMa seems like it meets your requirements. It's a *lot* easier when you don't need the channel semantics.
23:37:41 <haskellbridge> <magic_rb> what i could do, which is kinda cursed is have two semaphores when a thread goes to emit an event it swaps them and awakes everyone on the "active" one, which then becomes the inactive
23:38:12 <hololeap> magic_rb, just found this. not sure if it fits the bill: https://hackage.haskell.org/package/broadcast-chan
23:38:47 <c_wraith> hololeap: single-wakeup is not "all waiting threads receive the value"
23:39:33 dysthesis joins (~dysthesis@user/dysthesis)
23:41:24 <haskellbridge> <magic_rb> c_wraith: the docs suggest that all readers will read any one written value, so im not sure what that package does actually
23:41:38 <hololeap> in the docs it says: BroadcastChan In: Will receive all messages written to the channel after this read end is created.
23:41:38 <haskellbridge> <magic_rb> BroadcastChan In: Will receive all messages written to the channel after this read end is created.
23:41:44 <hololeap> lol
23:42:25 <haskellbridge> <magic_rb> so thats quite close it'll still accumulate messages in the read ends if no one reads them, so the solution there is to create a read end and then immediately discard it after you no longer are actively reading
23:42:35 <c_wraith> magic_rb: anyway, take a look at my suggestion. If you think of it more like a live broadcast than a message queue, it becomes a lot simpler. Also a lot less useful - there's never a guarantee someone will receive the message.
23:42:45 <haskellbridge> <magic_rb> which is essentially what c_wraith solution does
23:43:33 <haskellbridge> <magic_rb> yeah i might go with your implementation, its neatly simple and ill need the "check the state, await state change" implementation anyway, so i dont care about lost events
23:44:16 <haskellbridge> <magic_rb> i appreciate the help from everyone, i gotta go hit the hay
23:44:23 sabathan joins (~sabathan@acaen-652-1-335-197.w83-115.abo.wanadoo.fr)
23:44:40 merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl)
23:45:19 <haskellbridge> <magic_rb> if anyone's curious about the current state of things: https://git.redalder.org/magic_rb/haci
23:45:25 <hololeap> gn
23:47:29 × saulosilva quits (~saulosilv@181.216.220.21) (Quit: Client closed)
23:49:05 × merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds)
23:55:16 merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl)
23:57:39 Tuplanolla joins (~Tuplanoll@91-159-69-59.elisa-laajakaista.fi)
23:58:10 × ljdarj quits (~Thunderbi@user/ljdarj) (Ping timeout: 272 seconds)
23:59:53 ThePenguin joins (~ThePengui@cust-95-80-24-166.csbnet.se)

All times are in UTC on 2025-01-08.