Home liberachat/#haskell: Logs Calendar

Logs on 2025-02-12 (liberachat/#haskell)

00:00:06 × peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 246 seconds)
00:00:37 <ski> as long as the instance is given in the same scope as the data type, i think there'd be no issue with coherence
00:00:57 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
00:01:14 peterbecich joins (~Thunderbi@syn-047-229-123-186.res.spectrum.com)
00:01:39 ljdarj1 joins (~Thunderbi@user/ljdarj)
00:01:55 <dminuoso> At least for `data` GHC would have to drag the type in interface files in case of inlining.
00:01:57 <ski> perhaps it would be nice to have two variants, one requiring uniqueness, and the other not .. i dunno
00:02:09 <dminuoso> At that point I'm not too sure what benefit you would gain.
00:02:11 <ski> mm
00:02:24 <ski> benefit over what ?
00:02:35 <dminuoso> A module level type
00:02:38 <ski> ah
00:02:41 <EvanR> dminuoso, it's really nice not having to worry about incoherent instances
00:03:05 <ski> well, avoiding needing to parameterize over nonlocal tyvars, at least
00:03:18 <dminuoso> EvanR: I've been using orphan instances a plenty lot without having any occurence of that.
00:03:19 <EvanR> code A sees instance B while code C sees instance D of the same typeclass on the same type
00:03:49 <dminuoso> EvanR: Note, Im not talking about forcing automatic instance resolution.
00:04:08 <dminuoso> If we had the freedom to just say "Dont resolve, Ill decide here locally", much of the incoherence problems disappear.
00:04:34 <EvanR> other languages have mechanisms for using explicit instances and there comes with it the additional cognitive overhead
00:04:38 <dminuoso> I mean writing newtypes with custom instances, and then selecting those instances is not a problem either.
00:04:57 <EvanR> just like using imperative programming everywhere where it wouldn't help 99% of the time
00:05:15 <dminuoso> If we had a mechanism of dict application that just skipped the instance resolution, the big benefit would be not having to wrap through newtype just for force instance selection
00:05:21 × ljdarj quits (~Thunderbi@user/ljdarj) (Ping timeout: 246 seconds)
00:05:21 ljdarj1 is now known as ljdarj
00:05:37 <EvanR> code A sees instance B while code C sees instance D of the same typeclass on the same type
00:05:45 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 276 seconds)
00:05:47 <dminuoso> EvanR: Yes, and this is not a problem with newtype either.
00:05:52 <EvanR> (when someone didn't expect this)
00:06:09 <EvanR> I know, newtypes are great
00:06:31 <EvanR> just slapping the newtype constructor activates the special behavior
00:06:51 <EvanR> and no one is surprised
00:08:17 <dminuoso> The one thing is just, that if you have `f :: forall a. Show a => ...` you know that f cant possibly use any newtype wrappers to swap out the Show instance because of parametricity.
00:08:26 <dminuoso> Or well, except for those versions that do silly things
00:08:33 <dminuoso> Say `newtype UppercaseShow ...`
00:08:43 <dminuoso> Or `newtype SortAfterShow ...`
00:09:00 <dminuoso> So dunno, feels like incoherence is already upon us,.
00:09:05 <EvanR> yeah I have dumb newtypes specifically to change the show instance
00:09:38 <EvanR> but Show type issues are a separate ergonomic issue from type class mechanisms I think
00:10:30 <EvanR> anyway solid abstractions that are actually solid is great as long as you can do what you need to do with it
00:10:34 <dminuoso> I think its quite related.
00:10:49 × peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 260 seconds)
00:10:58 <EvanR> if the solid abstraction isn't doing what you want, the answer is probably not to break the abstraction for everyone, just don't use this abstraction
00:11:28 <dminuoso> When you have only a single typeclass for "turn this thing into human text" that widely exists, but there's this large mismatch between "produce some nice legible string" and "produce valid haskell expressions"...
00:11:32 <EvanR> that's like every other language, they never got to the point of having solid abstractions because they felt it was necessary to shoehorn stuff and hammer a screw with it
00:11:33 <dminuoso> It's a matter of not having the choice.
00:11:37 Sgeo joins (~Sgeo@user/sgeo)
00:11:46 <EvanR> Show is stupid for other reasons
00:11:49 <dminuoso> Since you are forced to do one of them, authors will just do - and they dont agree.
00:12:01 <EvanR> it's not a good thing to base the entire type class system, or break the whole system over
00:12:29 dtman34 joins (~dtman34@2601:447:d000:1f5e:74c2:4ec:de8d:13d3)
00:12:30 <dminuoso> typeclasses certainly are not the reason Im using Haskell.
00:12:47 <EvanR> haskell would be much more of a pain in the ass without it though
00:12:56 <EvanR> if it just didn't have type classes
00:13:46 <EvanR> the cases for which it was invented, it really shines there
00:14:10 <ski> (`Show' and `Read' are not for custom formatting. the instances on different types are meant to play together (`instance Show a => Show (Maybe a)',&c.). this, imho means that if your instance doesn't use valid Haskell source code format (either data constructors, or exported abstract operations), your instance is bad)
00:14:14 <EvanR> for other purposes it might not be the best tool
00:14:32 <EvanR> and if there's a better tool we can invent that other tool
00:14:43 <dminuoso> ski: That was the original intent some decades ago. The reality of hackage tells a different story.
00:15:04 <ski> yes. i see no reason to abandon that vision, still
00:15:12 <dminuoso> Im not convinced calling those instances "bad" is sensible at this point.
00:15:28 <EvanR> I just ignore Show and wish that the interactive interpreter could just show anything without any code or deriving, and this one off feature
00:16:18 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
00:16:42 <EvanR> the example of forall a . Show a => being inflexible, this would be much better just as "pass in a string instead of using a constraint"
00:16:55 <EvanR> like most examples of trying to save or restore Show instances
00:17:13 <EvanR> just pass the string form (lazily perhaps, if you might not use it)
00:17:58 <EvanR> an extreme example of manually passing a dictionary, but it's pretty doable for 1 string
00:20:54 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 260 seconds)
00:21:29 × Googulator quits (~Googulato@2a01-036d-0106-4074-758c-12a1-cbb4-05eb.pool6.digikabel.hu) (Quit: Client closed)
00:21:46 Googulator joins (~Googulato@2a01-036d-0106-4074-758c-12a1-cbb4-05eb.pool6.digikabel.hu)
00:25:06 × xff0x quits (~xff0x@2405:6580:b080:900:36c:449b:42ad:5dc6) (Ping timeout: 252 seconds)
00:25:32 × euouae quits (~euouae@user/euouae) ()
00:31:42 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
00:34:52 alfiee joins (~alfiee@user/alfiee)
00:38:13 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds)
00:39:17 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 252 seconds)
00:45:02 × szkl quits (uid110435@id-110435.uxbridge.irccloud.com) (Quit: Connection closed for inactivity)
00:48:37 <Leary> kaol: If your ghc is recent enough, you have "multi-repl"; you can list multiple components or just do `cabal repl all`. For older GHC and ghciwatch, which don't support it, there's a nice way to write your cabal file such that you have a `dev` component that effectively combines the others without interfering with them: https://gist.github.com/LSLeary/6551f1dc3e25fe0d0d629b4ddb385359
00:48:45 × attk quits (~attk@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca) (Remote host closed the connection)
00:49:44 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
00:54:50 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 268 seconds)
00:56:36 zungi joins (~tory@user/andrewchawk)
01:02:51 × acidjnk_new3 quits (~acidjnk@p200300d6e7283f949088022741b454a0.dip0.t-ipconnect.de) (Ping timeout: 268 seconds)
01:03:15 califax_ joins (~califax@user/califx)
01:04:24 × califax quits (~califax@user/califx) (Ping timeout: 264 seconds)
01:04:27 califax_ is now known as califax
01:05:05 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
01:09:37 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds)
01:11:09 xff0x joins (~xff0x@fsb6a9491c.tkyc517.ap.nuro.jp)
01:12:10 <monochrom> About Show. Rust learned from us and have two such type classes instead of one.
01:13:05 <monochrom> More precisely, learned from our quarrels. :)
01:13:31 <zungi> monochrom: Can you summarize the Rust situation?
01:13:35 × sprotte24 quits (~sprotte24@p200300d16f05dc00448362a75cf21d07.dip0.t-ipconnect.de) (Read error: Connection reset by peer)
01:13:54 <monochrom> Yes. It has two such type classes instead of one. :)
01:14:25 <zungi> Hey, Haskell has two typeclasses, too; Haskell has Read and Show. zo'o sai
01:14:52 × rvalue quits (~rvalue@user/rvalue) (Read error: Connection reset by peer)
01:15:01 <monochrom> OK OK. One type class is for end-users, the other is for debugging messages.
01:15:26 kitties is now known as Catty
01:15:31 rvalue joins (~rvalue@user/rvalue)
01:15:31 <zungi> Thank you, monochrom.
01:15:59 <monochrom> more precisely, debugging messages for devs.
01:16:31 × Googulator quits (~Googulato@2a01-036d-0106-4074-758c-12a1-cbb4-05eb.pool6.digikabel.hu) (Quit: Client closed)
01:16:45 Googulator joins (~Googulato@2a01-036d-0106-4074-758c-12a1-cbb4-05eb.pool6.digikabel.hu)
01:18:07 <monochrom> I actually forgot whether Rust has anything like our Read.
01:20:27 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
01:22:37 alfiee joins (~alfiee@user/alfiee)
01:24:48 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 246 seconds)
01:26:58 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 252 seconds)
01:28:33 × Tuplanolla quits (~Tuplanoll@91-159-69-59.elisa-laajakaista.fi) (Quit: Leaving.)
01:31:19 Smiles joins (uid551636@id-551636.lymington.irccloud.com)
01:32:59 × L29Ah quits (~L29Ah@wikipedia/L29Ah) (Read error: Connection timed out)
01:35:49 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
01:35:56 × weary-traveler quits (~user@user/user363627) (Remote host closed the connection)
01:38:29 × machinedgod quits (~machinedg@d108-173-18-100.abhsia.telus.net) (Ping timeout: 248 seconds)
01:40:10 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
01:40:21 tri joins (~tri@ool-44c70bcb.dyn.optonline.net)
01:44:02 × ystael quits (~ystael@user/ystael) (Quit: Lost terminal)
01:44:54 × tri quits (~tri@ool-44c70bcb.dyn.optonline.net) (Ping timeout: 260 seconds)
01:46:24 × piele quits (~piele@eiseth.creativeserver.net) (Ping timeout: 252 seconds)
01:46:53 piele joins (~piele@eiseth.creativeserver.net)
01:48:22 <haskellbridge> <zungi (it/its)> zungi: test
01:49:46 <geekosaur> pass
01:51:13 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
01:52:42 × zungi quits (~tory@user/andrewchawk) (Quit: WeeChat 4.4.2)
01:53:49 zungi joins (~tory@user/andrewchawk)
01:55:34 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
01:57:59 <EvanR> monochrom, end-users want to see a plain text version of their data?
01:58:16 <EvanR> EULA agreers tend to want fancy graphics
01:59:15 <monochrom> Just look at end-users of IRC. >:)
01:59:32 <EvanR> debugging by having a built-in don't-have-to-implement-or-even-derive functionality for anything in the language automatically seems to work for many languages
02:00:13 <EvanR> on the other hand, when you see a "character" in C, there are at least 3 different textual forms you might want to see for debugging
02:00:24 <EvanR> in which case you'd need 3 typeclasses just for that
02:00:28 <EvanR> according to this theory
02:06:36 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
02:12:01 alfiee joins (~alfiee@user/alfiee)
02:13:10 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
02:13:29 × remmie quits (ianremsen@tilde.team) (Ping timeout: 260 seconds)
02:16:28 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 252 seconds)
02:24:39 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
02:25:17 lol_ is now known as jcarpenter2
02:28:56 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
02:37:43 weary-traveler joins (~user@user/user363627)
02:40:01 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
02:44:37 remmie joins (ianremsen@tilde.team)
02:44:49 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 260 seconds)
02:55:24 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
02:56:43 ColinRobinson is now known as JuanDaugherty
02:59:44 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
03:01:05 alfiee joins (~alfiee@user/alfiee)
03:03:43 tri joins (~tri@ool-44c70bcb.dyn.optonline.net)
03:05:14 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 252 seconds)
03:08:01 × tri quits (~tri@ool-44c70bcb.dyn.optonline.net) (Ping timeout: 248 seconds)
03:08:45 JuanDaugherty is now known as ColinRobinson
03:10:46 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
03:12:25 <albet70> what's the function name that return the first no-failed value, like f Just 3 Nothing == Just 3
03:12:41 <albet70> f Nothing (Just 3) == Just 3
03:12:51 <albet70> f Nothing Nothing == Nothing
03:13:22 <albet70> :t or
03:13:23 <lambdabot> Foldable t => t Bool -> Bool
03:14:16 <monochrom> > Just 3 <|> Nothing
03:14:17 <lambdabot> Just 3
03:14:23 <monochrom> > Nothing <|> Just 5
03:14:25 <lambdabot> Just 5
03:14:32 <monochrom> I think that's what you want.
03:15:00 <albet70> > Nothing <|> Nothing
03:15:02 <lambdabot> Nothing
03:15:17 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
03:15:34 <albet70> aha, python or operator is Haskell's<|>
03:16:18 <jackdk> Depending on whether you want to consider two items or several, you can use `asum` instead of repeated applications of `(<|>)`
03:17:58 <monochrom> That theory can hold up for a little while until you have Python "my_list or my_number" and then suddenly Haskell "my_list <|> my_number" is a type error.
03:19:36 <albet70> haha
03:21:23 machinedgod joins (~machinedg@d108-173-18-100.abhsia.telus.net)
03:21:39 <albet70> what's the opposite of <|>? f Nothing Just 3 == Nothing
03:21:53 <albet70> f Just 3 Nothing== Nothing
03:22:10 <albet70> f Just1 Just2 == Just2
03:23:27 <monochrom> I don't know what opposite means. Can you show all 4 cases?
03:23:52 <albet70> forgot opposite, my bad English
03:24:16 <albet70> f Nothing (Just 3) == Just 3
03:24:19 peterbecich joins (~Thunderbi@syn-047-229-123-186.res.spectrum.com)
03:24:28 <albet70> wrong
03:26:11 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
03:27:10 <albet70> > Just 3 *> Nothing
03:27:12 <lambdabot> Nothing
03:27:47 lockywolf joins (~lockywolf@213.165.252.237)
03:27:47 <albet70> *> is and operator in python
03:30:27 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 246 seconds)
03:33:17 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
03:37:57 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds)
03:39:45 × Smiles quits (uid551636@id-551636.lymington.irccloud.com) (Quit: Connection closed for inactivity)
03:42:09 tavare joins (~tavare@user/tavare)
03:44:46 × ColinRobinson quits (~juan@user/JuanDaugherty) (Quit: praxis.meansofproduction.biz (juan@acm.org))
03:45:11 <hololeap> > Just 2 *> Just 3
03:45:13 <lambdabot> Just 3
03:45:21 <hololeap> > Just 2 <* Just 3
03:45:22 <lambdabot> Just 2
03:46:09 <zungi> > 9 + 10
03:46:11 <lambdabot> 19
03:46:23 <zungi> Thank God.
03:46:40 <zungi> xo'o
03:48:07 × peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 268 seconds)
03:48:34 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
03:48:42 tri joins (~tri@ool-44c70bcb.dyn.optonline.net)
03:49:28 alfiee joins (~alfiee@user/alfiee)
03:50:26 <hololeap> albet70: liftA2 is closer to "and" IMO
03:51:09 <hololeap> > liftA2 (,) (Just 2) (Just 3)
03:51:10 <lambdabot> Just (2,3)
03:51:15 <hololeap> > liftA2 (,) Nothing (Just 3)
03:51:16 <lambdabot> Nothing
03:51:18 <hololeap> etc
03:53:38 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 252 seconds)
03:53:45 <albet70> :t >>
03:53:46 <lambdabot> error: parse error on input ‘>>’
03:54:03 <albet70> :t (>>)
03:54:04 <lambdabot> Monad m => m a -> m b -> m b
03:55:25 <albet70> >> *> looks so similar
03:57:54 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 260 seconds)
04:01:20 × skylord5816 quits (~skylord58@user/skylord5816) (Remote host closed the connection)
04:02:00 × Googulator quits (~Googulato@2a01-036d-0106-4074-758c-12a1-cbb4-05eb.pool6.digikabel.hu) (Quit: Client closed)
04:02:15 Googulator joins (~Googulato@2a01-036d-0106-4074-758c-12a1-cbb4-05eb.pool6.digikabel.hu)
04:08:32 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
04:12:49 lunitur joins (~lunitur@86.33.95.148)
04:13:04 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
04:18:40 <c_wraith> yes, (>>) predates the implementation of the applicative-monad proposal
04:22:31 peterbecich joins (~Thunderbi@syn-047-229-123-186.res.spectrum.com)
04:22:53 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
04:23:53 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
04:25:10 × vanishingideal quits (~vanishing@user/vanishingideal) (Ping timeout: 252 seconds)
04:27:13 vanishingideal joins (~vanishing@user/vanishingideal)
04:27:42 × yegorc quits (~yegorc@user/yegorc) (Quit: Leaving)
04:29:14 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 260 seconds)
04:38:12 alfiee joins (~alfiee@user/alfiee)
04:39:39 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
04:42:25 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 248 seconds)
04:44:13 × Googulator quits (~Googulato@2a01-036d-0106-4074-758c-12a1-cbb4-05eb.pool6.digikabel.hu) (Quit: Client closed)
04:44:14 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
04:50:02 aforemny_ joins (~aforemny@2001:9e8:6cc1:2800:a5a5:c3e6:116b:76ba)
04:50:14 × aforemny quits (~aforemny@i59F4C4A3.versanet.de) (Ping timeout: 260 seconds)
04:55:02 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
04:59:33 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds)
05:00:44 × peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 260 seconds)
05:02:29 × eL_Bart0 quits (eL_Bart0@dietunichtguten.org) (Ping timeout: 260 seconds)
05:10:24 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
05:15:02 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
05:25:46 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
05:25:57 × lockywolf quits (~lockywolf@213.165.252.237) (Ping timeout: 246 seconds)
05:26:12 peterbecich joins (~Thunderbi@syn-047-229-123-186.res.spectrum.com)
05:26:57 alfiee joins (~alfiee@user/alfiee)
05:29:52 × prasad quits (~Thunderbi@2601:243:c001:3f07::5c) (Ping timeout: 268 seconds)
05:31:39 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 260 seconds)
05:32:33 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds)
05:36:18 × machinedgod quits (~machinedg@d108-173-18-100.abhsia.telus.net) (Ping timeout: 252 seconds)
05:40:12 michalz joins (~michalz@185.246.207.203)
05:49:22 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
05:52:21 × Flow quits (~none@gentoo/developer/flow) (Ping timeout: 252 seconds)
05:55:46 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 268 seconds)
05:56:43 Flow joins (~none@gentoo/developer/flow)
06:06:14 <hololeap> I need a container that can store an arbitrary type and "heal" after popping a random element out. there will be about 2000 indices max. any suggestions? Sequence perhaps?
06:06:19 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
06:08:35 <c_wraith> Sequence is a decent stopgap for that, unless there are additional properties that give you something more directly useful
06:10:35 × wootehfoot quits (~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer)
06:10:40 <hololeap> basically, I build up a list/collection/etc of items, then perform an action on a random one and repeat, never performing the action on the same item twice
06:11:37 <c_wraith> that's a shuffle
06:13:13 <c_wraith> like, within those specific confines... I'd generate them in... anything Foldable, really. Then stuff them into an ST array to run a fisher-yates shuffle and extract the results as a list.
06:13:56 <hololeap> ok
06:15:10 <hololeap> @hackage list-shuffle -- I did find this
06:15:10 <lambdabot> https://hackage.haskell.org/package/list-shuffle -- I did find this
06:15:30 <hololeap> looks pretty good
06:15:34 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 260 seconds)
06:15:42 <c_wraith> hey, that does the stuffing into ST and extracting for you
06:16:18 <c_wraith> (as well as the shuffling)
06:17:18 × zungi quits (~tory@user/andrewchawk) (Remote host closed the connection)
06:17:20 alfiee joins (~alfiee@user/alfiee)
06:17:25 takuan joins (~takuan@d8D86B601.access.telenet.be)
06:17:48 zungi joins (~tory@user/andrewchawk)
06:21:37 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 248 seconds)
06:22:09 × ZLima12 quits (~zlima12@user/meow/ZLima12) (Remote host closed the connection)
06:23:18 ZLima12 joins (~zlima12@user/meow/ZLima12)
06:23:56 × tri quits (~tri@ool-44c70bcb.dyn.optonline.net) (Remote host closed the connection)
06:26:08 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
06:27:00 Square2 joins (~Square4@user/square)
06:27:20 tnt2 joins (~Thunderbi@user/tnt1)
06:28:44 × tnt1 quits (~Thunderbi@user/tnt1) (Ping timeout: 252 seconds)
06:30:12 tnt1 joins (~Thunderbi@user/tnt1)
06:30:34 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
06:31:40 × tnt2 quits (~Thunderbi@user/tnt1) (Ping timeout: 252 seconds)
06:35:12 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
06:37:53 × ft quits (~ft@p4fc2a610.dip0.t-ipconnect.de) (Quit: leaving)
06:39:44 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
06:46:03 robobub joins (uid248673@id-248673.uxbridge.irccloud.com)
06:50:34 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
06:54:09 acidjnk_new3 joins (~acidjnk@p200300d6e7283f80357462f87ee532d8.dip0.t-ipconnect.de)
06:55:36 × hgolden quits (~hgolden@2603:8000:9d00:3ed1:6ff3:8389:b901:6363) (Remote host closed the connection)
06:56:56 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
06:58:23 <dminuoso> What language settings does a GHCi invocation default to these days? GHC2021?
06:58:59 <dminuoso> It cant be Haskell2010 since geekosaur demonstrated earlier that DeepSubsumption is not on by default.
07:01:04 tri joins (~tri@ool-44c70bcb.dyn.optonline.net)
07:05:23 × tri quits (~tri@ool-44c70bcb.dyn.optonline.net) (Ping timeout: 252 seconds)
07:05:43 CiaoSen joins (~Jura@ip-037-201-241-067.um10.pools.vodafone-ip.de)
07:05:45 alfiee joins (~alfiee@user/alfiee)
07:10:09 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 248 seconds)
07:16:22 misterfish joins (~misterfis@84.53.85.146)
07:34:04 szkl joins (uid110435@id-110435.uxbridge.irccloud.com)
07:34:44 sawilagar joins (~sawilagar@user/sawilagar)
07:37:40 × tnt1 quits (~Thunderbi@user/tnt1) (Ping timeout: 252 seconds)
07:42:14 tnt1 joins (~Thunderbi@user/tnt1)
07:42:58 × nek0 quits (~nek0@user/nek0) (Quit: The Lounge - https://thelounge.chat)
07:43:10 × peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 252 seconds)
07:45:12 × weary-traveler quits (~user@user/user363627) (Remote host closed the connection)
07:47:13 merijn joins (~merijn@77.242.116.146)
07:47:56 eL_Bart0 joins (eL_Bart0@dietunichtguten.org)
07:48:04 sord937 joins (~sord937@gateway/tor-sasl/sord937)
07:48:12 tnt2 joins (~Thunderbi@user/tnt1)
07:48:36 × tnt1 quits (~Thunderbi@user/tnt1) (Ping timeout: 244 seconds)
07:48:36 tnt2 is now known as tnt1
07:53:29 alfiee joins (~alfiee@user/alfiee)
07:54:16 xdej joins (~xdej@quatramaran.salle-s.org)
07:54:17 tnt2 joins (~Thunderbi@user/tnt1)
07:54:48 × tnt1 quits (~Thunderbi@user/tnt1) (Ping timeout: 244 seconds)
07:54:48 tnt2 is now known as tnt1
07:56:27 <c_wraith> It's Haskell2021 in recent GHC
07:57:08 <dminuoso> What is Haskell2021?
07:57:29 <c_wraith> err. GHC2021.
07:57:33 <c_wraith> wires crossed
07:57:50 × CiaoSen quits (~Jura@ip-037-201-241-067.um10.pools.vodafone-ip.de) (Ping timeout: 252 seconds)
07:57:54 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 244 seconds)
07:58:01 <dminuoso> Oh, GHC2024 is a thing too nowadays.
07:58:14 <c_wraith> yes, but it's not a default in any current version of GHC
07:58:31 <dminuoso> The wording in the manual is a bit cute. [
07:58:35 <dminuoso> [
07:58:43 <dminuoso> Oh what is going on. My clipboard is acting up.
07:59:33 <dminuoso> In one part it says: "[GHC2024 is] suitable to be turned on by default", while indeed "Currently, GHC2021 is used by default [...]"
07:59:43 <dminuoso> See https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/control.html#controlling-editions-and-extensions
07:59:53 <c_wraith> I'm not sure 2024 actually *is* suitable as a default
08:00:01 × caconym quits (~caconym@user/caconym) (Quit: bye)
08:00:11 CiaoSen joins (~Jura@ip-037-201-241-067.um10.pools.vodafone-ip.de)
08:01:05 caconym joins (~caconym@user/caconym)
08:01:13 <c_wraith> Though the way in which it is lacking, GHC2021 is also lacking... Last I saw, there were plans to break up ScopedTypeVariables into multiple extensions because it's current kind of the extension for putting type variables anywhere
08:01:24 <dminuoso> Which extension do you disagree with the most in GHC2024?
08:02:20 tnt2 joins (~Thunderbi@user/tnt1)
08:02:21 <c_wraith> Well, I'm no fan of MonoLocalBinds. Which, yes, comes with GADTs
08:03:04 × tnt1 quits (~Thunderbi@user/tnt1) (Ping timeout: 244 seconds)
08:03:04 tnt2 is now known as tnt1
08:03:30 <c_wraith> But other than that, there's nothing in there that bugs me except the weird future of ScopedTypeVariables. Which 2021 also has to deal with.
08:05:39 × HappyNewYear2025 quits (~newyear@2.219.56.221) (Ping timeout: 244 seconds)
08:08:07 nek0 joins (~nek0@user/nek0)
08:09:13 tri joins (~tri@ool-44c70bcb.dyn.optonline.net)
08:09:14 sawilagar_ joins (~sawilagar@user/sawilagar)
08:09:25 × merijn quits (~merijn@77.242.116.146) (Ping timeout: 248 seconds)
08:09:42 florida joins (~florida@2a02:ab88:7200:6a00:762b:62ff:fe83:1a1b)
08:10:59 kaskal joins (~kaskal@2a02:8388:15bf:c200:b761:f798:cc12:a3c8)
08:11:20 pierrot joins (~pi@user/pierrot)
08:11:29 × GdeVolpiano quits (~GdeVolpia@user/GdeVolpiano) (Ping timeout: 260 seconds)
08:12:04 × sawilagar quits (~sawilagar@user/sawilagar) (Ping timeout: 260 seconds)
08:12:04 × pierrot_ quits (~pi@user/pierrot) (Ping timeout: 260 seconds)
08:12:04 × kaskal- quits (~kaskal@2a02:8388:15bf:c200:f01c:d173:579b:8db6) (Ping timeout: 260 seconds)
08:13:14 GdeVolpiano joins (~GdeVolpia@user/GdeVolpiano)
08:13:44 × tri quits (~tri@ool-44c70bcb.dyn.optonline.net) (Ping timeout: 265 seconds)
08:14:56 lisbeths joins (uid135845@id-135845.lymington.irccloud.com)
08:16:15 × florida quits (~florida@2a02:ab88:7200:6a00:762b:62ff:fe83:1a1b) (Quit: Leaving)
08:17:53 merijn joins (~merijn@77.242.116.146)
08:18:48 × stiell quits (~stiell@gateway/tor-sasl/stiell) (Ping timeout: 264 seconds)
08:19:06 stiell joins (~stiell@gateway/tor-sasl/stiell)
08:27:35 lortabac joins (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4)
08:29:21 × tavare quits (~tavare@user/tavare) (Read error: Connection reset by peer)
08:29:49 lockywolf joins (~lockywolf@213.165.252.157)
08:37:53 × AlexZenon quits (~alzenon@178.34.151.30) (Quit: ;-)
08:38:49 × AlexNoo quits (~AlexNoo@178.34.151.30) (Quit: Leaving)
08:38:53 × merijn quits (~merijn@77.242.116.146) (Ping timeout: 265 seconds)
08:42:20 merijn joins (~merijn@77.242.116.146)
08:42:21 × tzh quits (~tzh@c-76-115-131-146.hsd1.or.comcast.net) (Quit: zzz)
08:42:33 alfiee joins (~alfiee@user/alfiee)
08:42:48 × Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer)
08:47:04 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 260 seconds)
08:48:01 × califax quits (~califax@user/califx) (Remote host closed the connection)
08:49:32 califax joins (~califax@user/califx)
08:52:01 × lunitur quits (~lunitur@86.33.95.148) (Ping timeout: 248 seconds)
08:52:45 × lortabac quits (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4) (Read error: Connection reset by peer)
08:59:27 × califax quits (~califax@user/califx) (Remote host closed the connection)
08:59:30 lortabac joins (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4)
09:01:15 × notzmv quits (~umar@user/notzmv) (Ping timeout: 252 seconds)
09:01:54 califax joins (~califax@user/califx)
09:07:23 kuribas joins (~user@ip-188-118-57-242.reverse.destiny.be)
09:08:45 AlexNoo joins (~AlexNoo@178.34.151.30)
09:10:24 AlexZenon joins (~alzenon@178.34.151.30)
09:13:33 × merijn quits (~merijn@77.242.116.146) (Ping timeout: 244 seconds)
09:14:37 × califax quits (~califax@user/califx) (Remote host closed the connection)
09:15:41 califax joins (~califax@user/califx)
09:25:48 × lortabac quits (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4) (Quit: WeeChat 4.4.2)
09:30:17 alfiee joins (~alfiee@user/alfiee)
09:33:00 merijn joins (~merijn@77.242.116.146)
09:34:45 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 248 seconds)
09:44:02 chele joins (~chele@user/chele)
09:44:59 × xff0x quits (~xff0x@fsb6a9491c.tkyc517.ap.nuro.jp) (Ping timeout: 260 seconds)
10:03:01 lxsameer joins (~lxsameer@Serene/lxsameer)
10:03:06 tabaqui1 joins (~root@87.200.129.102)
10:08:35 ash3en joins (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207)
10:13:46 tri joins (~tri@ool-44c70bcb.dyn.optonline.net)
10:18:00 × tri quits (~tri@ool-44c70bcb.dyn.optonline.net) (Ping timeout: 252 seconds)
10:18:21 alfiee joins (~alfiee@user/alfiee)
10:20:22 Unicorn_Princess joins (~Unicorn_P@user/Unicorn-Princess/x-3540542)
10:22:57 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 252 seconds)
10:29:13 <geekosaur> it's GHC2021 in all versions that support it, even if they also support GHC2024
10:30:30 <geekosaur> IIRC 9.0+ do shallow subsumption (even before QuickLook landed) and there was no extension to disable it until later
10:32:23 rawles joins (~rawles@user/rawles)
10:37:21 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
10:37:29 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Client Quit)
10:38:18 × lockywolf quits (~lockywolf@213.165.252.157) (Read error: Connection reset by peer)
10:38:24 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
10:38:49 lockywolf joins (~lockywolf@213.165.252.157)
10:40:50 xff0x joins (~xff0x@2405:6580:b080:900:fa0c:e524:bc5c:8ead)
10:44:43 sprotte24 joins (~sprotte24@p200300d16f0a8e005c58c6c9b84f6b12.dip0.t-ipconnect.de)
10:52:14 × lockywolf quits (~lockywolf@213.165.252.157) (Read error: Connection reset by peer)
10:53:23 lockywolf joins (~lockywolf@213.165.252.157)
11:06:06 alfiee joins (~alfiee@user/alfiee)
11:08:05 × merijn quits (~merijn@77.242.116.146) (Ping timeout: 248 seconds)
11:08:42 × xff0x quits (~xff0x@2405:6580:b080:900:fa0c:e524:bc5c:8ead) (Ping timeout: 272 seconds)
11:08:49 × jcarpenter2 quits (~lol@2603:3016:1e01:b9c0:f7:4b70:33ec:27a0) (Ping timeout: 260 seconds)
11:10:23 jcarpenter2 joins (~lol@2603:3016:1e01:b9c0:dd5c:182b:d497:5a90)
11:10:34 × CiaoSen quits (~Jura@ip-037-201-241-067.um10.pools.vodafone-ip.de) (Ping timeout: 260 seconds)
11:10:44 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 260 seconds)
11:21:24 merijn joins (~merijn@77.242.116.146)
11:23:39 aforemny joins (~aforemny@2001:9e8:6cc4:e000:b3b9:f8f6:fb02:80e2)
11:24:15 × aforemny_ quits (~aforemny@2001:9e8:6cc1:2800:a5a5:c3e6:116b:76ba) (Ping timeout: 252 seconds)
11:28:11 × merijn quits (~merijn@77.242.116.146) (Ping timeout: 244 seconds)
11:31:20 merijn joins (~merijn@77.242.116.146)
11:38:22 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
11:47:54 × rvalue quits (~rvalue@user/rvalue) (Read error: Connection reset by peer)
11:48:25 rvalue joins (~rvalue@user/rvalue)
11:52:03 xff0x joins (~xff0x@2405:6580:b080:900:eaaa:e5a8:7fd2:7c37)
11:54:37 × sprotte24 quits (~sprotte24@p200300d16f0a8e005c58c6c9b84f6b12.dip0.t-ipconnect.de) (Read error: Connection reset by peer)
11:56:02 alfiee joins (~alfiee@user/alfiee)
12:00:17 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 248 seconds)
12:02:45 × Sciencentistguy quits (~sciencent@hacksoc/ordinary-member) (Ping timeout: 252 seconds)
12:06:35 Sciencentistguy joins (~sciencent@hacksoc/ordinary-member)
12:09:39 × gabiruh quits (~gabiruh@vps19177.publiccloud.com.br) (Ping timeout: 252 seconds)
12:12:36 dtman34_ joins (~dtman34@2601:447:d000:1f5e:74c2:4ec:de8d:13d3)
12:12:48 Smiles joins (uid551636@id-551636.lymington.irccloud.com)
12:13:10 × dtman34 quits (~dtman34@2601:447:d000:1f5e:74c2:4ec:de8d:13d3) (Ping timeout: 268 seconds)
12:21:20 gabiruh joins (~gabiruh@vps19177.publiccloud.com.br)
12:29:05 tnt2 joins (~Thunderbi@user/tnt1)
12:29:08 ash3en1 joins (~Thunderbi@146.70.124.222)
12:29:08 × ash3en quits (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) (Ping timeout: 272 seconds)
12:29:08 ash3en1 is now known as ash3en
12:29:09 × tnt1 quits (~Thunderbi@user/tnt1) (Ping timeout: 244 seconds)
12:29:09 tnt2 is now known as tnt1
12:34:24 lortabac joins (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4)
12:35:38 × mange quits (~user@user/mange) (Remote host closed the connection)
12:37:22 × lockywolf quits (~lockywolf@213.165.252.157) (Read error: Connection reset by peer)
12:37:40 lockywolf_ joins (~lockywolf@213.165.252.157)
12:41:52 × vanishingideal quits (~vanishing@user/vanishingideal) (Remote host closed the connection)
12:43:33 vanishingideal joins (~vanishing@user/vanishingideal)
12:43:59 × lortabac quits (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4) (Quit: WeeChat 4.4.2)
12:45:07 alfiee joins (~alfiee@user/alfiee)
12:49:19 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 252 seconds)
12:52:01 × vanishingideal quits (~vanishing@user/vanishingideal) (Remote host closed the connection)
12:53:24 L29Ah joins (~L29Ah@wikipedia/L29Ah)
12:53:48 vanishingideal joins (~vanishing@user/vanishingideal)
12:54:45 florida joins (~florida@2a02:ab88:7200:6a00:762b:62ff:fe83:1a1b)
12:58:15 <haskellbridge> <Profpatsch> duncan: do you have a document describing the design of the cborg decoder? I haven’t seen a parser like that before, with the split into DecodeAction and wrapping everything in ST
12:59:37 <haskellbridge> <Profpatsch> plus the split into fast and slow decoding loop depending on whether the parser hits a "read()" boundary
12:59:59 <haskellbridge> <Profpatsch> there’s a bunch of really cool tricks in there
13:02:00 jespada joins (~jespada@2800:a4:22f4:ae00:fc16:e598:5958:94e6)
13:02:10 Guest34 joins (~Guest34@96-8-132-1.block0.gvtc.com)
13:02:37 × Guest34 quits (~Guest34@96-8-132-1.block0.gvtc.com) (Client Quit)
13:05:18 <haskellbridge> <Profpatsch> "return $!" is another one that I have no clue how it makes things in ST work
13:09:01 ljdarj1 joins (~Thunderbi@user/ljdarj)
13:09:39 × ljdarj quits (~Thunderbi@user/ljdarj) (Ping timeout: 276 seconds)
13:09:39 ljdarj1 is now known as ljdarj
13:11:43 × florida quits (~florida@2a02:ab88:7200:6a00:762b:62ff:fe83:1a1b) (Quit: Leaving)
13:17:20 forell joins (~forell@user/forell)
13:21:41 × sawilagar_ quits (~sawilagar@user/sawilagar) (Quit: Leaving)
13:23:09 <haskellbridge> <Profpatsch> bgamari: ^ I guess same question :)
13:24:25 <haskellbridge> <Profpatsch> One more question: Stuff like https://hackage.haskell.org/package/cborg-0.2.10.0/docs/src/Codec.CBOR.Magic.html#withBsPtr uses unsafeDupablePerformIO, but all of these helpers are INLINE
13:24:38 <haskellbridge> <Profpatsch> Up to go_fast that is, which does not have any pragma
13:25:38 <haskellbridge> <Profpatsch> are these valid if they are allowed to be inlined? I guess go_fast acts as a natural boundary that is never inlined because of its size
13:25:40 <bgamari> Profpatch: I don't think it was ever written down
13:25:50 sawilagar joins (~sawilagar@user/sawilagar)
13:26:13 <haskellbridge> <Profpatsch> Haskell Unfolder? :P
13:26:21 <bgamari> a great suggestion
13:26:33 <haskellbridge> <Profpatsch> I could write down some questions
13:26:37 <bgamari> what concretely is the question about `return $!`?
13:26:44 <bgamari> sure, that would be a great source of inspiration
13:27:02 × Digit quits (~user@user/digit) (Read error: Connection reset by peer)
13:27:10 <haskellbridge> <Profpatsch> well I’m assuming "return $!" is used everywhere because you want to be strict in the return values in the ST
13:27:43 <bgamari> yes
13:27:47 Digit joins (~user@user/digit)
13:27:48 <haskellbridge> <Profpatsch> but even just an explanation of what needs to be strict and what doesn’t would be super helpful since it’s such a black art
13:27:59 <bgamari> fair enough
13:28:44 <bgamari> the short answer is: when you are parsing and can't incrementally consume the parsed result then you likely want to be strict
13:29:08 <bgamari> since you will gain nothing by suspending the work of the parsing (which is typically fairly "light" computationally)
13:30:00 <bgamari> regarding unsafeDupablePerformIO, the argument is that we "own" the bytestring and none of the operations under `withBsPtr` are side-effecting (e.g. writes)
13:30:46 <bgamari> so evaluation order is irrelevant (since the bytestring is immutable) and duplication doesn't change semantics (for the same reason)
13:31:15 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
13:31:16 <bgamari> indeed cborg is an interesting design (primarily Duncan's)
13:31:56 <bgamari> when people think of "high performance" parsing in Haskell they often resort of CPS'd style
13:32:36 <bgamari> since it optimises specific parsers reasonably well
13:32:54 <bgamari> in particular, intermediate structures can be deforested readily
13:34:10 <bgamari> but cborg shows that this isn't the only path to a decent parser
13:34:10 alfiee joins (~alfiee@user/alfiee)
13:35:22 <haskellbridge> <Profpatsch> I mean the decoupling of DecodeAction and actual decoding is super interesting
13:36:32 hgolden joins (~hgolden@2603:8000:9d00:3ed1:6ff3:8389:b901:6363)
13:38:54 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 260 seconds)
13:43:15 brachyrhynchos joins (~brachyrhy@user/brachyrhynchos)
13:49:17 × brachyrhynchos quits (~brachyrhy@user/brachyrhynchos) (Remote host closed the connection)
13:51:12 × zungi quits (~tory@user/andrewchawk) (Ping timeout: 264 seconds)
13:51:25 × forell quits (~forell@user/forell) (Quit: ZNC - https://znc.in)
13:52:26 forell joins (~forell@user/forell)
13:55:05 alp joins (~alp@5.226.4.112)
13:55:10 × alp quits (~alp@5.226.4.112) (Changing host)
13:55:10 alp joins (~alp@user/alp)
13:56:48 zungi joins (~tory@user/andrewchawk)
14:00:22 tri joins (~tri@ool-44c70bcb.dyn.optonline.net)
14:04:52 × tri quits (~tri@ool-44c70bcb.dyn.optonline.net) (Ping timeout: 252 seconds)
14:08:16 __monty__ joins (~toonn@user/toonn)
14:09:13 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
14:10:53 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
14:11:12 Crypt-Lab is now known as CryptLab
14:12:09 × misterfish quits (~misterfis@84.53.85.146) (Ping timeout: 260 seconds)
14:15:10 alp_ joins (~alp@5.226.4.112)
14:17:23 Wygulmage joins (~Wygulmage@user/Wygulmage)
14:17:54 × alp quits (~alp@user/alp) (Ping timeout: 248 seconds)
14:21:41 × merijn quits (~merijn@77.242.116.146) (Ping timeout: 248 seconds)
14:21:48 × albet70 quits (~xxx@2400:8905::f03c:92ff:fe60:98d8) (Ping timeout: 276 seconds)
14:21:54 × Smiles quits (uid551636@id-551636.lymington.irccloud.com) (Quit: Connection closed for inactivity)
14:22:55 alfiee joins (~alfiee@user/alfiee)
14:24:25 weary-traveler joins (~user@user/user363627)
14:26:57 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 244 seconds)
14:28:07 albet70 joins (~xxx@2400:8905::f03c:92ff:fe60:98d8)
14:30:15 Smiles joins (uid551636@id-551636.lymington.irccloud.com)
14:33:06 merijn joins (~merijn@77.242.116.146)
14:49:03 × zungi quits (~tory@user/andrewchawk) (Quit: BRB.)
14:56:22 zungi joins (~tory@user/andrewchawk)
14:59:24 ystael joins (~ystael@user/ystael)
15:01:39 × vanishingideal quits (~vanishing@user/vanishingideal) (Remote host closed the connection)
15:05:44 Sgeo joins (~Sgeo@user/sgeo)
15:06:43 Square joins (~Square@user/square)
15:10:33 × Square2 quits (~Square4@user/square) (Ping timeout: 276 seconds)
15:12:18 alfiee joins (~alfiee@user/alfiee)
15:16:54 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 260 seconds)
15:17:54 × jrm quits (~jrm@user/jrm) (Quit: ciao)
15:19:48 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Quit: = "")
15:22:57 vanishingideal joins (~vanishing@user/vanishingideal)
15:24:43 tri joins (~tri@ool-44c70bcb.dyn.optonline.net)
15:29:34 × tri quits (~tri@ool-44c70bcb.dyn.optonline.net) (Ping timeout: 260 seconds)
15:30:17 jrm joins (~jrm@user/jrm)
15:30:33 × jrm quits (~jrm@user/jrm) (Remote host closed the connection)
15:30:57 × ljdarj quits (~Thunderbi@user/ljdarj) (Ping timeout: 252 seconds)
15:32:02 jrm joins (~jrm@user/jrm)
15:35:53 × chele quits (~chele@user/chele) (Remote host closed the connection)
15:35:56 ljdarj joins (~Thunderbi@user/ljdarj)
15:38:58 × jespada quits (~jespada@2800:a4:22f4:ae00:fc16:e598:5958:94e6) (Quit: My Mac has gone to sleep. ZZZzzz…)
15:43:57 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
15:47:50 × jrm quits (~jrm@user/jrm) (Quit: ciao)
15:49:25 jrm joins (~jrm@user/jrm)
15:51:20 rekahsoft joins (~rekahsoft@bras-base-orllon1103w-grc-14-174-92-69-126.dsl.bell.ca)
16:00:04 alfiee joins (~alfiee@user/alfiee)
16:00:26 jespada joins (~jespada@2800:a4:22f4:ae00:fc16:e598:5958:94e6)
16:03:49 × ash3en quits (~Thunderbi@146.70.124.222) (Quit: ash3en)
16:04:05 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 244 seconds)
16:16:14 × alp_ quits (~alp@5.226.4.112) (Ping timeout: 260 seconds)
16:19:54 user363627 joins (~user@user/user363627)
16:20:54 × weary-traveler quits (~user@user/user363627) (Ping timeout: 252 seconds)
16:22:08 tri joins (~tri@ool-44c70bcb.dyn.optonline.net)
16:26:29 × tri quits (~tri@ool-44c70bcb.dyn.optonline.net) (Ping timeout: 248 seconds)
16:35:07 × biberu quits (~biberu@user/biberu) (Read error: Connection reset by peer)
16:42:25 × merijn quits (~merijn@77.242.116.146) (Ping timeout: 248 seconds)
16:45:39 <EvanR> is there a good way to explain what Char is. Yeah it's a character, but what are all the possible elements. "unicode" is how it's described in the report, but
16:46:31 <EvanR> Char not only allows non-characters but utf-16 surrogates, private use area,
16:50:15 YaShhhh joins (~YaShhhh@103.247.7.35)
16:50:25 <EvanR> "a fancy integer between zero and 1114111"?
16:51:01 × YaShhhh quits (~YaShhhh@103.247.7.35) (Client Quit)
16:53:30 alfiee joins (~alfiee@user/alfiee)
16:53:40 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
16:54:06 <c_wraith> "Unicode contains 1,114,112 code points; currently, characters are assigned to more than 96,000 of them." If that sentence is fully accurate, that would make Char a code point.
16:54:34 sprotte24 joins (~sprotte24@p200300d16f0a8e00790a95c75d7de89b.dip0.t-ipconnect.de)
16:57:56 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 252 seconds)
16:59:15 target_i joins (~target_i@user/target-i/x-6023099)
17:02:15 <geekosaur> :codepoint: is my understanding, yes
17:02:51 <geekosaur> the business with surrogates in Unicode code points is rather bizarre, tbh
17:03:52 yegorc joins (~yegorc@user/yegorc)
17:04:04 <geekosaur> I think that should have been a detail of UCS-2/UTF-16, not polluting the core concept of "code point"
17:08:11 × kuribas quits (~user@ip-188-118-57-242.reverse.destiny.be) (Remote host closed the connection)
17:09:22 ash3en joins (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207)
17:14:28 <geekosaur> hm. the Report doesn't specify what `Char` is beyond "a Unicode character" (IMO correctly), but the GHC manual doesn't explicitly state that its `Char` is a codepoint
17:15:04 <geekosaur> (a compliant implementation should be free to choose UTF-8 or UTF-16 imo)
17:17:53 Googulator joins (~Googulato@2a01-036d-0106-4074-f40d-d825-16f5-119a.pool6.digikabel.hu)
17:17:56 JuanDaugherty joins (~juan@user/JuanDaugherty)
17:19:17 × sarna quits (~sarna@d168-237.icpnet.pl) (Remote host closed the connection)
17:19:40 econo_ joins (uid147250@id-147250.tinside.irccloud.com)
17:19:45 <EvanR> the issue would have been some code points could not be encoded with UTF-16 if some codepoints weren't blocked out
17:20:17 <EvanR> if I'm not mistaken
17:20:22 sarna joins (~sarna@d168-237.icpnet.pl)
17:21:07 <geekosaur> it could have been designrd differently: UTF-8 doesn't have the same problem, it just ends up with potentially long encodings (IIRC up to 7, although in practice not more than 3-4 because the rest haven't been assigned yet?)
17:21:15 <EvanR> "a unicode character" was probably written back in the day, unicode since clarified what a character is (in several ways), but it ends up still making sense
17:21:40 prasad joins (~Thunderbi@c-73-75-25-251.hsd1.in.comcast.net)
17:22:44 <geekosaur> but, strictly speaking, is wrong because surrogates are not characters
17:25:01 <EvanR> and other non-characters
17:25:16 <EvanR> are literally not characters
17:25:42 <EvanR> like fffe
17:26:08 <EvanR> which is an integer, or codepoint. So "a fancy integer" seems yeah
17:26:32 × saimazoon quits (~hrtz@user/haritz) (Ping timeout: 252 seconds)
17:26:38 <EvanR> which is how C considers characters
17:26:46 <monochrom> To understand what Char is, first you have to understand what Unicode is. >:)
17:26:55 × Wygulmage quits (~Wygulmage@user/Wygulmage) (Quit: Client closed)
17:27:10 <EvanR> turns out once you understand what (latest) unicode is, Char makes less sense xD
17:27:22 <geekosaur> but then you have to understand all the stuff the Report didn't specify
17:27:35 <monochrom> I don't have absolute certainty that Char = codepoint, but I use that as a working theory and it works pretty well.
17:27:37 <geekosaur> (which is a shocking amount once you start digging into it…)
17:28:19 <EvanR> practically it seems to be in one to one correspondence with integers in the precise range of unicode's... codes
17:28:47 <geekosaur> oh, I found it. even though it's necessarily a compiler built-in, it's specified in library documentation https://downloads.haskell.org/ghc/latest/docs/libraries/base-4.21.0.0-8e62/Data-Char.html#t:Char
17:29:14 <monochrom> \∩/
17:29:24 <geekosaur> "The character type Char represents Unicode codespace and its elements are code points as in definitions D9 and D10 of the Unicode Standard."
17:30:09 <monochrom> It would have been entered into a new version of the Report, if only people bothered to form a committee for it.
17:30:13 <EvanR> that is almost the latest version of unicode being linked too
17:30:31 JuanDaugherty parts (~juan@user/JuanDaugherty) (Exeunt DS Producers)
17:30:49 <monochrom> So basically the Report bitrots and all the clarifications happen in library docs instead.
17:31:24 <EvanR> that provides an authoritative answer to my question
17:31:31 <monochrom> Hey, vote for me to be the absolute monarch, then I will make it happen! >:)
17:31:48 haritz joins (~hrtz@2a02:8010:65b5:0:5d9a:9bab:ee5e:b737)
17:31:50 × haritz quits (~hrtz@2a02:8010:65b5:0:5d9a:9bab:ee5e:b737) (Changing host)
17:31:50 haritz joins (~hrtz@user/haritz)
17:33:30 tzh joins (~tzh@c-76-115-131-146.hsd1.or.comcast.net)
17:35:47 <geekosaur> I still think the Report is the wrong place for it, implementations should be able to make their own decisions. ghc is kinda wrong in deferring it to library docs instead of compiler docs though
17:36:02 byorgey joins (~byorgey@155.138.238.211)
17:36:02 × byorgey quits (~byorgey@155.138.238.211) (Changing host)
17:36:02 byorgey joins (~byorgey@user/byorgey)
17:41:53 alfiee joins (~alfiee@user/alfiee)
17:44:38 peterbecich joins (~Thunderbi@syn-047-229-123-186.res.spectrum.com)
17:46:14 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 260 seconds)
17:47:22 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
17:47:50 × sord937 quits (~sord937@gateway/tor-sasl/sord937) (Quit: sord937)
17:48:51 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
17:51:54 × Smiles quits (uid551636@id-551636.lymington.irccloud.com) (Quit: Connection closed for inactivity)
17:52:59 <hololeap> weird. this works in 9.4 but in 9.8 it just causes my exe to spin forever: https://stackoverflow.com/a/41055988
17:53:21 × zungi quits (~tory@user/andrewchawk) (Quit: "Moving to other building...")
17:58:19 zungi joins (~tory@user/andrewchawk)
17:59:20 <hololeap> does anyone know of a library that has this functionality? (removing ANSI escape sequences from a ByteString (or Text))
18:01:11 rawles parts (~rawles@user/rawles) (WeeChat 3.8)
18:01:20 [tank] joins (~tank@213.18.138.85)
18:02:34 × lxsameer quits (~lxsameer@Serene/lxsameer) (Ping timeout: 260 seconds)
18:04:20 lxsameer joins (lxsameer@Serene/lxsameer)
18:07:37 Googulator97 joins (~Googulato@2a01-036d-0106-4074-f40d-d825-16f5-119a.pool6.digikabel.hu)
18:10:27 tri joins (~tri@ool-44c70bcb.dyn.optonline.net)
18:11:10 × Googulator quits (~Googulato@2a01-036d-0106-4074-f40d-d825-16f5-119a.pool6.digikabel.hu) (Ping timeout: 240 seconds)
18:11:22 × jespada quits (~jespada@2800:a4:22f4:ae00:fc16:e598:5958:94e6) (Quit: My Mac has gone to sleep. ZZZzzz…)
18:12:13 wootehfoot joins (~wootehfoo@user/wootehfoot)
18:15:14 × tri quits (~tri@ool-44c70bcb.dyn.optonline.net) (Ping timeout: 260 seconds)
18:20:13 machinedgod joins (~machinedg@d108-173-18-100.abhsia.telus.net)
18:28:58 × [tank] quits (~tank@213.18.138.85) (Quit: [tank])
18:29:21 tank_ joins (sid630849@id-630849.tinside.irccloud.com)
18:30:10 misterfish joins (~misterfis@84.53.85.146)
18:30:58 alfiee joins (~alfiee@user/alfiee)
18:33:22 × tank_ quits (sid630849@id-630849.tinside.irccloud.com) (Client Quit)
18:35:05 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 252 seconds)
18:36:59 × peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 260 seconds)
18:40:50 × Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 248 seconds)
18:40:56 Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915)
18:41:47 <haskellbridge> <sm> hololeap: String ? https://hackage.haskell.org/package/hledger-lib-1.41/docs/Hledger-Utils-String.html#v:stripAnsi
18:42:17 Lord_of_Life_ is now known as Lord_of_Life
18:42:42 <hololeap> sm: eh, it's just using a regex and not a very good one. but thanks
18:42:55 <haskellbridge> <sm> I'm sorry
18:43:15 × fun-safe-math quits (~fun-safe-@2601:1c2:1b7f:801f:f530:2eec:1f02:adc2) (Quit: No Ping reply in 180 seconds.)
18:43:25 <haskellbridge> <sm> :)
18:43:26 [tank] joins (sid630849@id-630849.tinside.irccloud.com)
18:44:12 × Unicorn_Princess quits (~Unicorn_P@user/Unicorn-Princess/x-3540542) (Remote host closed the connection)
18:44:17 <hololeap> no worries. I can just use a regex that people provided on stack exchange, and then I don't have to pull in hledger :)
18:44:30 fun-safe-math joins (~fun-safe-@2601:1c2:1b7f:801f:c74b:f0dc:f04d:3261)
18:44:52 <haskellbridge> <sm> sometimes seeing code helps
18:46:37 <hololeap> fair point
18:51:14 × vanishingideal quits (~vanishing@user/vanishingideal) (Ping timeout: 252 seconds)
18:53:01 vanishingideal joins (~vanishing@user/vanishingideal)
18:56:20 × remedan quits (~remedan@ip-62-245-108-153.bb.vodafone.cz) (Quit: Bye!)
18:57:40 <energizer> why does `pure (+) <*> [0,1] <*> [10,20]` produce [10,20,11,21] and not zipWith?
18:58:19 <mauke> because of how <*> is defined on []
18:58:28 <monochrom> List's <*> does cartesian product rather than zipping.
18:59:02 <mauke> <*> on [] is defined this way to remain compatible with the Monad [] instance
18:59:22 <monochrom> That in turn is because we would like <*> to be consistent with >>= whenever applicable. List's >>= has to do cartesian product, there is no other List monad.
19:00:12 <monochrom> But the stdlib knows your wish! It has the newtype wrapper ZipList that will do zipping for <*>.
19:00:20 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
19:00:47 <monochrom> > pure (+) <*> ZipList [0,1] <*> ZipList [10,20]
19:00:48 <lambdabot> ZipList {getZipList = [10,21]}
19:01:55 <mauke> is there a simple proof that Monad [] is unique?
19:03:51 <monochrom> I don't actually know of one. I made a bet. :)
19:05:41 <monochrom> But I came close to seeing why ZipList cannot be a monad.
19:05:48 <geekosaur> iirc ZipList would require `return` to produce an infinite list?
19:05:56 <mauke> > pure 42 :: ZipList Int
19:05:57 <lambdabot> ZipList {getZipList = [42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42...
19:06:07 <monochrom> Yes, moreover you have to ban all finite lists.
19:08:27 × ash3en quits (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) (Quit: ash3en)
19:10:10 <monochrom> But I have proved that the infinite stream monad is unique (and its <*> does zipping). join xss = [xss !! n !! n | n <- [0..]]
19:13:26 <mauke> I figured there would be some kind of diagonalization involved
19:13:55 <monochrom> :)
19:15:58 jespada joins (~jespada@2800:a4:22f4:ae00:fc16:e598:5958:94e6)
19:19:23 alfiee joins (~alfiee@user/alfiee)
19:24:00 ft joins (~ft@p4fc2a610.dip0.t-ipconnect.de)
19:24:04 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 260 seconds)
19:24:27 × zungi quits (~tory@user/andrewchawk) (Remote host closed the connection)
19:24:48 zungi joins (~tory@user/andrewchawk)
19:27:22 <hololeap> with `WriterT w IO`, is it possible to catch ctrl+c and dump the `w` stdout before aborting, or do I require `ReaderT (IORef w) IO`
19:28:07 <hololeap> it's in a loop using `execWriterT $ forM_ ...`
19:28:49 <hololeap> (I'll probably end up using Reader+IORef, but I'm curious if this is possible)
19:30:09 <c_wraith> @unmtl WriterT w IO a
19:30:09 <lambdabot> IO (a, w)
19:30:17 <c_wraith> You can catch in that type
19:30:40 <c_wraith> but w isn't going to be around
19:31:14 <c_wraith> the non-CPS WriterT is terrible and probably never should be used.
19:33:37 <hololeap> fwiw I was using the CPS WriterT, but I assume it would also lose w
19:34:57 <c_wraith> you could get the "previous" w, but you wouldn't see any changes made in the action at the scope you're catching
19:35:46 <hololeap> ok
19:35:56 × lxsameer quits (lxsameer@Serene/lxsameer) (Ping timeout: 268 seconds)
19:37:30 <hololeap> glad to see mtl-2.3 has CPS writer support
19:37:57 ash3en joins (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207)
19:38:46 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
19:39:15 <tomsmeding> that has been there for ages :)
19:39:32 <tomsmeding> oh it hasn't?
19:39:46 <tomsmeding> 2019 for transformers and 2022 for mtl? That feels wrong
19:39:46 <hololeap> Control.Monad.Writer.CPS Since: mtl-2.3, transformers-0.5.6
19:39:58 <tomsmeding> it's not
19:40:00 <tomsmeding> huh
19:41:36 <hololeap> that and Control.Monad.Accum are excellent additions
19:41:58 <hololeap> both of those transformers were annoying to work with without mtl support
19:45:07 <hololeap> I guess now I need to learn how to use SelectT
19:46:56 Googulator44 joins (~Googulato@2a01-036d-0106-4074-f40d-d825-16f5-119a.pool6.digikabel.hu)
19:49:18 × user363627 quits (~user@user/user363627) (Remote host closed the connection)
19:50:40 × Googulator97 quits (~Googulato@2a01-036d-0106-4074-f40d-d825-16f5-119a.pool6.digikabel.hu) (Ping timeout: 240 seconds)
19:56:59 alp_ joins (~alp@5.226.4.112)
19:57:01 × alp_ quits (~alp@5.226.4.112) (Remote host closed the connection)
20:00:04 × caconym quits (~caconym@user/caconym) (Quit: bye)
20:00:45 caconym joins (~caconym@user/caconym)
20:04:24 × zungi quits (~tory@user/andrewchawk) (Ping timeout: 264 seconds)
20:05:18 × ash3en quits (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) (Remote host closed the connection)
20:07:46 alfiee joins (~alfiee@user/alfiee)
20:10:33 × sprotte24 quits (~sprotte24@p200300d16f0a8e00790a95c75d7de89b.dip0.t-ipconnect.de) (Read error: Connection reset by peer)
20:11:40 × jespada quits (~jespada@2800:a4:22f4:ae00:fc16:e598:5958:94e6) (Quit: My Mac has gone to sleep. ZZZzzz…)
20:11:48 tri joins (~tri@ool-44c70bcb.dyn.optonline.net)
20:12:04 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 260 seconds)
20:16:44 × tri quits (~tri@ool-44c70bcb.dyn.optonline.net) (Ping timeout: 260 seconds)
20:16:59 peterbecich joins (~Thunderbi@syn-047-229-123-186.res.spectrum.com)
20:17:20 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
20:17:58 attk joins (~attk@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca)
20:19:03 × [tank] quits (sid630849@id-630849.tinside.irccloud.com) ()
20:19:56 Tanky joins (sid630849@id-630849.tinside.irccloud.com)
20:22:03 zero joins (~z@user/zero)
20:22:32 × zwro quits (~z@user/zero) (Ping timeout: 252 seconds)
20:22:33 × vanishingideal quits (~vanishing@user/vanishingideal) (Ping timeout: 276 seconds)
20:23:37 × misterfish quits (~misterfis@84.53.85.146) (Ping timeout: 252 seconds)
20:24:00 × Googulator44 quits (~Googulato@2a01-036d-0106-4074-f40d-d825-16f5-119a.pool6.digikabel.hu) (Quit: Client closed)
20:24:08 vanishingideal joins (~vanishing@user/vanishingideal)
20:24:16 Googulator44 joins (~Googulato@2a01-036d-0106-4074-f40d-d825-16f5-119a.pool6.digikabel.hu)
20:27:49 Tuplanolla joins (~Tuplanoll@91-159-69-59.elisa-laajakaista.fi)
20:28:46 euouae joins (~euouae@user/euouae)
20:29:32 <euouae> Hello if I use emacs and haskell-mode how can I pass -Wno-type-defaults to ghci in haskell-interactive-mode? I've modified the arguments for ghci and the cabal repl but I still get it
20:29:36 <euouae> I don't think it's using stack, so what gives?
20:31:40 <euouae> oh apparently I should not be using --ghc-option but instead --repl-options
20:32:48 × yegorc quits (~yegorc@user/yegorc) (Ping timeout: 252 seconds)
20:33:07 <merijn> yeah, that sounds about right
20:33:21 <merijn> I remember implementing that, but I don't recall why the distinction was needed :p
20:33:58 OverclockedPotat joins (~test@user/OverclockedPotat)
20:36:44 <merijn> oh, right, I remember
20:37:06 <merijn> Else changing your warning flags causes cabal to rebuild all your transitive dependencies, which, uh, is bad :)
20:37:26 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
20:37:32 <merijn> Unless it's winter and you want to make your study toasty and warm with CPU heat, I suppose
20:37:50 <euouae> I use `--repl-options=-Wno-type-defaults,-ferror-spans` in cabal repl configuration but it still shows the type defaults
20:37:51 <euouae> sigh
20:38:06 <tomsmeding> does that take a comma?
20:38:17 <euouae> I have no idea, but it is "options" not option...
20:38:37 <merijn> tomsmeding: I think so?
20:38:37 <euouae> --repl-options=FLAG Use the option(s) for the repl
20:38:41 <euouae> Not a very clear explanation
20:38:43 <merijn> Unless past me is evil
20:38:56 <merijn> But past me is generally a stand up guy :p
20:39:18 <tomsmeding> the user guide is also not very helpful here https://cabal.readthedocs.io/en/stable/cabal-commands.html#cmdoption-repl-options
20:39:26 <tomsmeding> though it confirms what merijn just said
20:39:35 <euouae> chatgpt recommends space-separating it
20:39:44 <tomsmeding> that's what I recall too
20:39:52 <euouae> yeah I just went with what gcc does to pass linker flags
20:40:01 <tomsmeding> I'm quite sure gcc also doesn't use ,
20:40:17 <tomsmeding> rather it's -Wl,theoption -Wl,thesecondoption
20:40:17 <euouae> -Wl does
20:40:44 <tomsmeding> one argument per -Wl flag
20:40:58 <euouae> right, maybe I misrecalled
20:41:18 <tomsmeding> https://cabal.readthedocs.io/en/stable/setup-commands.html#cmdoption-runhaskell-Setup.hs-configure-PROG-options
20:41:21 <tomsmeding> this is spaces, in any case
20:41:39 × Tanky quits (sid630849@id-630849.tinside.irccloud.com) ()
20:41:42 <tomsmeding> I can't find a specific --ghc-options entry in the user guide, but --repl-options claims to be modeled after --ghc-options
20:42:09 <euouae> ah, finally! yay
20:42:12 <euouae> that worked, thank you
20:42:19 <merijn> probably space separated, by the looks of the code
20:42:49 <tomsmeding> should this be added to the --repl-options documentation
20:42:51 <merijn> https://github.com/haskell/cabal/pull/5287/files
20:43:02 <merijn> you can try and figure out what it does there
20:43:16 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
20:43:17 <euouae> who is "past me"?
20:43:18 <merijn> but at a glance it's calling setup with the contents of replFlags passed in as-is
20:43:28 <merijn> so, space separated
20:43:46 <merijn> euouae: Me approximately 7 years ago :p
20:43:53 <euouae> lol
20:44:10 × vanishingideal quits (~vanishing@user/vanishingideal) (Ping timeout: 252 seconds)
20:44:12 <merijn> tomsmeding: Probably should
20:44:43 <euouae> also here's what I get from --help:
20:44:51 <euouae> --PROG-option=OPT give an extra option to PROG (no need to quote options containing spaces) --PROG-options=OPTS give extra options to PROG
20:45:14 <tomsmeding> that presumably covers --ghc-option
20:45:18 <euouae> I had no idea what "no need to quote options containing spaces" meant. I think it means it's all passed as one option in --ghc-option.
20:45:26 <tomsmeding> yes
20:45:29 <euouae> But in --ghc-options, spaces mean multiple arguments. It's *very* unclear
20:45:35 <tomsmeding> I think that's accurate
20:45:50 <euouae> Right I'm just pointing out one more place where some improvement on the wording would help
20:46:01 <merijn> euouae: it's saying that "argument of ghc-options is passed "as-is" to ghc
20:46:03 <tomsmeding> --*-options is convenience for a user, tooling should never use it
20:46:05 vanishingideal joins (~vanishing@user/vanishingideal)
20:46:08 <tomsmeding> because you get magic space splitting
20:46:14 <euouae> I would prefer: OPT is passed as-is as a single argument
20:46:32 <merijn> euouae: then you'd have to have one flag per argument
20:46:33 <euouae> and --PROG-options=OPTS space-separated arguments
20:46:47 <tomsmeding> merijn: yes, that's what --ghc-option (singular) does
20:46:49 <euouae> merijn: what do you mean? I'm just saying what I would prefer the docs would say
20:46:58 <euouae> instead of how they currently explain it
20:47:22 <euouae> and who knows how the space-splitting works with arguments that contain spaces
20:47:25 <merijn> euouae: I meant that if you write --ghc-options="foo bar baz" it literally just appends foo bar baz to the ghc call
20:47:30 <merijn> euouae: There is not space splitting
20:47:32 <tomsmeding> euouae: break them
20:47:42 <merijn> euouae: it's a shell process call
20:47:47 <tomsmeding> merijn: O.o
20:47:49 <euouae> merijn: okay, then it should say OPTS passed as-is
20:47:50 × peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 252 seconds)
20:48:04 <tomsmeding> does it do proper quoting when I pass --ghc-option with an OPT containing weird stuff
20:48:07 <merijn> tomsmeding: I'm 80% sure of that
20:48:12 <tomsmeding> what if I put $() in --ghc-options
20:48:27 <merijn> tomsmeding: who knows
20:48:28 <euouae> tomsmeding: or just ; rm -rf
20:49:01 <merijn> tomsmeding: I don't see how that's an issue, tbh
20:49:27 <euouae> it's definitely an issue, it shouldn't happen like that
20:49:40 yegorc joins (~yegorc@user/yegorc)
20:49:49 <merijn> euouae: Why does it matter?
20:49:49 <tomsmeding> well it's clearly a violation of expectations if something passed to --ghc-options, or god forbid --ghc-option, gets interpreted by a shell
20:49:51 <euouae> the expected behavior of --ghc-options= should not be "you get a shell and do w/e you want"
20:50:10 <tomsmeding> why is there a shell in the first place?
20:50:20 sprotte24 joins (~sprotte24@p200300d16f0a8e003d8337fe7ef7e64f.dip0.t-ipconnect.de)
20:50:27 <euouae> merijn: it doesn't super-matter, but I'm just telling you that it's definitely an error from a security perspective
20:50:43 <tomsmeding> okay --ghc-options seems to escape $ and ` in any case
20:50:48 <merijn> tomsmeding: I'm not 100% it goes via the shell, I was thinking it goes via proc
20:51:04 <tomsmeding> that's not the shell
20:51:05 <merijn> euouae: You already have a shell if you can call cabal with --ghc-options
20:51:10 <tomsmeding> if you're thinking of System.Process.proc
20:51:35 <euouae> merijn: you could just be in control of that --ghc-options thing somehow -- think of someone contributing a patch to CI where they set the options sneakily
20:51:53 <merijn> honestly, just don't look at the cabal inversion of control
20:52:11 <tomsmeding> euouae: you could also -i an unexpected file then
20:52:11 <merijn> tomsmeding: I was thinking System.Process.sh style
20:52:20 <tomsmeding> merijn: but you said "proc"
20:52:35 <tomsmeding> (and it's System.Process.shell, I think)
20:52:46 <merijn> tomsmeding: In my defense, it's been 7 years :p
20:52:53 <tomsmeding> I'm not blaming you for not remembering :p
20:52:53 <merijn> And I'm half guessing
20:53:09 <tomsmeding> if cabal does indeed pass these things to the shell, I blame the reviewers who accepted that PR
20:53:20 <merijn> oh, no that's not new
20:53:22 <tomsmeding> but as I said, at least there appears to be some escaping going on if so
20:53:57 <merijn> the problem is that cabal-install just calls Cabal's Setup.hs
20:54:00 <euouae> I'm not trying to criticize eitehr
20:54:49 <merijn> all arguments definitely get turned into one string and then reparsed, though
20:54:57 <merijn> in that Setup step
20:55:52 <tomsmeding> is this also true in build-type: Simple projects?
20:55:56 <merijn> yes
20:55:57 <tomsmeding> s/projects/packages/
20:56:15 <merijn> They (implicitly) usethe default Setup.hs
20:56:27 <tomsmeding> I just ran `cabal build --ghc-options='$(notify-send kaas)'` in a simple cabal project under a tracer that shows all execve calls
20:56:30 <merijn> (similar to the two line one cabal init generates)
20:56:53 <merijn> tomsmeding: Might be just getting reparsed at the Setup step and using execve then
20:56:53 <tomsmeding> the first call containing "notify-send" is a call to ghc that gets passed "$(notify-send" and "kaas)" as two separate arguments
20:57:07 <tomsmeding> I don't see a setup invocation at all
20:57:11 alfiee joins (~alfiee@user/alfiee)
20:57:34 <tomsmeding> also not if I `cabal clean` first
20:57:35 <merijn> tomsmeding: Of course not, it's not called as program, it just calls the same logic with a string argument :p
20:57:42 <tomsmeding> ah
20:57:49 <tomsmeding> that's dumb
20:57:55 <tomsmeding> why was it designed that way
20:57:59 <merijn> tomsmeding: I mean, not really
20:58:03 <merijn> well, a bit
20:58:03 <mauke> <merijn> euouae: it's a shell process call <-- directly contradicts <merijn> euouae: There is not space splitting
20:58:06 <merijn> it's complicated
20:58:08 <tomsmeding> can I not pass an option to GHC that contains a space?
20:58:25 <merijn> tomsmeding: If you quote it further, presumably
20:58:33 <tomsmeding> mauke: not if there's escaping/quoting in between
20:59:04 <tomsmeding> merijn: if I use --ghc-option instead of --ghc-options, the space remains intact
20:59:33 <tomsmeding> it certainly seems to act as if there's no reparsing going on in between, but perhaps that just means that it's properly escaped beforehand
21:02:08 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 272 seconds)
21:02:14 <merijn> I'm trying to reverse my logic, but it's split across 2 PRs, annoyingly
21:05:18 zungi joins (~tory@user/andrewchawk)
21:06:18 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
21:06:44 <tomsmeding> merijn: what do you think about this reformulation? https://tomsmeding.com/vang/Qk3nO7
21:07:00 <tomsmeding> (this is the user guide on --repl-options)
21:07:40 <tomsmeding> (the idea being to turn this from a historical remark of why the flag game to be, to a description of what you can do with it)
21:07:48 <tomsmeding> s/game/came/
21:08:27 misterfish joins (~misterfis@84.53.85.146)
21:08:44 <euouae> it might be nice to mention --repl-options in the docs for --PROG-options?
21:08:57 <euouae> if --PROG-options is not reliable, you might as well deprecate it
21:09:07 <merijn> I mean that formulation is a bit confusing in the sense of "why would it not reliably pass flags?" it sounds like it implies non-determinism
21:09:15 <tomsmeding> euouae: it's useful for all situations _except_ passing an option to the repl
21:09:23 <merijn> euouae: It is *specifically and only* ghc that is affected
21:09:31 × hattckory quits (~hattckory@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca) (Remote host closed the connection)
21:09:45 hattckory joins (~hattckory@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca)
21:09:47 <tomsmeding> merijn: the original was not clearer in that direction :)
21:09:47 <merijn> And only for a deterministic set of flags
21:09:51 <euouae> merijn: ah sigh.. it's a messy thing. maybe (NB. use --repl-options on ghc instead)
21:10:22 <tomsmeding> "to control ghci without influencing the build", rather
21:10:53 <merijn> euouae: If you want the dirty complicated version: There is (or at least at the time of implementation) no way to distinguish between "ghc flags that apply to all transitive dependency of this code" and "ghc flags that apply to thise project *speficially"
21:11:21 × hattckory quits (~hattckory@bras-base-toroon4524w-grc-50-70-31-30-224.dsl.bell.ca) (Remote host closed the connection)
21:11:32 <merijn> euouae: The current interpretation of --ghc-options is "transtively applied to all dependencies"
21:11:41 hattckory joins (~hattckory@70.31.30.224)
21:12:12 <merijn> euouae: Which means: adding/removing a flag via --ghc-options will trigger a recompile of your entire transitive dependency graph (well, unless you already compiled that specific set of flags before)
21:12:35 <merijn> euouae: This was making me fiddling with my warning flags REALLY fucking slow :p
21:12:37 <euouae> yup I see
21:12:48 <euouae> exactly, that's an issue
21:12:58 ljdarj1 joins (~Thunderbi@user/ljdarj)
21:13:03 <euouae> well, ghc shouldn't be a build system? why is ghc aware of dependencies?
21:13:06 <tomsmeding> you can fiddle with them in the cabal file, which does work
21:13:06 <merijn> euouae: So, the solution was: "Strip out any flags that do not affec the resulting binary from ghc options"
21:13:12 <merijn> euouae: Its not, cabal is
21:13:23 × wootehfoot quits (~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer)
21:13:29 <euouae> okay right, you're saying cabal had no way to separate project from dep flags
21:13:34 <euouae> that's /bad/ lol :P
21:13:36 <merijn> euouae: Dependencies are tagged with a hash of their version, source *and flags*
21:13:47 <tomsmeding> not on the command line; the `ghc-options` field in the .cabal file works fine
21:13:47 <merijn> euouae: It has one, but not on the commandline
21:14:01 <euouae> right, I'm following
21:14:23 <merijn> euouae: So the compromise was: any *commandline* ghc-option that does *not* affect the resulting binary gets tossed (so no rebuilding the transitive dependencies)
21:14:38 <merijn> euouae: Then I quickly hit your problem "whoops, now I can't use warnings via cabal repl"
21:14:46 justsomeguy joins (~justsomeg@user/justsomeguy)
21:14:55 <merijn> euouae: Hence --repl-options bypass the flag tossing "for this project ONLY"
21:15:04 <merijn> (instead of globally transitive)
21:15:16 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
21:15:20 × ljdarj quits (~Thunderbi@user/ljdarj) (Ping timeout: 244 seconds)
21:15:20 ljdarj1 is now known as ljdarj
21:15:51 remedan joins (~remedan@ip-62-245-108-153.bb.vodafone.cz)
21:15:57 <tomsmeding> merijn: is that tossing documented somewhere
21:15:59 <merijn> Is it very pretty? No, but I didn't (and still don't :p) know a better solution beyond "redesign the way every --PROG-opts work to correctly scope it to project or transitively)
21:16:13 <justsomeguy> How does fmap (fmap sum) Just [1,2,3] turn into fmap sum (Just [1,2,3])? What happens to the inner fmap?
21:16:14 <tomsmeding> that solution is cabal.project.local, probably
21:16:45 <merijn> tomsmeding: It is mentioned here: https://cabal.readthedocs.io/en/stable/cabal-commands.html#cmdoption-repl-options
21:16:46 <tomsmeding> justsomeguy: that outer fmap is (.), so it's `(fmap sum . Just) [1,2,3]`
21:16:51 <merijn> tomsmeding: But not very well
21:17:09 <euouae> justsomeguy: look up the Functor instances of Maybe and (->)
21:17:12 <tomsmeding> merijn: the thing I edited in my diff?
21:17:39 <merijn> tomsmeding: I think I closed that already
21:17:41 <merijn> xD
21:17:50 <tomsmeding> the only thing I changed is change "no longer" to "not", and change the "you should use" instruction to "--repl-options bypasses this tossing" :p
21:17:52 <tomsmeding> https://tomsmeding.com/vang/Qk3nO7/.psub.kWMobRelu5
21:17:58 <euouae> tomsmeding: the .local is a different thing isn't it? I'm going by what I know from CMake
21:18:12 <euouae> It's not project versus dependencies -- it's programmer versus upstream
21:18:15 <tomsmeding> euouae: cabal.project.local is just the same thing as cabal.project, but with a different name
21:18:25 <tomsmeding> _conventionally_, it's your local configuration that you don't push
21:18:29 <euouae> right okay
21:18:39 <merijn> tomsmeding: tbh it should probably just mentioned the tossed flags are the set of flags not affecting build artifacts, most notably warnings
21:18:42 <tomsmeding> the same goes for cabal.project.freeze, actually
21:19:02 <tomsmeding> merijn: and it should say that with --PROG-option(s)?
21:19:03 <EvanR> justsomeguy, what fmap does depends on the particular instance of Functor, it may not be obvious in isolation which one you're dealing with. In this case "function" Functor
21:19:04 <merijn> euouae: yeah .local is just a bunch of overrides merged into cabal.project
21:19:08 <tomsmeding> for "ghc" specifically, right?
21:19:13 <merijn> tomsmeding: Maybe? I dunno :p
21:19:22 <merijn> tomsmeding: yeah, GHC only
21:20:03 <justsomeguy> tomsmeding: Why does the outer fmap get rewritten to (.) instead of the inner fmap?
21:20:05 <merijn> Because I manually audited a "known-safe to toss" subset of flags and anything not there is kept
21:20:22 <EvanR> the inner fmap is using the list functor
21:20:29 <EvanR> outer fmap is function functor
21:20:36 <EvanR> two different instances
21:20:51 <EvanR> er
21:21:19 <EvanR> inner fmap is the Maybe functor
21:21:20 <merijn> welp, my session if figuring out where the arguments are processed has ended, due to cat blocking my laptop xD
21:21:55 <tomsmeding> :3
21:22:38 <tomsmeding> merijn: --repl-options is also a thing on Setup.hs, I see
21:22:57 <tomsmeding> but `cabal build` doesn't accept it
21:23:45 <EvanR> justsomeguy, does fmap sum (Just [1,2,3]) make sense
21:23:58 <justsomeguy> I thought the reduction process would go like this (fmap (fmap sum) Just) [1,2,3] ==> fmap (Just (fmap sum [1,2,3])) .... I got this from substituting in (fmap sum) to the definition fmap f (Just x) = Just (f x).
21:24:36 <euouae> Isn't it fmap (fmap sum) (Just [1,2,3])?
21:24:40 <tomsmeding> justsomeguy: but it's `fmap f Just`, not `fmap f (Just x)`. ;)
21:24:49 <EvanR> euouae, no
21:25:00 <euouae> Okay
21:25:09 <EvanR> f x y z = ((f x) y) z
21:25:14 × tabaqui1 quits (~root@87.200.129.102) (Ping timeout: 252 seconds)
21:25:21 <euouae> I misreead it, so (->) on JUst
21:26:12 <justsomeguy> Is there some tool I can put this into and see the evaluation process step-by-step?
21:26:32 <justsomeguy> Maybe a haskell debugger?
21:26:38 <merijn> tomsmeding: Yes, because cabal-install just invokes the Setup.hs parser
21:26:43 biberu joins (~biberu@user/biberu)
21:26:45 <monochrom> More than that, you need a tool that tells you what "fmap" resolves to.
21:26:47 <tomsmeding> merijn: I do wonder if just dropping those flags is the right design though; sure, perhaps the user didn't intend to recompile the world, but perhaps they did!
21:26:48 yegorc parts (~yegorc@user/yegorc) (Leaving)
21:26:50 <EvanR> (fmap (fmap sum) Just) [1,2,3] => (Just . fmap sum) [1,2,3]
21:27:26 tanky joins (sid630849@id-630849.tinside.irccloud.com)
21:27:46 <EvanR> I reversed the arguments, nevermind me
21:27:59 <tomsmeding> justsomeguy: write down the type of `fmap`; write down the types of the arguments it gets in your expression; match the two and see what the `f` in fmap's type should be
21:28:02 <merijn> tomsmeding: I'm ahead of you by 7 years :)
21:28:04 <merijn> tomsmeding: https://github.com/haskell/cabal/issues/5300
21:28:11 <tomsmeding> justsomeguy: you'll get two different results for the outer and the inner fmap
21:28:22 <tomsmeding> merijn: <3
21:28:46 × tanky quits (sid630849@id-630849.tinside.irccloud.com) (Changing host)
21:28:46 tanky joins (sid630849@user/tanky)
21:29:03 <merijn> still open, sadly, because it was never enough of a problem to invent a solution
21:29:41 <monochrom> I thought flags went into the hash and can trigger rebuild.
21:30:10 <merijn> monochrom: only the ones I don't explicit remove from you behind your back :p
21:30:19 tri joins (~tri@ool-44c70bcb.dyn.optonline.net)
21:30:19 <EvanR> justsomeguy, ghci has a debugger
21:30:29 <EvanR> seems to be wildly unpopular
21:30:34 <tomsmeding> very
21:30:41 tomsmeding nods vigorously
21:30:54 <tomsmeding> oh you added "un"
21:31:02 <tomsmeding> well it's still correct, but now non-sarcastically
21:31:03 <merijn> monochrom: so they do, but I'm protecting you and or screwing you (choose as appropriate) by deleting any of your flags I deemed dumb :p
21:31:11 <merijn> (that is, not affecting build artifacts)
21:31:12 <EvanR> I write :t something in ghci and see if it 1. works and 2. corresponds with my expectations. It helped
21:31:31 <monochrom> I sympathize with wanting a stepper. But at this stage it looks like you haven't even grokked type inference and instance resolution.
21:31:38 <geekosaur> in particular :trace is a thing
21:31:45 × target_i quits (~target_i@user/target-i/x-6023099) (Quit: leaving)
21:31:51 <EvanR> I will now look up :trace
21:32:21 <merijn> @quote stream.of.concious
21:32:21 <lambdabot> No quotes match. That's something I cannot allow to happen.
21:32:23 <merijn> aww
21:32:26 <merijn> really?
21:32:40 <tomsmeding> @quote stream.of.consciou
21:32:40 <lambdabot> cmccann says: you want a debugger? GHC has one. Except that stepping through lazy evaluation is like listening to a stream of consciousness narrative told by a 5-year-old with ADHD.
21:32:42 <geekosaur> @quote stream.of.conscious
21:32:42 <lambdabot> cmccann says: you want a debugger? GHC has one. Except that stepping through lazy evaluation is like listening to a stream of consciousness narrative told by a 5-year-old with ADHD.
21:32:43 <tomsmeding> english
21:32:45 <tomsmeding> ah
21:32:54 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
21:33:01 <merijn> there we go
21:33:02 <geekosaur> whoops, didn;t notice I was beaten to it
21:33:16 <monochrom> I am not sure that ADHD is necessary. :)
21:33:37 <merijn> Can I just say that you all don't appreciate global uniqueness of typeclasses enough?
21:33:43 <justsomeguy> fmap :: Functor f => (a -> b) -> f a -> f b
21:33:45 <justsomeguy> [f := (->) e]
21:33:47 <justsomeguy> fmap :: (a -> b) -> (->) e a -> (->) e a
21:33:49 <justsomeguy> fmap :: (a -> b) -> (e -> a) -> e -> a
21:33:51 <justsomeguy> y
21:34:12 tnt2 joins (~Thunderbi@user/tnt1)
21:34:13 <justsomeguy> I just tried to paste a few lines for the type signature evalation of the outer fmap, did it go through?
21:34:17 <tomsmeding> :t (.)
21:34:18 <lambdabot> (b -> c) -> (a -> b) -> a -> c
21:34:21 <euouae> Yeah but don't do that justsomeguy
21:34:36 <tomsmeding> looks similar? :)
21:34:44 × tri quits (~tri@ool-44c70bcb.dyn.optonline.net) (Ping timeout: 260 seconds)
21:34:46 <euouae> justsomeguy: you can paste with <https://paste.tomsmeding.com>
21:34:57 <justsomeguy> Sorry, you're right. I'll use a pastebin next time.
21:35:06 <tomsmeding> in your expression `fmap (fmap sum) Just [1,2,3]`, the second argument to the outer fmap is Just, which has type `a -> Maybe a`
21:35:14 <monochrom> You have a typo but I think you are right.
21:35:19 × tnt1 quits (~Thunderbi@user/tnt1) (Ping timeout: 260 seconds)
21:35:19 tnt2 is now known as tnt1
21:35:38 <tomsmeding> so you get outer_fmap :: maybe (Maybe a -> b) -> (a -> Maybe a) -> (a -> b)
21:35:51 <tomsmeding> ... without that "maybe"
21:36:08 <mauke> justsomeguy: the last `(->) e a` should be `(->) e b`
21:36:44 <haskellbridge> <magic_rb> so im trying to use either optparse-applicative or tomland to deserialize what i would call a tagged union, essentially this JSON: { type: one, something: foo } or { type: two, else: bar } where "type" must equal "one" or "two". But im struggling to make either work, i suspect its an inherent thing of both being based on applicatives?
21:36:49 <justsomeguy> Ah, I see it now. Thanks mauke
21:36:52 <EvanR> merijn, what's this in relation to
21:37:03 <tomsmeding> merijn: in the .rst docs, can I refer to an option documented in a different file?
21:37:03 <EvanR> because I've been noticing the same thing
21:37:06 <merijn> EvanR: Having to debug implicits in scala :p
21:37:47 <merijn> Scala is surprisingly ok as functional language, but implicits are the bane of my existence >.>
21:38:14 <tomsmeding> magic_rb: that sounds plausible, you want parsing to depend on the result of some other part of the parser
21:38:21 × remedan quits (~remedan@ip-62-245-108-153.bb.vodafone.cz) (Ping timeout: 252 seconds)
21:38:22 <tomsmeding> that's monadic
21:38:30 <haskellbridge> <magic_rb> yeah...
21:38:35 <tomsmeding> this would need to be a primitive parser
21:38:36 remedan_ joins (~remedan@ip-62-245-108-153.bb.vodafone.cz)
21:38:40 <tomsmeding> that handles "tagged unions" somehow
21:38:51 <merijn> I think it can work, though
21:38:51 <EvanR> merijn, yeah this is how I expected it
21:39:04 <haskellbridge> <magic_rb> merijn: i think it can work if you rely on failure and backtracking
21:39:09 <merijn> you just need to have a (static) parser for the tag inside the subparser
21:39:24 × michalz quits (~michalz@185.246.207.203) (Remote host closed the connection)
21:39:44 <haskellbridge> <magic_rb> but with optparse-applicative i couldnt get it to work because i couldnt put the different alternatives in subparsers, only commands and optparse wouldnt backtrack through <|> just by itself
21:40:12 <haskellbridge> <magic_rb> but ignoring optparse, i actually need this in tomland
21:40:49 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
21:41:01 <justsomeguy> I think I got so into the habit of just plugging in definitions when evaluating by hand, that I forgot that I have to do type resolution during each step. Most of what I was desk-checking before was monomorphic.
21:41:29 tnt2 joins (~Thunderbi@user/tnt1)
21:42:01 <EvanR> justsomeguy, only in the case of typeclass "methods" like fmap
21:42:09 <EvanR> the definition depends crucially on the type
21:42:19 × tnt1 quits (~Thunderbi@user/tnt1) (Ping timeout: 260 seconds)
21:42:19 tnt2 is now known as tnt1
21:42:36 <tomsmeding> something like `map`, which polymorphic but not a typeclass method, can be rewritten as-is
21:45:56 alfiee joins (~alfiee@user/alfiee)
21:49:04 × Spawns_Carpeting quits (~mobile@user/spawns-carpeting/x-6969421) (Quit: ZNC 1.8.2+deb3.1+deb12u1 - https://znc.in)
21:49:05 <tomsmeding> merijn: euouae: https://github.com/tomsmeding/cabal/commit/e1faaf097cb8e78a5736f176e5e9542396d278e2 what do you think?
21:49:40 × takuan quits (~takuan@d8D86B601.access.telenet.be) (Remote host closed the connection)
21:50:15 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 244 seconds)
21:50:21 <euouae> tomsmeding: this is dumb, but do 'quotes' also prevent splitting?
21:50:47 Spawns_Carpeting joins (~mobile@user/spawns-carpeting/x-6969421)
21:51:14 <euouae> I like how you commented the single option. I agree it's easier to understand now.
21:51:38 <tomsmeding> euouae: good question!
21:52:27 <euouae> good catch on C:\Program Files\ typo heh
21:52:44 <tomsmeding> --repl-options doesn't even seem to accept "
21:53:09 <euouae> oh... that's not good
21:53:23 <tomsmeding> merijn: ? :p
21:53:25 <euouae> I guess, realistically, it only gets passed stuff without spaces?
21:53:31 <euouae> like -W arguments and -f
21:54:13 <euouae> tomsmeding: I would say the rest is good, just hold off on the -options variant until more clarification is available
21:54:54 <justsomeguy> I'm still confused. Maybe I way trying to apply the outer fmap first, instead of the inner fmap? Figuring out where I went wrong is going to bother me for a while.
21:55:24 <monochrom> You were using the wrong fmap definition.
21:55:33 <tomsmeding> justsomeguy: the order shouldn't matter, which fmap resolves to which definition is determined solely by the types
21:56:02 <tomsmeding> euouae: experimentally, --ghc-options parses " but passes ' on unchanged
21:56:12 <tomsmeding> so the "quotes" is indeed accurate, it seems
21:56:13 <euouae> justsomeguy: try this instead: `fmap (+1) 2` first
21:56:30 <monochrom> Or worse, you chose the wrong fmap definition, then you rationalized it by misinterpreting the rest of the expression.
21:58:27 <monochrom> Wait, is fmap (+1) 2 supposed to type-check?
21:58:39 × remedan_ quits (~remedan@ip-62-245-108-153.bb.vodafone.cz) (Ping timeout: 260 seconds)
21:58:54 <merijn> monochrom: I mean, is it? :p
21:59:07 remedan joins (~remedan@ip-62-245-108-153.bb.vodafone.cz)
21:59:11 <merijn> > fmap (+1) 2
21:59:12 <lambdabot> error:
21:59:12 <lambdabot> • Ambiguous type variable ‘f0’ arising from a use of ‘show_M207628434199...
21:59:12 <lambdabot> prevents the constraint ‘(Show (f0 Integer))’ from being solved.
21:59:15 <merijn> aww
21:59:19 <merijn> > fmap (+1) 2 3
21:59:21 <lambdabot> error:
21:59:21 <lambdabot> • Could not deduce (Num t0)
21:59:21 <lambdabot> from the context: (Num t, Num t1, Num (t1 -> t))
21:59:24 <tomsmeding> % fmap (+1) (2 :: Data.Monoid.Sum Int)
21:59:24 <yahb2> Sum {getSum = 3}
21:59:26 <euouae> You can do :: Identity Int
21:59:32 <merijn> did lambdabot lose his evil instances?
22:00:01 <tomsmeding> ah or Identity, yes
22:00:27 <monochrom> > Identity 2 + 3
22:00:29 <lambdabot> Identity 5
22:00:34 <monochrom> fancy
22:00:45 <tomsmeding> Identity implements a lot of type classes!
22:00:48 × gmg quits (~user@user/gehmehgeh) (Ping timeout: 264 seconds)
22:00:50 <tomsmeding> for better or for worse
22:02:30 <tomsmeding> % System.Process.system "ghci -e ':i Data.Functor.Identity.Identity' | grep '^instance' | cut -d' ' -f2 | xargs"
22:02:30 <yahb2> Traversable Applicative Bounded Enum Eq Floating Foldable Fractional Functor Integral Monad Monoid Num Ord Read RealFloat RealFrac Real Semigroup Show ; ExitSuccess
22:02:33 finsternis joins (~X@23.226.237.192)
22:03:21 <tomsmeding> what even is this ordering, why is it alphabetically ordered except that Traversable is first
22:03:29 <tomsmeding> "it's always `traverse`"?
22:04:22 <monochrom> Interesting.
22:04:40 gmg joins (~user@user/gehmehgeh)
22:06:21 × gmg quits (~user@user/gehmehgeh) (Client Quit)
22:06:42 <merijn> tomsmeding: Funnily enough still true in scala, although not always as easily implemented :p
22:06:59 <tomsmeding> merijn: what is?
22:07:09 gmg joins (~user@user/gehmehgeh)
22:07:11 <merijn> tomsmeding: it's always traverse
22:07:15 <tomsmeding> ah
22:07:32 <merijn> I have converted at least one colleague to the one true faith of traverse
22:07:43 <tomsmeding> (:
22:07:50 <merijn> the other heathens still need to accept our lord and saviour
22:08:15 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
22:08:51 <monochrom> Why is it always traverse?
22:09:13 <haskellbridge> <magic_rb> tomsmeding: got it, thankfully tomland backtracks properly. would be pretty bad after convincing my boss to allow me to do this in haskell to be like: "yeah so i spend 2 hours trying to get the fucking CLI to work, only to not be able to do it, because, uh, math reason"
22:10:06 × justsomeguy quits (~justsomeg@user/justsomeguy) (Ping timeout: 268 seconds)
22:10:15 <tomsmeding> monochrom: it's just the observation that surprisingly often, when you're looking for something that does this particular combination of fmap and sequence, or perhaps concatMap, or perhaps yet some other thing that looks totally different
22:10:18 <tomsmeding> it's actually `traverse`
22:10:45 <tomsmeding> magic_rb: nice :)
22:11:07 <monochrom> Ah OK. Back in my days it was always monad. :)
22:11:25 <tomsmeding> merijn: euouae: I further clarified the "quoting" behaviour https://github.com/tomsmeding/cabal/compare/595d0238c97e6e63d992f35f2047691da2460602...options-docs
22:11:29 <tomsmeding> shall I PR this?
22:12:15 <euouae> tomsmeding: --repl-options=FLAGS is better
22:12:18 <euouae> or even =OPTIONS
22:12:22 <euouae> right now it has the singular form FLAG
22:12:29 <tomsmeding> lol
22:12:40 <euouae> :< am I too nitpicky
22:12:48 <tomsmeding> --PROG-options has OPTS, so let's use that
22:12:54 <tomsmeding> euouae: no thanks this is great
22:12:59 <merijn> tomsmeding: that shows empty?
22:13:19 <tomsmeding> merijn: doesn't for me
22:13:29 <merijn> ah, no the ...was part of the url xD
22:13:35 <tomsmeding> ah yes
22:13:38 <tomsmeding> github (tm)
22:13:57 tnt2 joins (~Thunderbi@user/tnt1)
22:14:25 <euouae> tomsmeding: I say go ahead, I can't review further because I have some stuff to do away from computer now
22:14:35 <merijn> the does not accept quotes seems suspect, as the quotes generally are eaten by the shell, no?
22:14:38 <tomsmeding> euouae: thanks :)
22:14:59 × tnt1 quits (~Thunderbi@user/tnt1) (Ping timeout: 260 seconds)
22:14:59 tnt2 is now known as tnt1
22:15:50 <tomsmeding> merijn: $ touch 'hi there.ghci'; cabal repl --repl-options='-ghci-script="hi there.ghci"' # -> ... Warning: ignoring unrecognised input `there.ghci"'
22:16:27 <tomsmeding> I know how my shell works :p
22:16:44 <tomsmeding> I don't know what atrocities the thing I pass to --repl-options goes through, but that's not my responsibility
22:17:03 <tomsmeding> but I think it's good if the docs describe the end result
22:19:57 Vajb joins (~Vajb@85-76-36-81-nat.elisa-mobile.fi)
22:20:42 <geekosaur> IWBNI if it at least did what cabal files allow in a number of places: `--repl-options='"-ghci-script=hi there.ghci"'` (yes, I tested that this still doesn't work)
22:21:02 <geekosaur> quotes around the whole option, because it's not trying to be a shell parser
22:21:33 <tomsmeding> right
22:21:42 <tomsmeding> --ghc-options accepts the quotes halfway down the option
22:21:46 × machinedgod quits (~machinedg@d108-173-18-100.abhsia.telus.net) (Ping timeout: 244 seconds)
22:22:30 × foul_owl quits (~kerry@193.42.0.124) (Ping timeout: 244 seconds)
22:23:03 <geekosaur> that said, part of the problem here is there's no guarantee any of this would work on Windows
22:23:45 <tomsmeding> geekosaur: are the "quotes" interpreted by a shell or by Setup.hs? Telling signs for the _latter_ are that 'single quotes' don't work, and $() also doesn't
22:24:08 <tomsmeding> if they're _really_ interpreted by a shell, I'd argue that's a design bug
22:24:27 <tomsmeding> putting user input through a shell is almost always a mistake
22:24:52 <monochrom> How JSON was invented... :)
22:24:55 <tomsmeding> if nothing else because various systems have various different shells that do different unexpected things
22:25:05 <tomsmeding> monochrom: what does JSON have to do with shells? :P
22:25:41 <monochrom> Why is JSON valid Javascript syntax? Because initially someone just wanted to eval() it.
22:25:42 <geekosaur> right, but the problem there is there's no exec() on Windows and CreateProcess passes a single string, not a list
22:26:02 <geekosaur> basically it's a trainwreck no matter what you do
22:26:27 <tomsmeding> okay passing separate arguments on windows is a trainwreck anyway
22:26:39 <tomsmeding> because windows has no concept of separate arguments whatsoever in the first place
22:27:01 <tomsmeding> so you'll have to use whatever syntax the callee is going to parse
22:27:09 <geekosaur> which puts limits on what cabal-install or the Cabal library (as "personified" by Setup.hs) can pull off even at best
22:27:42 <tomsmeding> I don't think "you'll need to compromise on windows anyway" is an argument for putting this through a shell on non-windows
22:28:18 <geekosaur> didn't we demonstrate it's not, though? $() didn't work iirc
22:28:40 <tomsmeding> right, and I also don't see a shell invocation when I trace exec calls on cabal
22:29:13 <geekosaur> the quote interpretation I suggested doesnt go through a shell, it's a routine inside cabal-install (IIRC)
22:29:21 <tomsmeding> good :p
22:29:42 <geekosaur> (might be in the Cabal library, I don't recall exactly where I found it)
22:29:44 <tomsmeding> anyone here want to be pulled in as a requested reviewer on my docs PR? :p
22:31:25 <tomsmeding> https://github.com/haskell/cabal/pull/10792
22:31:32 tri joins (~tri@ool-44c70bcb.dyn.optonline.net)
22:33:07 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
22:34:20 alfiee joins (~alfiee@user/alfiee)
22:35:43 × tri quits (~tri@ool-44c70bcb.dyn.optonline.net) (Ping timeout: 244 seconds)
22:37:19 × Square quits (~Square@user/square) (Ping timeout: 260 seconds)
22:38:54 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 260 seconds)
22:40:04 foul_owl joins (~kerry@193.42.0.124)
22:40:19 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 268 seconds)
22:46:09 × Googulator44 quits (~Googulato@2a01-036d-0106-4074-f40d-d825-16f5-119a.pool6.digikabel.hu) (Quit: Client closed)
22:46:25 Googulator44 joins (~Googulato@2a01-036d-0106-4074-f40d-d825-16f5-119a.pool6.digikabel.hu)
22:51:11 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
22:54:04 drdo0 joins (~drdo@bl9-110-63.dsl.telepac.pt)
22:55:14 × drdo quits (~drdo@bl9-110-63.dsl.telepac.pt) (Ping timeout: 260 seconds)
22:55:14 drdo0 is now known as drdo
22:58:12 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 268 seconds)
22:59:29 drdo0 joins (~drdo@bl9-110-63.dsl.telepac.pt)
23:00:56 × drdo quits (~drdo@bl9-110-63.dsl.telepac.pt) (Ping timeout: 252 seconds)
23:01:39 weary-traveler joins (~user@user/user363627)
23:01:53 user363627 joins (~user@user/user363627)
23:05:21 × preflex quits (~preflex@user/mauke/bot/preflex) (Ping timeout: 248 seconds)
23:05:41 preflex joins (~preflex@user/mauke/bot/preflex)
23:05:53 × weary-traveler quits (~user@user/user363627) (Ping timeout: 248 seconds)
23:06:16 × AWizzArd quits (~code@user/awizzard) (Ping timeout: 272 seconds)
23:06:29 AWizzArd joins (~code@gehrels.uberspace.de)
23:07:04 × mauke quits (~mauke@user/mauke) (Ping timeout: 260 seconds)
23:08:44 mauke joins (~mauke@user/mauke)
23:09:13 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
23:14:52 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
23:22:24 alfiee joins (~alfiee@user/alfiee)
23:22:49 mange joins (~user@user/mange)
23:25:22 × Googulator44 quits (~Googulato@2a01-036d-0106-4074-f40d-d825-16f5-119a.pool6.digikabel.hu) (Quit: Client closed)
23:25:40 Googulator44 joins (~Googulato@2a01-036d-0106-4074-f40d-d825-16f5-119a.pool6.digikabel.hu)
23:25:48 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
23:26:12 <Leary> monochrom, mauke: https://hackage.haskell.org/package/exotic-list-monads-1.1.1/docs/Control-Monad-List-Exotic.html
23:26:44 × alfiee quits (~alfiee@user/alfiee) (Ping timeout: 260 seconds)
23:28:25 × sawilagar quits (~sawilagar@user/sawilagar) (Ping timeout: 268 seconds)
23:30:14 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 260 seconds)
23:31:56 <monochrom> Excellent.
23:33:56 × misterfish quits (~misterfis@84.53.85.146) (Ping timeout: 252 seconds)
23:36:26 × __monty__ quits (~toonn@user/toonn) (Quit: leaving)
23:38:43 machinedgod joins (~machinedg@d108-173-18-100.abhsia.telus.net)
23:40:25 <haskellbridge> <magic_rb> Im really trying to understand what im looking at, the only one i understood somewhat was the mazewalk monad
23:41:10 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
23:42:35 <haskellbridge> <magic_rb> Ah the later ones are saner, odd, mini
23:42:41 emmanuelux joins (~emmanuelu@user/emmanuelux)
23:45:38 × Googulator44 quits (~Googulato@2a01-036d-0106-4074-f40d-d825-16f5-119a.pool6.digikabel.hu) (Quit: Client closed)
23:45:52 Googulator44 joins (~Googulato@2a01-036d-0106-4074-f40d-d825-16f5-119a.pool6.digikabel.hu)
23:46:59 <monochrom> Yikes continuum of list monads.
23:49:00 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
23:49:09 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds)
23:51:14 × Googulator44 quits (~Googulato@2a01-036d-0106-4074-f40d-d825-16f5-119a.pool6.digikabel.hu) (Quit: Client closed)
23:51:30 Googulator44 joins (~Googulato@2a01-036d-0106-4074-f40d-d825-16f5-119a.pool6.digikabel.hu)
23:54:24 × vanishingideal quits (~vanishing@user/vanishingideal) (Ping timeout: 272 seconds)
23:55:47 vanishingideal joins (~vanishing@user/vanishingideal)

All times are in UTC on 2025-02-12.