Home liberachat/#haskell: Logs Calendar

Logs on 2024-01-22 (liberachat/#haskell)

00:05:52 <geekosaur> as to the original question: cabal exec program -b package -- args ?
00:06:18 <geekosaur> (remember that a package may have multiple executables)
00:06:45 × Unicorn_Princess quits (~Unicorn_P@user/Unicorn-Princess/x-3540542) (Remote host closed the connection)
00:07:35 <geekosaur> oh, if the package has exactly one executable, cabal run package already does what you want
00:08:09 <geekosaur> otherwise you have to select one, looks like cabal run <package>:exe:<programname>
00:08:49 <geekosaur> you do need the -- to distingush between cabal and program options
00:17:54 jargon joins (~jargon@211.sub-174-205-225.myvzw.com)
00:24:23 × ph88 quits (~ph88@ip5b403f30.dynamic.kabel-deutschland.de) (Ping timeout: 256 seconds)
00:26:36 × gooba_ quits (~gooba@90-231-13-185-no3430.tbcn.telia.com) (Remote host closed the connection)
00:27:03 gooba joins (~gooba@90-231-13-185-no3430.tbcn.telia.com)
00:30:12 × alexherbo2 quits (~alexherbo@2a02-8440-3240-7a11-1531-9b44-c763-5134.rev.sfr.net) (Ping timeout: 250 seconds)
00:39:26 <cheater> geekosaur: i don't mean scripts, i mean executing the main of a package
00:39:41 <cheater> like eg a http server could just serve a directory of html and other files
00:39:48 × TonyStone quits (~TonyStone@074-076-057-186.res.spectrum.com) (Quit: Leaving)
00:39:52 <geekosaur> everything from "as to the original question" above
00:39:54 <cheater> a json parser could do some json stuff
00:40:19 <cheater> "cabal run package already does what you want" really?
00:40:44 <cheater> interesting
00:41:04 <cheater> maybe we should just have more libraries provide useful executables then
00:41:16 <cheater> that sort of thing is popular in python and it actually works pretty well
00:46:41 <newsham> `stack run module`
00:47:00 <newsham> https://docs.haskellstack.org/en/stable/
00:47:24 <newsham> that might give you an experience closer to some of the JS and python package tools
01:04:55 <geekosaur> there is one other thing. you can't arbitrarily execute a library, because Haskell is compiled to native code and the OS imposes a strict distinction between executables and libraries.
01:05:40 <geekosaur> (shared libraries can be executable, but this requires building in a special executable stub which can't be written in Haskell)
01:06:39 <geekosaur> Python is interpreted, so both libraries and programs are scripts and can be executed
01:07:11 <geekosaur> same with JS. this is also true of runghc, but you need -main-is to override ghc looking for Main.main as the entry point
01:07:42 tri joins (~tri@ool-18bc2e74.dyn.optonline.net)
01:12:02 × tri quits (~tri@ool-18bc2e74.dyn.optonline.net) (Ping timeout: 256 seconds)
01:12:49 average joins (uid473595@user/average)
01:13:45 <shapr> howdy newsham, long time no see
01:18:59 <newsham> hey shapr. indeed.  i dont jump on irc too often anymore.  howdy?
01:22:15 <cheater> geekosaur: that's why i suggested putting this in the package manager instead of making it like some sort of OS-level thing
01:23:33 <geekosaur> the package manager can't override the OS here
01:23:51 <geekosaur> if you want to execute the library, it has to be rebuilt as an application
01:24:14 <geekosaur> or interpreted
01:25:21 <geekosaur> also note that neither cabal nor stack knows if a library has a "main" hidden in it somewhere, you would have to specify where to look (again, main-is)
01:25:50 × eggplantade quits (~Eggplanta@2600:1700:38c5:d800:a989:ba9c:c8d7:9054) (Remote host closed the connection)
01:26:23 <haskellbridge> 05<i​rregularsphere> cheater: "popular in python and it actually works pretty well" hmm, python uses venvs nowadays
01:26:52 <cheater> i don't see how that's relevant
01:27:24 <haskellbridge> 05<i​rregularsphere> I think you wanted the package manager to provide binaries system-wide?
01:27:31 <cheater> geekosaur: you'd just look at the cabal file and load the first listed executable.
01:27:45 <cheater> irregular: not really
01:28:01 <haskellbridge> 05<i​rregularsphere> ah, I missed the point then
01:28:12 <haskellbridge> 05<i​rregularsphere> your point*
01:28:13 <geekosaur> cabal and stack already support that, I'm talking about trying to execute a library as is, like you were talking about earlier
01:31:17 eggplantade joins (~Eggplanta@2600:1700:38c5:d800:a989:ba9c:c8d7:9054)
01:32:36 × Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 268 seconds)
01:33:16 Lord_of_Life joins (~Lord@user/lord-of-life/x-2819915)
01:35:17 <haskellbridge> 05<i​rregularsphere> can a library also have Main.main?
01:35:18 × eggplantade quits (~Eggplanta@2600:1700:38c5:d800:a989:ba9c:c8d7:9054) (Read error: Connection reset by peer)
01:36:37 <cheater> geekosaur: i wasn't talking about anything like that :)
01:39:46 <geekosaur> oh sorry, I thought I'd seen mention of Python's __main__ thing
01:41:18 <haskellbridge> 05<i​rregularsphere> ...yeah i don't get what you two were saying, sorry
01:43:50 × peterbecich quits (~Thunderbi@047-229-123-186.res.spectrum.com) (Ping timeout: 252 seconds)
01:45:19 <geekosaur> irregularsphere, a library can't usefully have a Main module because it would take quite a lot of work to convince either cabal or stack to build an executable from it
01:46:02 <geekosaur> and if you tried to build a normal executable using the library it would lead to a linker error because Main.main was defined twice
01:47:08 <haskellbridge> 14<m​aerwald> That's a bug due to text package using C++
01:47:45 <geekosaur> hm, actually I'm not sure of that, it might work as long as there were no external references to anything defined in the library's Main
01:56:44 <cheater> can y'all report this repository with an AI-generated "haskell book"? it's full of bullshit and the guy's just trying to get clout in the community by creating disinformation. https://github.com/dogweather/forkful (here's how you can report it: https://imgur.com/a/YKup5w7 )
01:58:52 <cheater> he literally just had chat gpt generate a book with no work put into it and posted it without any fact checking
01:59:20 <cheater> but he didn't forget to post his linkedin url
02:01:54 <shapr> newsham: howdy!
02:01:57 shapr hops quietly
02:02:16 <shapr> newsham: do you ever end up in the Boston area?
02:02:46 tri joins (~tri@ool-18bc2e74.dyn.optonline.net)
02:03:01 <newsham> i havent been there since the early 2000s.
02:03:58 <newsham> i used to work for a couple companies based there and had to travel there occasionally for work.. that was a long time ago.
02:05:57 tri_ joins (~tri@2607:fb90:555e:511c:45c4:7a0:b2dd:b24a)
02:06:03 × tri_ quits (~tri@2607:fb90:555e:511c:45c4:7a0:b2dd:b24a) (Client Quit)
02:08:55 eggplantade joins (~Eggplanta@2600:1700:38c5:d800:a989:ba9c:c8d7:9054)
02:09:41 × tri quits (~tri@ool-18bc2e74.dyn.optonline.net) (Ping timeout: 252 seconds)
02:28:23 <shapr> aw, too bad
02:33:31 peterbecich joins (~Thunderbi@047-229-123-186.res.spectrum.com)
02:34:17 × [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Remote host closed the connection)
02:36:48 × lockywolf quits (~lockywolf@public.lockywolf.net) (Quit: ZNC 1.8.2 - https://znc.in)
02:39:12 <haskellbridge> 05<i​rregularsphere> cheater: the "Deep Dives" on that repo don't feel like deep dives at all
02:40:12 <cheater> irregular: dude, it's ALL chat gpt. the "creator" of this crap posted it on the subreddit and admitted to it.
02:40:29 <cheater> there's zero actual lucid thought behind this, it's all just computer generated spam
02:40:36 <cheater> please report the repo to github
02:40:44 lockywolf joins (~lockywolf@public.lockywolf.net)
02:40:52 <haskellbridge> 05<i​rregularsphere> I'm not sure how LLMs can even nail links to documentation at all
02:41:04 <cheater> doesn't matter
02:41:15 <newsham> i'm on oahu.  let me know if you visit.  its a nice place to visit. :)
02:41:27 <haskellbridge> 05<i​rregularsphere> Also I'm unsure of what to report it _for_
02:41:58 <haskellbridge> 05<i​rregularsphere> yeah I don't feel good about reporting
02:42:14 <cheater> i posted the imgur link, that shows you what to report it for
02:42:21 <cheater> github has an explicit anti-disinformation policy
02:42:41 <cheater> https://docs.github.com/en/site-policy/acceptable-use-policies/github-misinformation-and-disinformation
02:43:00 <cheater> "You may not post content that presents a distorted view of reality, whether it is inaccurate or false (misinformation) or is intentionally deceptive (disinformation), where such content is likely to result in harm to the public"
02:43:19 <cheater> here's the "how to report" link again: https://imgur.com/a/YKup5w7
02:43:32 <cheater> idk what you're not feeling good about, it's just chat gpt generated garbage
02:45:14 × mima quits (~mmh@aftr-62-216-211-125.dynamic.mnet-online.de) (Ping timeout: 260 seconds)
02:45:19 <cheater> https://www.reddit.com/r/haskell/comments/19bw1zi/my_difficulty_with_haskell_documentation_led_me/
02:45:27 <cheater> here's the original thread (thankfully deleted by mods)
02:46:02 <cheater> this guy's logic is basically he'll create some gpt diarrhea, post it for everyone to contend with, and then he expects useful gnomes from the haskell community will push PR's to fix the idiocy contained within
02:46:29 <cheater> direct quote:
02:46:32 <cheater> "Yep, I'm using an LLM to write the initial article which is stored in a public repo. There, readers can submit PRs. Every page has an "Edit on GitHub" link for it. "
02:49:09 <cheater> "I'm a former editor of an academic journal" *headdesk*
02:50:50 <haskellbridge> 05<i​rregularsphere> Not sure if it was intentionally deceptive, but yes it's inaccurate on some occasions. I still don't feel good about reporting at all though.
02:50:59 <haskellbridge> 05<i​rregularsphere> cheater: _where did he say that?_
02:51:05 <haskellbridge> 05<i​rregularsphere> _what?_
02:51:12 <cheater> he said that on the reddit link i posted.
02:51:27 <cheater> his replies are collapsed because he's been mass-downvoted. you'll have to expand them.
02:51:45 <cheater> don't be naive. he just wants clout for auto-generated spam.
02:52:37 <cheater> if we allow this garbage to stay online we'll soon enough have people coming in here with bad preconceptions, it'll be w3schools all over again (i'm sure there are some people here who remember *that* battle)
03:08:53 × peterbecich quits (~Thunderbi@047-229-123-186.res.spectrum.com) (Ping timeout: 240 seconds)
03:11:07 <cheater> after searching far and wide i have indeed confirmed that this guy was an editor of an academic journal
03:11:14 <cheater> for two years
03:11:28 <cheater> one year editing for spelling mistakes and one year being "managing editor"
03:11:34 <cheater> 15 years ago
03:11:43 <cheater> for an animal law review journal.
03:11:44 × bitmapper quits (uid464869@id-464869.lymington.irccloud.com) (Quit: Connection closed for inactivity)
03:12:00 <haskellbridge> 05<i​rregularsphere> ...yeah that's a me problem, I'm naive.
03:12:18 <cheater> you'd think he'd make less of a fuss about having edited the spelling in a few boring articles nearly two decades ago
03:12:48 <cheater> just fyi that guy's a coder by education, he has nothing to do with either law nor animals
03:13:01 <cheater> so it's not like he was doing high-fly scientific editing there
03:13:38 <haskellbridge> 05<i​rregularsphere> Will check the reddit first, it's blocked in my country but there's a workaround in my laptop (i'm on mobile rn)
03:14:22 <cheater> try just using something like redective
03:15:54 <haskellbridge> 05<i​rregularsphere> nevermind i know a libreddit instance
03:16:11 roboguy_ joins (~roboguy_@2605:a601:ac73:5e00:1dfa:9d7b:ec47:6fda)
03:22:37 × average quits (uid473595@user/average) (Quit: Connection closed for inactivity)
03:22:56 trev joins (~trev@user/trev)
03:26:10 <haskellbridge> 05<i​rregularsphere> yeah sorry can't handle this burden
03:26:57 × roboguy_ quits (~roboguy_@2605:a601:ac73:5e00:1dfa:9d7b:ec47:6fda) (Quit: Leaving...)
03:27:47 × foul_owl quits (~kerry@185.216.231.180) (Ping timeout: 252 seconds)
03:30:13 <haskellbridge> 05<i​rregularsphere> i never have had experience in reporting something*
03:42:12 foul_owl joins (~kerry@157.97.134.168)
03:42:22 × terrorjack quits (~terrorjac@2a01:4f8:c17:87f8::) (Quit: The Lounge - https://thelounge.chat)
03:45:14 terrorjack joins (~terrorjac@2a01:4f8:c17:87f8::)
03:51:38 × emmanuelux_ quits (~emmanuelu@user/emmanuelux) (Read error: Connection reset by peer)
03:52:19 emmanuelux_ joins (~emmanuelu@user/emmanuelux)
03:52:59 × emmanuelux_ quits (~emmanuelu@user/emmanuelux) (Remote host closed the connection)
03:55:59 × td_ quits (~td@i5387090B.versanet.de) (Ping timeout: 268 seconds)
03:56:45 peterbecich joins (~Thunderbi@047-229-123-186.res.spectrum.com)
03:57:15 td_ joins (~td@i53870929.versanet.de)
03:59:35 × img quits (~img@user/img) (Quit: ZNC 1.8.2 - https://znc.in)
04:00:43 img joins (~img@user/img)
04:16:25 tri joins (~tri@172.58.228.124)
04:17:11 <tri> good evening, I am trying to add a new haskell file to a cabal project but cabal isn't letting me to
04:18:13 <tri> https://paste.tomsmeding.com/BkDn0P4p
04:18:31 <tri> these are my cabal project file and the Monad.hs file im trying to add to the project
04:19:11 aforemny joins (~aforemny@i59F516D1.versanet.de)
04:20:15 × aforemny_ quits (~aforemny@i59F516DB.versanet.de) (Ping timeout: 256 seconds)
04:21:13 <monochrom> Is Monad.hs under app/ ?
04:21:42 <tri> yes
04:21:48 <tri> hmm actually...
04:22:09 <tri> i changed it from exposed-modules to other-modules and it works 95% now
04:22:26 <tri> i can import a function in Monad.hs into the Main.hs and use it there
04:22:40 <monochrom> Oh! exposed-modules makes no sense in an executable. It's other-modules.
04:22:41 <tri> and when i run cabal build, cabal sees the 2 modules
04:22:44 czy` joins (~user@114.226.59.181)
04:22:47 <tri> however*
04:23:04 <tri> the compiler, haskell language server, is still having red squiggly line
04:23:13 <tri> let me restart vscode and see
04:24:18 <tri> oh it's gone after the restart, i guess it's a glitch
04:24:24 <tri> thank you for your help
04:25:01 <tri> how do you add a hackage into your cabal project?
04:25:21 <tri> i manually add a hackage by editing the cabal file
04:25:31 <monochrom> package? build-depends
04:25:43 <tri> i googled a bit and see that i could use cabal install
04:25:48 <tri> yes, add a package from Hackage
04:26:46 <tri> but i somehow remember that cabal install actually install the cabal project into my PATH or something like that, and it's night time, im tired to run it and having to go clean up if it's actually install into my PATH
04:26:54 <tri> so i figure i should ask someone
04:27:07 <monochrom> Right, add to build-depends instead.
04:27:43 <tri> yes, as you said, i manually edit the cabal config file to add a package
04:27:54 <tri> but could you tell me what's the cabal command for it?
04:28:20 <monochrom> None. Edit the cabal file.
04:28:28 <tri> holy cow
04:28:31 <tri> oh ok thank you
04:28:59 <tri> by the way, thank you for being active here, i see you day and night here
04:29:17 × Square quits (~Square@user/square) (Ping timeout: 268 seconds)
04:38:34 roboguy_ joins (~roboguy_@2605:a601:ac73:5e00:1dfa:9d7b:ec47:6fda)
04:39:48 × jargon quits (~jargon@211.sub-174-205-225.myvzw.com) (Remote host closed the connection)
04:40:34 × roboguy_ quits (~roboguy_@2605:a601:ac73:5e00:1dfa:9d7b:ec47:6fda) (Client Quit)
04:43:26 <tri> https://paste.tomsmeding.com/BbHBf2PZ
04:43:55 <tri> is there anyway i can print the value of x inside this do notation?
04:44:25 <tri> it's a do of List monad, so i figured i cannot put an IO inside
04:44:52 <tri> but is there a way to get it working?, i want to see what value of x is
04:50:02 <tri> actually this is what i have so far
04:50:02 <tri> https://paste.tomsmeding.com/Jluwq2t4
04:50:27 <tri> but it's still not printing, i guess because that IO () is lazily evalulated, so it's not running
04:51:00 <tri> and because it's being wrapped inside a list monad do notation, there is no way to get it out to have it run
04:55:03 × newsham quits (~newsham@2603-800c-2c01-6825-e4e3-3d73-a50d-4edf.res6.spectrum.com) (Quit: Client closed)
05:03:52 _ht joins (~Thunderbi@28-52-174-82.ftth.glasoperator.nl)
05:04:56 <jackdk> tri: https://hackage.haskell.org/package/base-4.17.0.0/docs/Debug-Trace.html#v:traceShowM might be what you want but might also be unexpected
05:07:53 <tri> jackdk: that works for me. Thank you
05:08:11 michalz joins (~michalz@185.246.207.221)
05:12:04 <jackdk> tri: note that this subverts the whole "purity" thing that Haskell is going for, and is strictly a debugging tool
05:12:25 <tri> i understand. thank you
05:22:58 szkl joins (uid110435@id-110435.uxbridge.irccloud.com)
05:26:37 × michalz quits (~michalz@185.246.207.221) (Quit: ZNC 1.8.2 - https://znc.in)
05:29:29 michalz joins (~michalz@185.246.207.197)
05:32:53 × peterbecich quits (~Thunderbi@047-229-123-186.res.spectrum.com) (Ping timeout: 240 seconds)
05:41:38 × euleritian quits (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Read error: Connection reset by peer)
05:42:22 euleritian joins (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de)
05:46:47 × tri quits (~tri@172.58.228.124) (Remote host closed the connection)
05:51:27 tri joins (~tri@ool-18bc2e74.dyn.optonline.net)
05:57:48 igemnace joins (~ian@user/igemnace)
05:58:17 × tri quits (~tri@ool-18bc2e74.dyn.optonline.net) (Ping timeout: 256 seconds)
06:00:04 tri joins (~tri@ool-18bc2e74.dyn.optonline.net)
06:04:32 × tri quits (~tri@ool-18bc2e74.dyn.optonline.net) (Ping timeout: 252 seconds)
06:05:55 qqq joins (~qqq@92.43.167.61)
06:06:09 × causal quits (~eric@50.35.85.7) (Quit: WeeChat 4.1.1)
06:08:22 × shriekingnoise quits (~shrieking@186.137.175.87) (Ping timeout: 264 seconds)
06:11:33 × euleritian quits (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 260 seconds)
06:12:30 euleritian joins (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de)
06:17:06 takuan joins (~takuan@178-116-218-225.access.telenet.be)
06:20:41 acidjnk joins (~acidjnk@p200300d6e737e732388182bf15709a86.dip0.t-ipconnect.de)
06:25:07 sroso joins (~sroso@user/SrOso)
06:28:29 × euleritian quits (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 240 seconds)
06:29:09 euleritian joins (~euleritia@dynamic-176-006-179-031.176.6.pool.telefonica.de)
06:35:36 × _ht quits (~Thunderbi@28-52-174-82.ftth.glasoperator.nl) (Remote host closed the connection)
06:40:21 CiaoSen joins (~Jura@2a05:5800:2c2:a100:ca4b:d6ff:fec1:99da)
06:51:05 × igemnace quits (~ian@user/igemnace) (Read error: Connection reset by peer)
07:06:23 <haskellbridge> 05<i​rregularsphere> tri: can't you just do this: seq expr expr
07:08:51 igemnace joins (~ian@user/igemnace)
07:12:37 <haskellbridge> 05<i​rregularsphere> otherwise jackdk's advice is more idiomatic i guess
07:13:11 <haskellbridge> 05<i​rregularsphere> jackdk: well, if the only side effect is printing a string it should be good enough
07:13:41 <jackdk> I mean sure but I've had to help people unlearn an over-reliance on Debug.Trace as an application logging tool.
07:14:05 <haskellbridge> 05<i​rregularsphere> wait, what!?
07:14:20 <haskellbridge> 05<i​rregularsphere> ha fair lol :P
07:14:33 × sroso quits (~sroso@user/SrOso) (Ping timeout: 268 seconds)
07:16:22 sroso joins (~sroso@user/SrOso)
07:17:19 × azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 240 seconds)
07:18:32 <EvanR> seq expr expr = expr
07:21:17 × califax quits (~califax@user/califx) (Remote host closed the connection)
07:22:57 califax joins (~califax@user/califx)
07:31:14 × califax quits (~califax@user/califx) (Remote host closed the connection)
07:32:48 califax joins (~califax@user/califx)
07:35:29 × califax quits (~califax@user/califx) (Remote host closed the connection)
07:37:55 califax joins (~califax@user/califx)
07:40:55 × califax quits (~califax@user/califx) (Remote host closed the connection)
07:41:29 califax joins (~califax@user/califx)
07:42:10 × szkl quits (uid110435@id-110435.uxbridge.irccloud.com) (Quit: Connection closed for inactivity)
07:45:06 × califax quits (~califax@user/califx) (Remote host closed the connection)
07:46:42 califax joins (~califax@user/califx)
07:47:07 sord937 joins (~sord937@gateway/tor-sasl/sord937)
07:48:59 <mauke> yeah, this is not a matter of laziness
07:49:08 <mauke> > let x = putStrLn "hi" in length [x, x, x]
07:49:10 <lambdabot> 3
07:49:15 <mauke> > let x = putStrLn "hi" in x `seq` length [x, x, x]
07:49:16 <lambdabot> 3
07:52:19 × sord937 quits (~sord937@gateway/tor-sasl/sord937) (Remote host closed the connection)
07:52:42 <haskellbridge> 05<i​rregularsphere> right
07:52:51 sord937 joins (~sord937@gateway/tor-sasl/sord937)
07:53:10 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
07:53:31 <haskellbridge> 05<i​rregularsphere> yeah i remembered there being a `unsafePerformIO` function but, well, it's unsafe
07:56:01 <int-e> Maybe don't look at how Debug.Trace.trace is implemented then :)
07:59:10 <dminuoso_> unsafePerformIO is unsafe in some really funny ways.
08:00:47 <dminuoso_> For instance, in some situations it can lead do things like aliasing IORefs unexpectedly.
08:01:20 oo_miguel joins (~Thunderbi@78-11-179-96.static.ip.netia.com.pl)
08:01:36 <dminuoso_> And such things is what unsafe is really alludes to. Not that the mere presence of `unsafePerformIO` is unsafe, but if program correctness somehow depends on the effects, thats when you should be paying maximum attention and understand the internals.
08:02:10 cfricke joins (~cfricke@user/cfricke)
08:02:35 <int-e> . o O ( The next lecture will be about reallyUnsafePtrEquality# )
08:03:18 fendor joins (~fendor@2a02:8388:1605:d100:267b:1353:13d7:4f0c)
08:06:41 × sord937 quits (~sord937@gateway/tor-sasl/sord937) (Remote host closed the connection)
08:07:07 sord937 joins (~sord937@gateway/tor-sasl/sord937)
08:08:28 × sord937 quits (~sord937@gateway/tor-sasl/sord937) (Remote host closed the connection)
08:08:56 sord937 joins (~sord937@gateway/tor-sasl/sord937)
08:15:50 × phma quits (phma@2001:5b0:211f:a328:df89:a9c1:b8f3:9c33) (Quit: Konversation terminated!)
08:16:43 phma joins (phma@2001:5b0:211f:a328:df89:a9c1:b8f3:9c33)
08:19:40 <phma> There's a strange bug in Wring https://github.com/phma/wring-twistree : it hangs encrypting a 59049-byte file when compiled without optimization.
08:20:13 <phma> If I run it in ghci, it works fine, just takes several seconds longer.
08:20:28 <phma> If I compile it with -O2, it works fine.
08:20:46 <phma> Any idea how to troubleshoot this bug?
08:22:04 × CiaoSen quits (~Jura@2a05:5800:2c2:a100:ca4b:d6ff:fec1:99da) (Ping timeout: 268 seconds)
08:23:18 <phma> I'm using stack with ghc 9.4.5.
08:24:28 × euleritian quits (~euleritia@dynamic-176-006-179-031.176.6.pool.telefonica.de) (Read error: Connection reset by peer)
08:24:45 × econo_ quits (uid147250@id-147250.tinside.irccloud.com) (Quit: Connection closed for inactivity)
08:24:45 euleritian joins (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de)
08:24:53 <dminuoso_> phma: Debug symbols, attach lldb, and interrupt?
08:26:19 lortabac joins (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4)
08:27:38 × califax quits (~califax@user/califx) (Remote host closed the connection)
08:27:43 <haskellbridge> 05<i​rregularsphere> int-e: no i saw unsafePerformIO before Debug.Trace.trace's impl
08:27:54 <phma> can I attach gdb? I don't know lldb well
08:27:58 <dminuoso_> phma: Sure.
08:28:17 <dminuoso_> See https://ghc.gitlab.haskell.org/ghc/doc/users_guide/debug-info.html
08:28:49 mima joins (~mmh@aftr-62-216-211-136.dynamic.mnet-online.de)
08:28:56 <dminuoso_> phma: Keep note of sections 9.2 and 9.3 of that website.
08:29:19 <phma> do I put -g in ghc-options in package.yaml?
08:30:30 <dminuoso_> I dont use stack/hpack, so I cant say.
08:31:37 × euleritian quits (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 264 seconds)
08:34:26 euleritian joins (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de)
08:34:46 califax joins (~califax@user/califx)
08:35:08 szkl joins (uid110435@id-110435.uxbridge.irccloud.com)
08:37:48 × califax quits (~califax@user/califx) (Remote host closed the connection)
08:38:05 califax joins (~califax@user/califx)
08:38:32 × Batzy quits (~quassel@user/batzy) (Ping timeout: 252 seconds)
08:41:32 <phma> diminuoso_: It got up to 59049, I attached gdb, and it said 0x0000000000d03c44 in ?? ().
08:41:56 <phma> I said where, the backtrace is uninformative.
08:42:21 <phma> #0 0x0000000000d03c44 in ?? ()
08:42:23 <phma> #1 0x0000000000000000 in ?? ()
08:44:06 kuribas joins (~user@2a02:1808:86:1b83:b509:a89:6607:72d4)
08:49:10 yoneda joins (~mike@193.206.102.122)
08:54:17 waleee joins (~waleee@h-176-10-144-38.NA.cust.bahnhof.se)
08:54:59 <phma> When I run file, it does not say "with debug info". ghc-options in WringTwistree.cabal says -g2.
08:55:04 × kuribas quits (~user@2a02:1808:86:1b83:b509:a89:6607:72d4) (Ping timeout: 268 seconds)
09:03:14 × m5zs7k quits (aquares@web10.mydevil.net) (Ping timeout: 260 seconds)
09:04:25 kuribas joins (~user@2a02:1808:86:1b83:7770:d0e2:fe93:8b14)
09:05:06 m5zs7k joins (aquares@web10.mydevil.net)
09:07:11 × Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer)
09:09:17 × waleee quits (~waleee@h-176-10-144-38.NA.cust.bahnhof.se) (Ping timeout: 240 seconds)
09:12:01 waleee joins (~waleee@h-176-10-144-38.NA.cust.bahnhof.se)
09:21:43 mmhat joins (~mmh@p200300f1c724f915ee086bfffe095315.dip0.t-ipconnect.de)
09:23:45 <phma> diminuoso_: I got it to not strip the binary (and everything else, which took quite a while), then ran the binary from the command line (not the shell script), and got this:
09:24:07 <phma> 0x0000000000cfbf21 in containerszm0zi6zi7_DataziSequenceziInternal_zdwtake_info ()
09:25:26 <phma> No idea what that means. where still says just two lines, #1 being 0 (??).
09:29:15 <phma> I did "n" and found myself in stg_BLACKHOLE_info.
09:31:21 × waleee quits (~waleee@h-176-10-144-38.NA.cust.bahnhof.se) (Ping timeout: 256 seconds)
09:31:35 × lortabac quits (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4) (Ping timeout: 260 seconds)
09:31:54 × ft quits (~ft@p508dbda4.dip0.t-ipconnect.de) (Quit: leaving)
09:32:26 yeahitsme joins (~bob@user/yeahitsme)
09:33:25 waleee joins (~waleee@h-176-10-144-38.NA.cust.bahnhof.se)
09:40:13 gehmehgeh joins (~user@user/gehmehgeh)
09:40:59 × tzh quits (~tzh@c-71-193-181-0.hsd1.or.comcast.net) (Quit: zzz)
09:43:05 lortabac joins (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4)
09:53:27 × eggplantade quits (~Eggplanta@2600:1700:38c5:d800:a989:ba9c:c8d7:9054) (Remote host closed the connection)
10:00:06 kuribas` joins (~user@ip-188-118-57-242.reverse.destiny.be)
10:01:10 fansly joins (~fansly@2001:448a:2010:476e:5d30:627d:73c3:a75f)
10:01:25 × waleee quits (~waleee@h-176-10-144-38.NA.cust.bahnhof.se) (Ping timeout: 276 seconds)
10:01:57 × kuribas quits (~user@2a02:1808:86:1b83:7770:d0e2:fe93:8b14) (Ping timeout: 256 seconds)
10:02:55 waleee joins (~waleee@h-176-10-144-38.NA.cust.bahnhof.se)
10:32:17 eggplantade joins (~Eggplanta@2600:1700:38c5:d800:f06f:8f74:1e14:400c)
10:52:27 alexherbo2 joins (~alexherbo@2a02-8440-3341-1bdb-4d7f-e84a-cae7-751c.rev.sfr.net)
11:08:22 × lortabac quits (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4) (Ping timeout: 246 seconds)
11:24:27 × fansly quits (~fansly@2001:448a:2010:476e:5d30:627d:73c3:a75f) (Read error: Connection reset by peer)
11:24:38 fansly joins (~fansly@2001:448a:2010:476e:5d30:627d:73c3:a75f)
11:26:58 × fansly quits (~fansly@2001:448a:2010:476e:5d30:627d:73c3:a75f) (Read error: Connection reset by peer)
11:28:07 fansly joins (~fansly@182.0.167.78)
11:31:03 × fansly quits (~fansly@182.0.167.78) (Read error: Connection reset by peer)
11:33:16 fansly joins (~fansly@103.3.221.236)
11:34:50 × jespada quits (~jespada@cpc121308-nmal25-2-0-cust15.19-2.cable.virginm.net) (Quit: Textual IRC Client: www.textualapp.com)
11:34:59 × sroso quits (~sroso@user/SrOso) (Quit: Leaving :))
11:37:54 jespada joins (~jespada@cpc121308-nmal25-2-0-cust15.19-2.cable.virginm.net)
11:47:25 Feuermagier is now known as Guest1022
11:47:25 Feuermagier_ joins (~Feuermagi@user/feuermagier)
11:47:25 × Guest1022 quits (~Feuermagi@user/feuermagier) (Killed (lithium.libera.chat (Nickname regained by services)))
11:47:25 Feuermagier_ is now known as Feuermagier
11:56:05 × fansly quits (~fansly@103.3.221.236) (Ping timeout: 240 seconds)
11:56:27 fansly joins (~fansly@2001:448a:2010:476e:5d30:627d:73c3:a75f)
11:57:28 lortabac joins (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4)
12:00:21 × picnoir quits (~picnoir@about/aquilenet/vodoo/NinjaTrappeur) (Ping timeout: 245 seconds)
12:02:09 × Axman6 quits (~Axman6@user/axman6) (Remote host closed the connection)
12:02:19 ph88 joins (~ph88@ip5b403f30.dynamic.kabel-deutschland.de)
12:03:22 × ph88 quits (~ph88@ip5b403f30.dynamic.kabel-deutschland.de) (Remote host closed the connection)
12:07:46 × qrpnxz quits (~qrpnxz@fsf/member/qrpnxz) (Quit: Leaving.)
12:18:34 × euleritian quits (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Read error: Connection reset by peer)
12:18:59 euleritian joins (~euleritia@77.22.252.56)
12:19:08 Axman6 joins (~Axman6@user/axman6)
12:25:43 × sord937 quits (~sord937@gateway/tor-sasl/sord937) (Ping timeout: 240 seconds)
12:28:02 sord937 joins (~sord937@gateway/tor-sasl/sord937)
12:34:11 ph88 joins (~ph88@ip5b403f30.dynamic.kabel-deutschland.de)
12:34:21 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
12:34:58 <ph88> How can i make function allPredicate :: [a -> Bool] -> (a -> Bool) ? to be used with all :: (a -> Bool) -> [a] -> Bool later on
12:35:56 <nullie> ph88: id?
12:35:57 × fansly quits (~fansly@2001:448a:2010:476e:5d30:627d:73c3:a75f) (Remote host closed the connection)
12:36:10 <nullie> oh, nevermind
12:37:23 <nullie> ph88: https://hackage.haskell.org/package/swish-0.10.7.0/docs/src/Swish.RDF.Query.html#allp
12:37:26 <kuribas`> ph88: what does it do?
12:38:36 mechap joins (~mechap@user/mechap)
12:38:38 <kuribas`> :t getAll . foldmap (fmap All)
12:38:39 <lambdabot> error:
12:38:39 <lambdabot> • Variable not in scope: foldmap :: (f0 Bool -> f0 All) -> a -> All
12:38:39 <lambdabot> • Perhaps you meant one of these:
12:38:47 <kuribas`> :t getAll . foldMap (fmap All)
12:38:48 <lambdabot> error:
12:38:48 <lambdabot> • Couldn't match type ‘f All’ with ‘All’
12:38:48 <lambdabot> Expected type: t (f Bool) -> All
12:39:08 <kuribas`> :t fmap getAll . foldMap (fmap All)
12:39:09 <lambdabot> (Functor f, Foldable t, Monoid (f All)) => t (f Bool) -> f Bool
12:40:14 <ph88> interesting monoid ^^
12:40:38 <kuribas`> :t even <> odd
12:40:39 <lambdabot> error:
12:40:39 <lambdabot> • Could not deduce (Semigroup Bool) arising from a use of ‘<>’
12:40:40 <lambdabot> from the context: Integral a
12:40:50 <ph88> i'm looking for a solution without a monoid if possible, let me look in the implementation to see if i can extract how it works from there
12:41:35 <ph88> hhmm looks too complicated for me
12:41:57 <haskellbridge> 05<i​rregularsphere> you can do something with foldl' and &&
12:42:31 <kuribas`> :t fmap All even <> fmap All odd
12:42:33 <lambdabot> Integral a => a -> All
12:42:56 <kuribas`> ph88: you can write a trivial "boring" implementation.
12:43:29 <ph88> with fold' and && as i​rregularsphere suggested ?
12:43:39 <kuribas`> for example
12:43:44 <nullie> and and map maybe
12:43:51 <haskellbridge> 05<i​rregularsphere> you can do this boringly: allPredicate fs a = foldl' (&&) $ map (a &) fs
12:43:55 <haskellbridge> 05<i​rregularsphere> let me test for one moment
12:44:14 <haskellbridge> 05<i​rregularsphere> whoops first error
12:45:05 <ph88> foldl' && id xs ?
12:45:06 <haskellbridge> 05<i​rregularsphere> allPredicate fs a = foldl' (&&) True $ map (a &) fs
12:45:43 <haskellbridge> 05<i​rregularsphere> you can't && functions
12:45:49 <ph88> oh ye that's true
12:45:50 <haskellbridge> 05<i​rregularsphere> (&&) :: Bool -> Bool -> Bool
12:46:50 <nullie> :t \ps -> \x -> and [p x | p < ps]
12:46:51 <lambdabot> error:
12:46:51 <lambdabot> • Couldn't match expected type ‘t -> Bool’ with actual type ‘Expr’
12:46:51 <lambdabot> • The function ‘p’ is applied to one argument,
12:47:07 <nullie> :t \ps -> \x -> and [p x | p <- ps]
12:47:07 <haskellbridge> 05<i​rregularsphere> (though for my solution it's pretty clear that allPredicate [] a = True)
12:47:07 <ph88> foldl' (\b a -> (\x -> b x && a x)) id xs
12:47:08 <lambdabot> [t -> Bool] -> t -> Bool
12:47:31 Batzy joins (~quassel@user/batzy)
12:48:05 <haskellbridge> 05<i​rregularsphere> ah wait
12:48:20 azimut joins (~azimut@gateway/tor-sasl/azimut)
12:48:22 <haskellbridge> 05<i​rregularsphere> right, allPredicate fs a = and $ map (a &) fs
12:49:24 <ph88> never seen & before, have to look it up what it does
12:49:41 <haskellbridge> 05<i​rregularsphere> yeah it's the inverse of $ in terms of application
12:49:43 <probie> It's just `flip ($)`
12:49:57 <haskellbridge> 05<i​rregularsphere> yeah
12:50:08 <haskellbridge> 05<i​rregularsphere> so ($ a) works fine as well as (a &)
12:50:18 <haskellbridge> 15<J​ade> which is just `flip id` ;)
12:51:01 <nullie> :t ($)
12:51:03 <lambdabot> (a -> b) -> a -> b
12:51:22 <haskellbridge> 05<i​rregularsphere> yeah $ is basically id with infix 0
12:51:30 <haskellbridge> 15<J​ade> yep
12:51:42 fansly joins (~fansly@103.3.221.236)
12:51:46 <haskellbridge> 15<J​ade> I just added those to the docs of $
12:51:55 <haskellbridge> 05<i​rregularsphere> oh, nice!
12:52:26 <ph88> thanks guys :)
12:52:39 <haskellbridge> 05<i​rregularsphere> ~~jade: ...shouldn't it be obvious given the type of $~~
12:52:56 <haskellbridge> 05<i​rregularsphere> ph88: yw, good luck!
12:54:59 <haskellbridge> 15<J​ade> I gave a small explanation that `a -> a` is the same as `(a -> b) -> (a -> b)` by substitution and then trivially `(a -> b) -> a -> b` because of associativity :)
12:55:32 <haskellbridge> 15<J​ade> s/the same as//
12:56:21 × AlexZenon quits (~alzenon@94.233.241.143) (Ping timeout: 256 seconds)
12:57:42 <dminuoso_> Jade: It is not the same.
13:01:39 <haskellbridge> 05<i​rregularsphere> Jade: I would prefer if you just explained that `$` is just `id` restricted to `(a -> b) -> (a -> b)`.
13:02:10 <haskellbridge> 05<i​rregularsphere> (or `id` but only for `a -> b`)
13:04:04 <dminuoso_> Jade: They are unifiable. If you want to call them the same, you'd have to define what equality on types is exactly.
13:04:57 × gehmehgeh quits (~user@user/gehmehgeh) (Remote host closed the connection)
13:04:57 × sord937 quits (~sord937@gateway/tor-sasl/sord937) (Remote host closed the connection)
13:04:58 × califax quits (~califax@user/califx) (Remote host closed the connection)
13:05:31 califax joins (~califax@user/califx)
13:05:54 gehmehgeh joins (~user@user/gehmehgeh)
13:06:17 sord937 joins (~sord937@gateway/tor-sasl/sord937)
13:06:40 <haskellbridge> 05<i​rregularsphere> "`a -> a` is the same as `(b -> c) -> (b -> c)`" can be abused to conclude "for any `a -> a` it must be a `(b -> c) -> (b -> c)`", which in this case, has trivial counterexamples, such as: `() -> ()` is not a form of `(b -> c) -> (b -> c)`.
13:07:41 × fansly quits (~fansly@103.3.221.236) (Ping timeout: 256 seconds)
13:07:43 × califax quits (~califax@user/califx) (Read error: Connection reset by peer)
13:08:21 califax joins (~califax@user/califx)
13:08:29 fansly joins (~fansly@2001:448a:2010:476e:5d30:627d:73c3:a75f)
13:11:07 AlexZenon joins (~alzenon@94.233.241.143)
13:15:52 iakov joins (~user@2a02:8106:244:b000:57f6:37d4:b4f4:dc14)
13:19:58 <iakov> Hello ! I have a https://github.com/obsidiansystems/obelisk project running, and i whould like to use rhyolite as a dependency. I have a 'hetzner' nixos instance running, which I created with nixos-infect. Building and running on my local machine works fine, but when deploying using obelisk with `ob deploy push`, the process on the remote nixos machine complains that it cannot find the rhyolite package.
13:20:21 <iakov> error: opening file '/nix/store/jlyfl0n6a36r6sw2rnk2aic8zz6i08z1-rhyolite/default.nix': No such file or directory
13:20:28 <dminuoso_> irregularsphere: What does "is the same as" mean, exactly?
13:21:26 <dminuoso_> If we consider Leibnitz equality, they are absolutely not the same.
13:21:40 <dminuoso_> There's terms that will type check with a type of `a -> a` but not with `(b -> c) -> (b -> c)`
13:22:00 <iakov> (sorry for not asking a fully detailed question, i'm not used to IRC - and pressed 'Enter' prematurely, before finishing the question and elaborating on the details.)
13:22:04 <dminuoso_> As the simplest example
13:23:06 <dminuoso_> % :t (id :: (b -> c) -> (b -> c)) () -- irregularsphere
13:23:06 <yahb2> <interactive>:1:30: error: ; • Couldn't match expected type ‘b -> c’ with actual type ‘()’ ; • In the first argument of ‘id :: (b -> c) -> (b -> c)’, namely ; ‘()’ ; In the ex...
13:23:18 <iakov> Currently, as described in the 'deployment' section of the obelisk readme, it's required to create a module.nix which is supposed to contain the configuration for the machine. Do I have to pass the rhyolite dependency to the module.nix too ?
13:23:36 <dminuoso_> % :t (id :: a -> a) () -- c.f.
13:23:36 <yahb2> (id :: a -> a) () -- c.f. :: ()
13:23:45 <haskellbridge> 05<i​rregularsphere> dminuoso: yeah I thought "`t0` is the same as `t1`" as in "for any `x: t0`, then x is in `t1` and vice versa"
13:23:52 <haskellbridge> 05<i​rregularsphere> similar to set equality
13:23:59 <haskellbridge> 05<i​rregularsphere> dunno, never that experienced with philosophy
13:29:05 siw5ohs0 joins (~aiw5ohs0@user/aiw5ohs0)
13:29:14 siw5ohs0 parts (~aiw5ohs0@user/aiw5ohs0) (Leaving)
13:29:18 <dminuoso_> irregularsphere: The comparison works only for monotypes.
13:29:27 <dminuoso_> Quantified types are.. well quantified.
13:29:48 <dminuoso_> That is, the `a` in `id :: a -> a` is not a single type
13:29:52 aljazmc joins (~aljazmc@user/aljazmc)
13:30:05 <dminuoso_> It might be more obvious if you include the implicit quantification: id :: forall a. a -> a`
13:30:53 <haskellbridge> 05<i​rregularsphere> ...it might take a year or two to get myself comfortable with these terms
13:31:26 shriekingnoise joins (~shrieking@186.137.175.87)
13:31:44 <dminuoso_> irregularsphere: Its also called a type schema. You can really interpret that line as reading `forall choices choices of a, id has type a -> a`
13:32:24 <dminuoso_> And you can make any such choice, `for a ~ Int, id has type Int -> Int`
13:32:30 <dminuoso_> So you can think of this as id having many types.
13:32:45 <haskellbridge> 05<i​rregularsphere> yeah actually to make myself clearer what i actually mean is that "`s0` is the same thing `s1`", to me, means "for any type `x` with the form `s0` then `x` also has the form `s1` and vice versa"
13:33:09 <dminuoso_> I think you might enjoy a dive into type theory.
13:33:17 <haskellbridge> 05<i​rregularsphere> wow the terminology in this functional programming universe is wild
13:33:38 <haskellbridge> 05<i​rregularsphere> way different from where I came from (imperative/object-oriented)
13:33:41 <dminuoso_> irregularsphere: This is not just theoretic nonsense, by the way.
13:33:53 <dminuoso_> In GHC, there's a direct correspondence to how this is compiled.
13:34:10 <haskellbridge> 05<i​rregularsphere> I know, I usually look up terminology whenever I enounter a new one.
13:35:33 <kuribas`> polymorphic id is a function from a type to a monomorphic function.
13:35:56 <kuribas`> But you don't apply it directly, the type inference engine derives the type then applies it.
13:36:28 <kuribas`> (forall a.a -> a) applied to Int becomes Int -> Int
13:36:50 <haskellbridge> 05<i​rregularsphere> does monomorphic basically mean "unique type"
13:37:15 <dminuoso_> In System F lingo, you would write: /\a. \x^a -> x : ∀a. a -> a
13:37:25 <dminuoso_> So there's even a binder there.
13:37:36 <dminuoso_> Which demonstrates its a kind of abstraction over a type.
13:38:37 picnoir joins (~picnoir@about/aquilenet/vodoo/NinjaTrappeur)
13:39:08 <haskellbridge> 05<i​rregularsphere> I feel dumbfounded right now
13:39:31 <dminuoso_> And this translates directly to GHC Haskell too.
13:39:43 <dminuoso_> So if there's a binder over a type, we should be able to apply `id` to a type. Lets do that:
13:39:47 <dminuoso_> % :set -XTypeApplications
13:39:47 <yahb2> <no output>
13:39:49 <dminuoso_> % :t id
13:39:49 <yahb2> id :: a -> a
13:39:51 <dminuoso_> % :t id @Int
13:39:51 <yahb2> id @Int :: Int -> Int
13:39:54 <dminuoso_> % :t id @Int 10
13:39:54 <yahb2> id @Int 10 :: Int
13:40:19 <dminuoso_> See how we apply id to two arguments here? One is a type argument, the other a value level argument.
13:40:34 <dminuoso_> And that's what instantiates `a` of `a -> a` at a particular type.
13:40:43 <dminuoso_> GHC inserts these applications automatically and transparently for you everywhere.
13:41:24 <haskellbridge> 05<i​rregularsphere> to be fair I'm never getting the gist (of entire meaning of words) with examples, it's probably better for me if I looked them up. Thanks though!
13:42:21 <haskellbridge> 05<i​rregularsphere> Is Stanford Encyclopedia of Philosophy a good resource?
13:42:31 <dminuoso_> What for, exactly?
13:43:04 <dminuoso_> Anyway. All I wanted to get across, is that in most senses of the word "equality", `a` is not equal to `b -> c`
13:43:23 <haskellbridge> 05<i​rregularsphere> Various stuff. It appeared when I searched "lambda calculus" or "type theory".
13:43:36 <dminuoso_> However, with a bit more careful definitions one could say that they are unifiable, but not in general (because we need to be careful about quantifiers here)
13:44:29 <dminuoso_> If you want to learn about type theory, Benjamin C. Pierce's Types and Programming Languages is probably one of the most widely read books.
13:44:37 <dminuoso_> It's a good entry into practical type theory
13:44:50 <exarkun> One thing I realized at some point is that in the Haskell space, words have meaning and learning the actually meaning is extremely valuable. This, in contrast to a lot of imperative spaces where words are vague and used to mean either a lot of different things or nothing at all and you can hand-wave your way through most of it.
13:45:26 <exarkun> So the imperative programming technique of just charging forward without a firm understanding doesn't lead to much success in Haskell.
13:45:35 <exarkun> (That's my personal experience, anyway)
13:45:43 × Lycurgus quits (~georg@user/Lycurgus) (Quit: leaving)
13:45:59 azimut_ joins (~azimut@gateway/tor-sasl/azimut)
13:46:07 × sord937 quits (~sord937@gateway/tor-sasl/sord937) (Ping timeout: 240 seconds)
13:46:31 × azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 240 seconds)
13:47:55 sord937 joins (~sord937@gateway/tor-sasl/sord937)
13:48:02 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Quit: = "")
13:48:43 × azimut_ quits (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection)
13:49:28 azimut joins (~azimut@gateway/tor-sasl/azimut)
13:51:50 × alexherbo2 quits (~alexherbo@2a02-8440-3341-1bdb-4d7f-e84a-cae7-751c.rev.sfr.net) (Remote host closed the connection)
13:52:09 alexherbo2 joins (~alexherbo@2a02-8440-3341-1bdb-4d7f-e84a-cae7-751c.rev.sfr.net)
13:55:43 xiliuya joins (~xiliuya@user/xiliuya)
13:57:10 × xiliuya quits (~xiliuya@user/xiliuya) (Client Quit)
13:57:31 xiliuya joins (~xiliuya@user/xiliuya)
13:58:38 × iakov quits (~user@2a02:8106:244:b000:57f6:37d4:b4f4:dc14) (Quit: rcirc on GNU Emacs 28.3)
14:07:06 <haskellbridge> 15<J​ade> this is why I removed the "is the same as" ^^
14:07:07 <haskellbridge> 15<J​ade> I didn't find the right phrasing in that moment, but yes, I wanted to say that in the specific case of `$`, the type variable `a` takes the form of `b -> c`
14:07:14 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
14:12:31 × justsomeguy quits (~justsomeg@user/justsomeguy) (Ping timeout: 260 seconds)
14:13:38 <dminuoso_> Im pondering how to express this concisely.
14:15:47 <haskellbridge> 05<i​rregularsphere> any `(b -> c) -> (b -> c)` is an `a -> a`
14:16:44 <dminuoso_> I am wondering whether it is that rabbit hole leading down to homotopy type theory that somehow describes this relationship `id = ($)`
14:16:56 <dminuoso_> Because that's what you're reallying trying to say, here.
14:17:37 <dminuoso_> From a Damas Milner type inference perspective, getting from `a` to `b -> c` here is two separate steps. Substitution and generalization.
14:17:41 <haskellbridge> 05<i​rregularsphere> I thought searching terminology would be _fun_, not lead me down to _4 different rabbitholes at once!_
14:17:49 <dminuoso_> But Im not sure whether that gives any sort of relationships between the types themselves.
14:17:58 <ncf> you don't need homotopy type theory to be explicit about type arguments
14:18:03 <dminuoso_> Other than "they are unifiable"
14:18:11 <ncf> ($) {x} {y} = id {x → y}
14:19:58 <ncf> or, if you like, ($) = id ∘ (→)
14:20:10 <dminuoso_> ncf: Mmm, maybe the real problem here is that this is only implicitly described by `id = ($)` and all attempts above are just a rather verbose way of describingthat.
14:20:27 <dminuoso_> Or `($) = id` rather, since we are in Haskell.
14:22:24 × tt1231 quits (~tt123@2603-6010-8700-4a81-219f-50d3-618a-a6ee.res6.spectrum.com) (Quit: The Lounge - https://thelounge.chat)
14:24:36 tt1231 joins (~tt123@2603-6010-8700-4a81-219f-50d3-618a-a6ee.res6.spectrum.com)
14:27:08 <haskellbridge> 05<i​rregularsphere> apparently i discovered an interesting thing
14:27:27 <haskellbridge> 05<i​rregularsphere> `main = print (map (-1) [1,2,3] :: [Integer])` is invalid (where - is taken as a negation sign)
14:27:33 <haskellbridge> 05<i​rregularsphere> `main = print (map (+ (-1)) [1,2,3] :: [Integer])` is valid
14:28:34 × dsrt^ quits (~cd@c-98-242-74-66.hsd1.ga.comcast.net) (Ping timeout: 276 seconds)
14:31:38 Square joins (~Square@user/square)
14:31:45 × fansly quits (~fansly@2001:448a:2010:476e:5d30:627d:73c3:a75f) (Remote host closed the connection)
14:34:08 thegeekinside joins (~thegeekin@189.180.85.240)
14:37:12 fansly joins (~fansly@2001:448a:2010:476e:5d30:627d:73c3:a75f)
14:41:16 <tomsmeding> yeah, that's why `subtract` exists
14:41:23 <tomsmeding> map (subtract 1)
14:42:18 <haskellbridge> 05<i​rregularsphere> ah right
14:42:54 <tomsmeding> it's a bit of an infelicity in the syntax :p
14:47:01 michalz_ joins (~michalz@185.246.207.218)
14:48:02 × michalz quits (~michalz@185.246.207.197) (Ping timeout: 256 seconds)
14:48:37 × igemnace quits (~ian@user/igemnace) (Read error: Connection reset by peer)
14:49:02 <yushyin> maybe unpopular opinion, but I'm actually ok with -XLexicalNegation
14:49:11 igemnace joins (~ian@user/igemnace)
14:52:32 Square2 joins (~Square4@user/square)
14:54:31 × califax quits (~califax@user/califx) (Ping timeout: 240 seconds)
14:54:50 × earthy quits (~arthurvl@2a02-a469-f5e2-1-83d2-ca43-57a2-dc81.fixed6.kpn.net) (Ping timeout: 256 seconds)
14:55:41 califax joins (~califax@user/califx)
14:55:49 × Square quits (~Square@user/square) (Ping timeout: 268 seconds)
14:56:31 × sord937 quits (~sord937@gateway/tor-sasl/sord937) (Ping timeout: 240 seconds)
14:58:22 × mmhat quits (~mmh@p200300f1c724f915ee086bfffe095315.dip0.t-ipconnect.de) (Ping timeout: 260 seconds)
14:58:44 mmhat joins (~mmh@p200300f1c724f91bee086bfffe095315.dip0.t-ipconnect.de)
14:58:47 sord937 joins (~sord937@gateway/tor-sasl/sord937)
14:59:28 × alexherbo2 quits (~alexherbo@2a02-8440-3341-1bdb-4d7f-e84a-cae7-751c.rev.sfr.net) (Remote host closed the connection)
14:59:39 sadie72 joins (~sadie@199.96.187.158)
15:02:57 dsrt^ joins (~cd@c-98-242-74-66.hsd1.ga.comcast.net)
15:03:16 × stiell quits (~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection)
15:03:34 × sadie72 quits (~sadie@199.96.187.158) (Client Quit)
15:03:52 stiell joins (~stiell@gateway/tor-sasl/stiell)
15:04:23 × dsrt^ quits (~cd@c-98-242-74-66.hsd1.ga.comcast.net) (Remote host closed the connection)
15:07:46 azimut_ joins (~azimut@gateway/tor-sasl/azimut)
15:08:31 × azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 240 seconds)
15:08:49 × azimut_ quits (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection)
15:09:19 azimut joins (~azimut@gateway/tor-sasl/azimut)
15:10:27 × xiliuya quits (~xiliuya@user/xiliuya) (Quit: bye)
15:10:39 average joins (uid473595@user/average)
15:14:37 <tomsmeding> % :set -XLexicalNegation
15:14:37 <yahb2> <no output>
15:14:43 <tomsmeding> % :t ((-1), (- 1))
15:14:43 <yahb2> ((-1), (- 1)) :: (Num a1, Num a2) => (a1, a2 -> a2)
15:15:06 tomsmeding is okay with that too
15:17:17 × euleritian quits (~euleritia@77.22.252.56) (Ping timeout: 252 seconds)
15:17:43 euleritian joins (~euleritia@dynamic-176-006-199-114.176.6.pool.telefonica.de)
15:18:39 noumenon joins (~noumenon@113.51-175-156.customer.lyse.net)
15:19:41 × califax quits (~califax@user/califx) (Remote host closed the connection)
15:20:06 califax joins (~califax@user/califx)
15:24:30 iakov2 joins (~iakov@2a02:8106:244:b000:57f6:37d4:b4f4:dc14)
15:26:09 × califax quits (~califax@user/califx) (Remote host closed the connection)
15:26:40 califax joins (~califax@user/califx)
15:31:37 × elkcl quits (~elkcl@broadband-95-84-226-240.ip.moscow.rt.ru) (Ping timeout: 276 seconds)
15:34:27 <monochrom> MultiwayIf
15:35:06 <tomsmeding> hm?
15:35:21 <monochrom> That's another of my favourite unpopular extension!
15:36:05 <tomsmeding> is it unpopular? I love it
15:36:14 × xacktm quits (xacktm@user/xacktm) (Remote host closed the connection)
15:36:22 <monochrom> Not enough to make it into GHC2021.
15:36:32 <tomsmeding> I don't use it very often, but I have no qualms about using it when it's convenient
15:38:13 elkcl joins (~elkcl@broadband-95-84-226-240.ip.moscow.rt.ru)
15:40:45 <dminuoso_> OrPatterns to me is dead on arrival.
15:41:03 <tomsmeding> wasn't that the thing where you couldn't bind variables in the alternatives?
15:41:04 <dminuoso_> I dislike it so much because of what Im missing out.
15:41:07 <dminuoso_> tomsmeding: Right!
15:41:14 <tomsmeding> then it's pointless (ha!)
15:41:15 <dminuoso_> The one thing that made the whole thing interesting in the first place.
15:42:11 <tomsmeding> although it's easy to extend it to include binding, I guess
15:42:37 <dminuoso_> tomsmeding: It was pulled out for some reasons.
15:42:53 <dminuoso_> As far as I gathered it, it would have been massively complicated for.. reasons?
15:43:19 <tomsmeding> there were probably reasons
15:43:29 <dminuoso_> Oh there definitely were. It was part of the original proposal.
15:43:38 <dminuoso_> They just werent discussed in detail on the issue tracker
15:44:37 <dminuoso_> I think this is one of the examples where Haskell is at the end more of a research base that just doesnt compromise for utility.
15:45:07 <tomsmeding> we got a surprising amount of utility for being a research base, then :)
15:45:51 <dminuoso_> Oh sure, Im not saying these two things cant be compatible.
15:46:28 <dminuoso_> But the interests arent quite aligned with average joe fixing bug reports on some haskell clump.
15:47:15 × fansly quits (~fansly@2001:448a:2010:476e:5d30:627d:73c3:a75f) (Remote host closed the connection)
15:47:20 <tomsmeding> yeah
15:51:03 <kuribas`> I really miss guards in idris.
15:51:03 ystael joins (~ystael@user/ystael)
15:51:13 <kuribas`> But I suppose it is hard to implement with dependent types.
15:51:22 <tomsmeding> why would it be?
15:51:33 <dminuoso_> Its just syntax in the end.
15:51:35 <tomsmeding> what's difficult about pattern matching on a boolean
15:52:17 <tomsmeding> I suspect it's more that "if everything has intrinsic type information, boolean blindness is even worse so pattern matching on booleans is almost never useful"
15:52:47 <tomsmeding> perhaps for you that assumption on "everything" is false ;)
15:54:28 fansly joins (~fansly@2001:448a:2010:476e:5d30:627d:73c3:a75f)
16:01:56 <tomsmeding> I have just one problem with MultiwayIf and that's that I can never remember which of Multi{w,W}ayIf{,s} it is
16:05:39 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
16:09:48 <c_wraith> eh. GHC suggests the right one if you get it wrong
16:09:49 <tomsmeding> dminuoso_: I see this text in the proposal: "Correctly specifying the semantics is hard and caused the parent proposal to become dormant after no progress has been made."
16:09:58 <tomsmeding> c_wraith: true
16:10:11 <dminuoso_> tomsmeding: Yeah, it was rather nebulous.
16:10:58 <tomsmeding> I would've said "just disallow OrPatterns with GADT-like constructors or use of ExistentialQuantification"
16:11:05 <tomsmeding> can always fix that later
16:11:16 <tomsmeding> I get that making that work nicely would've been hard
16:12:09 <ph88> does anyone know a haskell equivelant of this function? https://pursuit.purescript.org/packages/purescript-foldable-traversable/6.0.0/docs/Data.Foldable#v:and
16:12:35 <tomsmeding> :t and
16:12:36 <dminuoso_> tomsmeding: But yeah, its a difficult one opposed to Der{iving,ive}Strategies, Der{iving,ive}Via, EmptyDataDecl{s,arations}, ImplicitParam{s,eters}, MonadComprehensions but ParallelListComp, or Non{D,d}ecreasingIndention (things I learn...)
16:12:36 <lambdabot> Foldable t => t Bool -> Bool
16:12:57 <tomsmeding> dminuoso_: point taken :p
16:14:18 × euleritian quits (~euleritia@dynamic-176-006-199-114.176.6.pool.telefonica.de) (Read error: Connection reset by peer)
16:14:24 <tomsmeding> ph88: did you want anything more than what 'and' already does?
16:14:31 <dminuoso_> At least GHC seems to accept alternate British spelling which is great, because Im consistently inconsistent with my z's and s's.
16:14:38 euleritian joins (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de)
16:14:45 <dminuoso_> Generali{s,z}edNewtypeDeriving are both valid. :)
16:15:12 <tomsmeding> I'm consistently consistent with s but have grudgingly accepted that elements of syntax and built-in names are conventionally z
16:15:31 <c_wraith> I suppose given that it's the *Glasgow* Haskell compiler, we're lucky it accepts z at all
16:15:40 <tomsmeding> you will see me write `color: #000; # black colour` in css
16:16:01 <tomsmeding> (not in this instance because the comment is superfluous, but you get the point)
16:16:36 <dminuoso_> c_wraith: Even more surprising that the American spelling was there first, then.
16:16:55 <dminuoso_> But maybe the American spelling was deemed to cause less bikeshedding on the proposal?
16:16:57 <ph88> tomsmeding, yes to accept function f (a -> Bool) -> (a -> Bool)
16:17:23 <tomsmeding> ph88: then you're essentially asking for the HeytingAlgebra type class
16:17:33 <ph88> is it available in haskell ?
16:17:35 <tomsmeding> because the folding logic is already there in foldMap
16:17:48 <tomsmeding> if you write the type class, then you can use foldMap to use it
16:18:01 <ph88> oh ok nothing out of the box, np
16:18:14 <tomsmeding> yeah no I haven't seen such a type class before in haskell
16:18:29 <tomsmeding> but no reason it couldn't be written
16:18:43 × lortabac quits (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4) (Quit: WeeChat 4.1.1)
16:19:11 × euleritian quits (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 264 seconds)
16:19:17 euleritian joins (~euleritia@dynamic-176-006-199-114.176.6.pool.telefonica.de)
16:21:44 <tomsmeding> :t (and .) . sequence -- ph88
16:21:45 <lambdabot> Traversable t => t (a -> Bool) -> a -> Bool
16:22:16 <tomsmeding> sequence the `t (a -> Bool)` to `a -> t Bool`, then `and` it
16:22:40 <tomsmeding> if you don't need the generality of the type class, this gets you the functionality of that particular instance concisely
16:25:19 <ph88> tomsmeding, interesting solution :)))
16:27:06 billchenchina joins (~billchenc@2a0d:2580:ff0c:1:e3c9:c52b:a429:5bfe)
16:28:30 target_i joins (~target_i@217.175.14.39)
16:28:49 × euleritian quits (~euleritia@dynamic-176-006-199-114.176.6.pool.telefonica.de) (Read error: Connection reset by peer)
16:29:07 euleritian joins (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de)
16:30:22 <kuribas`> tomsmeding: it's not just a trivial compile to "if", since guards interact with pattern matching.
16:30:25 × cfricke quits (~cfricke@user/cfricke) (Quit: WeeChat 4.1.2)
16:31:05 × euleritian quits (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Read error: Connection reset by peer)
16:31:06 <kuribas`> foo (Bar x) | fun(x) = ... ; foo y = ...
16:31:34 <c_wraith> that doesn't add too much complexity
16:31:38 <tomsmeding> kuribas`: that's true. I guess it becomes harder if you want the evidence that guards are false to influence coverage checking
16:31:53 <tomsmeding> but I guess one could just not do that
16:31:53 <kuribas`> tomsmeding: and idris is already buggy when it comes to coverage checking.
16:31:55 <kuribas`> yeah
16:31:56 <tomsmeding> haskell also doesn't really do that
16:32:03 euleritian joins (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de)
16:32:05 <c_wraith> Though IIRC Haskell2010 makes PatternGuards on by default?
16:32:45 <tomsmeding> can't you just let coverage checking ignore boolean guards?
16:32:50 <tomsmeding> I think that would be sound
16:33:28 <tomsmeding> actually, let it ignore all guards, would still be sound
16:34:10 <tomsmeding> doing something more intelligent with pattern guards would perhaps be harder, but there it would even be unclear to what extent you want that evidence to be taken into account
16:34:14 <c_wraith> sound in what sense? totality checking?
16:34:19 <tomsmeding> yes
16:34:28 <c_wraith> You can't ignore guards for that
16:38:18 <c_wraith> and I retract my earlier statement. In the context of totality checking, that example from kuribas` *does* add a ton of complexity
16:38:49 <tomsmeding> only if you want to determine total functions as being total, right?
16:39:03 <tomsmeding> not if you just want that if you declare a function to be total, it really is total
16:39:10 <tomsmeding> the first I could call completeness, the second soundness
16:41:19 × ChaiTRex quits (~ChaiTRex@user/chaitrex) (Ping timeout: 240 seconds)
16:43:19 <tomsmeding> totality checking is best-effort in any case
16:44:02 <tomsmeding> completeness is impossible to achieve, so being a bit more incomplete in the presence of boolean guards sounds okay to me
16:44:22 <tomsmeding> though if you also have pattern guards it might be nice to be able to get some evidence from that, which is indeed harder
16:44:45 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
16:47:25 <c_wraith> I would say completeness is getting the correct answer for everything (known impossible) and soundness is not accepting any incorrect program (at the cost of rejecting some correct ones). If you just ignore guards, you've lost soundness.
16:47:52 <c_wraith> If you treat all guards as never matching, you retain soundness, but it's not very useful!
16:48:59 <tomsmeding> oh right, yes, what I meant (but didn't say) is indeed to treat guards as never-matching
16:49:07 <tomsmeding> well, for boolean guards it's almost impossible to do better
16:49:14 <tomsmeding> pattern guards I'm not sure about
16:49:18 Square joins (~Square@user/square)
16:49:46 <tomsmeding> the information you get from a boolean guard is a single equality (of the boolean expression with true/false depending on in which branch you area)
16:49:48 <tomsmeding> *are
16:50:25 <tomsmeding> I guess you could use that as another fact you can re-check in all subsequent situations to detect contradictions
16:51:05 <tomsmeding> that wouldn't be too hard I feel (though disclaimer, I know nothing about how dependently-typed coverage checkers actually work), and doing anything better would suddenly involve serious analysis of your program
16:51:07 <tomsmeding> beyond the types
16:52:45 ChaiTRex joins (~ChaiTRex@user/chaitrex)
16:53:17 × Square2 quits (~Square4@user/square) (Ping timeout: 268 seconds)
16:53:34 × fansly quits (~fansly@2001:448a:2010:476e:5d30:627d:73c3:a75f) (Remote host closed the connection)
16:56:35 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection)
16:56:54 econo_ joins (uid147250@id-147250.tinside.irccloud.com)
16:57:11 FinnElija joins (~finn_elij@user/finn-elija/x-0085643)
16:57:43 × ChaiTRex quits (~ChaiTRex@user/chaitrex) (Ping timeout: 240 seconds)
16:58:07 _ht joins (~Thunderbi@28-52-174-82.ftth.glasoperator.nl)
16:58:08 tri joins (~tri@ool-18bc2e74.dyn.optonline.net)
16:59:27 × tri quits (~tri@ool-18bc2e74.dyn.optonline.net) (Remote host closed the connection)
17:00:05 × waleee quits (~waleee@h-176-10-144-38.NA.cust.bahnhof.se) (Ping timeout: 240 seconds)
17:00:28 tri joins (~tri@ool-18bc2e74.dyn.optonline.net)
17:04:24 <kuribas`> tomsmeding: so you assume the guard never matches, and look if it still is total? Wouldn't that make any function with guards automatically non-total?
17:06:35 × tri quits (~tri@ool-18bc2e74.dyn.optonline.net) (Ping timeout: 264 seconds)
17:06:56 tri joins (~tri@ool-18bc2e74.dyn.optonline.net)
17:07:08 ChaiTRex joins (~ChaiTRex@user/chaitrex)
17:07:19 × califax quits (~califax@user/califx) (Remote host closed the connection)
17:08:49 califax joins (~califax@user/califx)
17:08:51 <tomsmeding> kuribas`: do you have an example of a function where my cowardly policy of "assume guards never match" would not be usable?
17:10:46 × iakov2 quits (~iakov@2a02:8106:244:b000:57f6:37d4:b4f4:dc14) (Ping timeout: 250 seconds)
17:11:12 × califax quits (~califax@user/califx) (Remote host closed the connection)
17:11:34 califax joins (~califax@user/califx)
17:11:46 <kuribas`> tomsmeding: you just remove all clauses, no?
17:12:02 <kuribas`> foo x | x = 1 | otherwise = 2
17:12:14 <kuribas`> no clauses remain...
17:12:22 <tomsmeding> right, I assume that all guards never match unless they simplify to 'true' :p
17:12:39 <kuribas`> How do I know if they simplify to true?
17:13:23 <kuribas`> That sounds wrong... foo x | x = partial_fun x | otherwise = 2
17:13:25 <tomsmeding> do the WHNF evaluation process that the type checker will need to do anyhow when checking a dependently-typed program?
17:13:42 <kuribas`> It's partial, but ignoring guard 1 makes it total...
17:13:51 <tomsmeding> how would partial_fun have typechecked
17:14:07 <tomsmeding> like, you still need to check the right-hand sides
17:14:16 <tomsmeding> you only do this for coverage checking, not for reachability checking
17:14:24 <kuribas`> tomsmeding: partial_fun : Bool -> Int
17:14:38 × califax quits (~califax@user/califx) (Remote host closed the connection)
17:14:41 <kuribas`> hmm
17:15:24 × eggplantade quits (~Eggplanta@2600:1700:38c5:d800:f06f:8f74:1e14:400c) (Remote host closed the connection)
17:15:41 eggplantade joins (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net)
17:15:51 <kuribas`> right, so this covers, but is not total...
17:16:06 <kuribas`> So the ignored clauses still need to be total.
17:16:07 <tomsmeding> the 'otherwise' branch makes it total
17:16:13 califax joins (~califax@user/califx)
17:17:18 <tomsmeding> yes, I'm imagining the algorithm to be this: 1. desugar `foo x | guard1 = rhs1 | guard2 = rhs2` to `foo x | guard1 = rhs1 ; foo x | guard2 = rhs2`
17:17:40 <tomsmeding> 2. when encountering a case with a guard, typecheck it as if the guard weren't there
17:17:56 <tomsmeding> 3. then continue with the rest of the cases as if that guard-having case weren't there
17:18:07 × ChaiTRex quits (~ChaiTRex@user/chaitrex) (Ping timeout: 240 seconds)
17:18:20 <tomsmeding> oh 1.5. rewrite `foo x | guard = rhs` to `foo x = rhs` if `guard` evaluates to `true`
17:18:46 <kuribas`> tomsmeding: well, type check the guard as 'bool' :)
17:18:53 <tomsmeding> and that
17:19:40 <tomsmeding> that's not the difficult part of the algorithm ;)
17:20:50 <kuribas`> tomsmeding: that's missing an `else` ...
17:23:43 <tomsmeding> s/if/whenever/
17:24:03 <tomsmeding> when (guard evaluates to true) $ do the rewrite
17:25:13 <kuribas`> gtg
17:25:26 × kuribas` quits (~user@ip-188-118-57-242.reverse.destiny.be) (Quit: ERC (IRC client for Emacs 27.1))
17:27:22 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
17:28:43 tzh joins (~tzh@c-71-193-181-0.hsd1.or.comcast.net)
17:31:10 <shapr> @quote
17:31:10 <lambdabot> EFF says: Making surveillance part of a holiday tradition is essentially setting up a plush police state in your own home.
17:31:42 × wlhn quits (~wenzel@dl5fq-8yqkt42rsn1837y-3.rev.dnainternet.fi) (Quit: Leaving)
17:36:24 × euleritian quits (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Read error: Connection reset by peer)
17:36:44 euleritian joins (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de)
17:41:07 ChaiTRex joins (~ChaiTRex@user/chaitrex)
17:43:34 × billchenchina quits (~billchenc@2a0d:2580:ff0c:1:e3c9:c52b:a429:5bfe) (Ping timeout: 276 seconds)
17:49:20 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
17:51:53 × califax quits (~califax@user/califx) (Remote host closed the connection)
17:53:23 califax joins (~califax@user/califx)
17:56:11 × euleritian quits (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 268 seconds)
17:56:49 euleritian joins (~euleritia@dynamic-176-006-199-114.176.6.pool.telefonica.de)
17:57:16 × euleritian quits (~euleritia@dynamic-176-006-199-114.176.6.pool.telefonica.de) (Read error: Connection reset by peer)
17:57:39 euleritian joins (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de)
18:01:43 × euleritian quits (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 246 seconds)
18:02:45 euleritian joins (~euleritia@dynamic-046-114-104-075.46.114.pool.telefonica.de)
18:03:50 × euleritian quits (~euleritia@dynamic-046-114-104-075.46.114.pool.telefonica.de) (Read error: Connection reset by peer)
18:04:03 euleritian joins (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de)
18:06:42 earthy joins (~arthurvl@2a02-a469-f5e2-1-83d2-ca43-57a2-dc81.fixed6.kpn.net)
18:07:17 × califax quits (~califax@user/califx) (Remote host closed the connection)
18:08:24 califax joins (~califax@user/califx)
18:12:41 fansly joins (~fansly@2001:448a:2010:476e:5d30:627d:73c3:a75f)
18:17:16 mc47 joins (~mc47@xmonad/TheMC47)
18:31:45 billchenchina joins (~billchenc@2a0d:2580:ff0c:1:e3c9:c52b:a429:5bfe)
18:35:30 × ChaiTRex quits (~ChaiTRex@user/chaitrex) (Quit: ChaiTRex)
18:37:33 ChaiTRex joins (~ChaiTRex@user/chaitrex)
18:39:45 × billchenchina quits (~billchenc@2a0d:2580:ff0c:1:e3c9:c52b:a429:5bfe) (Ping timeout: 256 seconds)
18:43:44 peterbecich joins (~Thunderbi@047-229-123-186.res.spectrum.com)
18:53:59 × pavonia quits (~user@user/siracusa) (Quit: Bye!)
18:55:01 × peterbecich quits (~Thunderbi@047-229-123-186.res.spectrum.com) (Ping timeout: 260 seconds)
19:01:45 × target_i quits (~target_i@217.175.14.39) (Quit: leaving)
19:10:29 waleee joins (~waleee@h-176-10-144-38.NA.cust.bahnhof.se)
19:12:27 × michalz_ quits (~michalz@185.246.207.218) (Quit: ZNC 1.8.2 - https://znc.in)
19:12:57 Tuplanolla joins (~Tuplanoll@91-159-68-95.elisa-laajakaista.fi)
19:16:35 × euleritian quits (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 256 seconds)
19:17:31 euleritian joins (~euleritia@dynamic-046-114-104-075.46.114.pool.telefonica.de)
19:18:59 × APic quits (apic@apic.name) (Ping timeout: 256 seconds)
19:20:00 × sord937 quits (~sord937@gateway/tor-sasl/sord937) (Quit: sord937)
19:21:45 sadie-sorceress joins (~sadie-sor@199.96.191.158)
19:28:14 × dtman34_ quits (~dtman34@2601:447:d000:93c9:ad99:f215:9ba0:8a79) (Quit: ZNC 1.8.2+deb3.1 - https://znc.in)
19:28:35 dtman34 joins (~dtman34@2601:447:d000:93c9:26e6:4184:3fb9:5726)
19:31:27 iakov joins (~iakov@2a02:8106:244:b000:57f6:37d4:b4f4:dc14)
19:36:05 × euleritian quits (~euleritia@dynamic-046-114-104-075.46.114.pool.telefonica.de) (Read error: Connection reset by peer)
19:36:21 euleritian joins (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de)
19:43:18 × sadie-sorceress quits (~sadie-sor@199.96.191.158) (Ping timeout: 250 seconds)
19:43:53 sadie-sorceress joins (~sadie-sor@199.96.187.158)
19:45:45 <cheater> when i have a bunch of packages called aaa, bbb, ccc inside a directory called top, and in top i have cabal.project that does "packages: ./aaa \n ./bbb \n ./ccc", and aaa lists bbb as a dependency, should aaa be able to find bbb inside ../bbb relative to where aaa.cabal is located?
19:46:41 <tomsmeding> cheater: yes
19:47:02 <tomsmeding> assuming that the cabal file inside bbb/ gives package name bbb
19:47:10 <cheater> yeah
19:47:19 <cheater> how far is cabal.project searched for?
19:47:28 <cheater> just the parent directory, or up to fs root?
19:47:45 <tomsmeding> more than just parent directory, may well be fs root
19:47:57 <tomsmeding> perhaps it stops at ~, not sure
19:49:50 <haskellbridge> 15<J​ade (@jade_m.org> does anyone know what, if any, tooling uses the output of `-fshow-loaded-modules` in ghci?
19:52:50 × sadie-sorceress quits (~sadie-sor@199.96.187.158) (Ping timeout: 250 seconds)
19:53:20 Feuermagier is now known as Guest1958
19:53:20 Feuermagier_ joins (~Feuermagi@user/feuermagier)
19:53:20 × Guest1958 quits (~Feuermagi@user/feuermagier) (Killed (tungsten.libera.chat (Nickname regained by services)))
19:53:20 Feuermagier_ is now known as Feuermagier
19:53:29 <cheater> thanks tom
19:55:29 APic joins (apic@apic.name)
19:55:31 × tabemann_ quits (~tabemann@2600:1700:7990:24e0:8418:7d48:7fca:df7f) (Remote host closed the connection)
19:55:45 tabemann_ joins (~tabemann@2600:1700:7990:24e0:aad7:ae4:6df1:f3e8)
20:02:05 × eggplantade quits (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
20:04:33 xacktm joins (xacktm@user/xacktm)
20:04:37 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
20:07:35 × earthy quits (~arthurvl@2a02-a469-f5e2-1-83d2-ca43-57a2-dc81.fixed6.kpn.net) (Ping timeout: 256 seconds)
20:08:37 earthy joins (~arthurvl@2a02-a469-f5e2-1-83d2-ca43-57a2-dc81.fixed6.kpn.net)
20:17:12 × coot quits (~coot@89-69-206-216.dynamic.chello.pl) (Quit: coot)
20:19:30 × iakov quits (~iakov@2a02:8106:244:b000:57f6:37d4:b4f4:dc14) (Quit: Client closed)
20:21:20 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
20:23:25 stilgart joins (~Christoph@chezlefab.net)
20:31:57 × mc47 quits (~mc47@xmonad/TheMC47) (Remote host closed the connection)
20:32:26 × tri quits (~tri@ool-18bc2e74.dyn.optonline.net) (Remote host closed the connection)
20:33:26 tri joins (~tri@ool-18bc2e74.dyn.optonline.net)
20:35:45 × trev quits (~trev@user/trev) (Quit: trev)
20:37:33 eggplantade joins (~Eggplanta@2600:1700:38c5:d800:f06f:8f74:1e14:400c)
20:38:14 × tri quits (~tri@ool-18bc2e74.dyn.optonline.net) (Ping timeout: 256 seconds)
20:38:15 sadie-sorceress joins (~sadie-sor@199.96.187.158)
20:41:58 × thegeekinside quits (~thegeekin@189.180.85.240) (Ping timeout: 264 seconds)
20:42:11 × eggplantade quits (~Eggplanta@2600:1700:38c5:d800:f06f:8f74:1e14:400c) (Ping timeout: 260 seconds)
20:42:51 × gooba quits (~gooba@90-231-13-185-no3430.tbcn.telia.com) (Remote host closed the connection)
20:43:13 gooba joins (~gooba@90-231-13-185-no3430.tbcn.telia.com)
20:44:28 jargon joins (~jargon@211.sub-174-205-225.myvzw.com)
20:51:23 × ChaiTRex quits (~ChaiTRex@user/chaitrex) (Remote host closed the connection)
20:51:57 ChaiTRex joins (~ChaiTRex@user/chaitrex)
20:52:10 × noumenon quits (~noumenon@113.51-175-156.customer.lyse.net) (Quit: Leaving)
20:53:48 ft joins (~ft@p508dbda4.dip0.t-ipconnect.de)
20:58:01 causal joins (~eric@50.35.85.7)
21:02:29 <dminuoso_> tomsmeding: Stopping at ~ seems quite arbitrary, especially since not all paths have ~ as an intermediate directory.
21:02:45 <tomsmeding> yeah it probably doesn't
21:02:58 <tomsmeding> I think git by default stops at ~
21:03:33 <tomsmeding> was just mentioning the possibility in case it helps someone debug weird stuff :)
21:04:07 × sadie-sorceress quits (~sadie-sor@199.96.187.158) (Quit: Client closed)
21:07:09 tri joins (~tri@ool-18bc2e74.dyn.optonline.net)
21:09:07 × _ht quits (~Thunderbi@28-52-174-82.ftth.glasoperator.nl) (Remote host closed the connection)
21:10:45 siw5ohs0 joins (~aiw5ohs0@user/aiw5ohs0)
21:11:06 siw5ohs0 parts (~aiw5ohs0@user/aiw5ohs0) (Leaving)
21:13:37 × tri quits (~tri@ool-18bc2e74.dyn.optonline.net) (Ping timeout: 260 seconds)
21:16:18 × azimut quits (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection)
21:16:37 azimut joins (~azimut@gateway/tor-sasl/azimut)
21:24:08 [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470)
21:24:17 × fansly quits (~fansly@2001:448a:2010:476e:5d30:627d:73c3:a75f) (Remote host closed the connection)
21:24:33 fansly joins (~fansly@2001:448a:2010:476e:5d30:627d:73c3:a75f)
21:28:16 iakov joins (~iakov@2a02:8106:244:b000:bb8c:d849:459b:3c4)
21:28:17 × fansly quits (~fansly@2001:448a:2010:476e:5d30:627d:73c3:a75f) (Read error: Connection reset by peer)
21:31:43 eggplantade joins (~Eggplanta@2600:1700:38c5:d800:f06f:8f74:1e14:400c)
21:34:10 thegeekinside joins (~thegeekin@189.180.85.240)
21:37:41 × elkcl quits (~elkcl@broadband-95-84-226-240.ip.moscow.rt.ru) (Ping timeout: 240 seconds)
21:43:22 tri joins (~tri@ool-18bc2e74.dyn.optonline.net)
21:44:30 Square2 joins (~Square4@user/square)
21:44:52 elkcl joins (~elkcl@broadband-95-84-226-240.ip.moscow.rt.ru)
21:47:19 × Square quits (~Square@user/square) (Ping timeout: 276 seconds)
21:47:58 × tri quits (~tri@ool-18bc2e74.dyn.optonline.net) (Ping timeout: 264 seconds)
21:49:58 tri joins (~tri@ool-18bc2e74.dyn.optonline.net)
21:57:18 actioninja7 joins (~actioninj@user/actioninja)
21:58:39 × actioninja quits (~actioninj@user/actioninja) (Ping timeout: 256 seconds)
21:58:40 actioninja7 is now known as actioninja
21:58:57 × tomboy64 quits (~tomboy64@user/tomboy64) (Read error: Connection reset by peer)
21:59:20 tomboy64 joins (~tomboy64@user/tomboy64)
22:00:22 Square2 is now known as Square
22:01:59 × tomboy64 quits (~tomboy64@user/tomboy64) (Client Quit)
22:02:17 tomboy64 joins (~tomboy64@user/tomboy64)
22:02:58 Unicorn_Princess joins (~Unicorn_P@user/Unicorn-Princess/x-3540542)
22:19:31 × takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection)
22:21:53 × aljazmc quits (~aljazmc@user/aljazmc) (Quit: Leaving)
22:28:37 × CrunchyFlakes quits (~CrunchyFl@ip92348280.dynamic.kabel-deutschland.de) (Ping timeout: 264 seconds)
22:42:17 <ph88> what's the easiest way to crash a program from anywhere in the code? I want to make absolutely sure some section of the code is being hit
22:42:32 <Rembane> ph88: error "AAA"
22:42:41 <ph88> thanks
22:42:56 <Rembane> np!
22:43:33 <haskellbridge> 15<J​ade> depending on strictness and the structure of your code, you might want to `seq` that
22:44:19 × gehmehgeh quits (~user@user/gehmehgeh) (Quit: Leaving)
22:45:16 peterbecich joins (~Thunderbi@047-229-123-186.res.spectrum.com)
22:46:07 Guest15 joins (~Guest29@86-82-248-239.fixed.kpn.net)
22:46:07 × igemnace quits (~ian@user/igemnace) (Read error: Connection reset by peer)
22:47:55 <tri> do i use the async package to work with asynchronous and multithreading in haskell?
22:48:23 <tri> just like in c#, before people have to work with thread directly, now most things are done via async await
22:50:11 <geekosaur> yes
22:50:15 <geekosaur> @where parconc
22:50:15 <lambdabot> https://www.safaribooksonline.com/library/view/parallel-and-concurrent/9781449335939/
22:50:41 <EvanR> async is great
22:50:55 <EvanR> esp when your thread strategies become anything other than trivial
22:50:59 <ph88> how can i send debug output to something else than stdout and stderr and then capture it ?
22:51:12 <tri> than kyou
22:51:17 × fendor quits (~fendor@2a02:8388:1605:d100:267b:1353:13d7:4f0c) (Remote host closed the connection)
22:51:23 <ph88> capture it, i mean save stdout, stderr and other output together to a file
22:51:25 <EvanR> pipe stderr to another process or file when running the program xD
22:51:36 <EvanR> with the shell
22:51:47 <ph88> from the haskell program i want to send output to new pipe not stdout or stderr
22:52:05 <Rembane> Open file, write all the stuff, close file?
22:52:05 <EvanR> System.Process has the means to do that but it's somewhat more involved than shell
22:52:14 <EvanR> or that
22:52:53 <Guest15> Can someone help me write a function with the accelerate libary, so I have this function of form ''propagateL :: Elt a => Acc (Vector Bool) -> Acc (Vector a) -> Acc (Vector a)''   with for example  input acc vector bool of form (True, False, False, True, False) and input acc vector int of form (2, 3, 4, 5, 6). Then it would generate output (2,
22:52:53 <Guest15> 2, 2, 5, 5). I now have this https://paste.tomsmeding.com/84SCGJXN but the shapes are wrong because the indices are not in correct shape, and a reshape function doesnt owrk
22:52:59 <EvanR> I've used a logger thread to over-engineer the task of handling logs from various components
22:53:21 <ph88> https://hackage.haskell.org/package/base-4.19.0.0/docs/src/GHC.IO.FD.html#stdin can i do it like this and make pipe number 3 ?
22:53:36 <EvanR> it just loops waiting on an MVar to become not empty and logs the contents
22:54:37 <geekosaur> ph88, fd 3 might already be in use
22:55:04 <geekosaur> 0, 1, 2 are passed in by the OS (and on Windows, 3 and 4)
22:55:35 <ph88> maybe i should use this? https://hackage.haskell.org/package/base-4.19.0.0/docs/GHC-IO-Handle.html#v:mkFileHandle
22:55:37 jmdaemon joins (~jmdaemon@user/jmdaemon)
22:55:40 <geekosaur> files opened by the application will start with the next available fd
22:56:10 <ph88> can i send output directly to console over a new pipe?
22:56:29 × peterbecich quits (~Thunderbi@047-229-123-186.res.spectrum.com) (Ping timeout: 240 seconds)
22:56:46 <geekosaur> but you also have that any part of the code that writes to stdout or stderr will do exactly that; the only way to intervene is to reopen those on some other resource
22:58:22 <ph88> like this https://stackoverflow.com/q/26153251/1833322
23:00:12 <geekosaur> that answer pretty much works, with fdToHandle to create a Haskell Handle from an fd number
23:01:00 <geekosaur> if you want to write directly to the console, you can open /dev/tty on a unixlike or CON on windoes
23:01:04 <geekosaur> *windows
23:02:21 <geekosaur> (also, you seem to be using "pipe" oddly. a pipe is an inter-process communication mechanism, it writes to a process)
23:02:25 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
23:03:01 igemnace joins (~ian@user/igemnace)
23:04:44 <ph88> geekosaur, you got it
23:04:49 × L29Ah quits (~L29Ah@wikipedia/L29Ah) (Ping timeout: 246 seconds)
23:05:18 × Guest15 quits (~Guest29@86-82-248-239.fixed.kpn.net) (Quit: Client closed)
23:05:23 <ph88> how do i acquire the next free file descriptor ?
23:06:35 L29Ah joins (~L29Ah@wikipedia/L29Ah)
23:07:03 <ph88> hhmm seems i have to tell the shell to give the haskell program a file descriptor https://stackoverflow.com/a/32697347/1833322 if i understand correctly
23:08:02 <cheater> geekosaur: that's a bad idea, instead you should open the current pid's fd's and write to those
23:08:17 <mauke> ph88: what exactly are you trying to do?
23:08:20 <cheater> like /proc/123423/fd/1 or whatever
23:08:35 <ph88> mauke, write to terminal using another handle than stdout and stderr
23:09:18 <mauke> ph88: isn't that just openFile "/dev/tty"?
23:09:46 <geekosaur> that's what I said earlier
23:10:14 <ph88> let me try
23:10:27 d34df00d joins (~d34df00d@2600:1702:4f1b:7c10::43)
23:10:48 <d34df00d> Hi!
23:11:06 <d34df00d> Is there anything like Eq1.liftEq ( https://hackage.haskell.org/package/base-4.19.0.0/docs/Data-Functor-Classes.html#v:liftEq ), but for monadic equality tests?
23:12:13 <d34df00d> Ideally, with a TH thingie like https://hackage.haskell.org/package/deriving-compat-0.6.5/docs/Data-Eq-Deriving.html#v:makeLiftEq
23:12:53 × acidjnk quits (~acidjnk@p200300d6e737e732388182bf15709a86.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
23:21:57 <ph88> geekosaur, mauke i tried your suggestion https://bpa.st/275A have a bit of a problem with capturing the output to a file
23:22:11 <ph88> output is not redirected to file
23:22:26 <geekosaur> no, using that evades all redirections
23:22:34 <geekosaur> what exactly are you trying to do?
23:23:15 <ph88> have the ability to capture program output to a file with 3> (or another number) i don't want to use stdout or stderr
23:23:36 <mauke> what
23:23:45 <mauke> I asked what you wanted to do, and you said "write to terminal"
23:24:10 <ph88> i also said in the same sentence "using another handle than stdout and stderr"
23:24:15 <geekosaur> also, that's confused. if the program writes to stdout, it writes to stdout
23:24:16 <mauke> yes
23:24:17 athan joins (~athan@173-042-095-241.biz.spectrum.com)
23:24:25 <mauke> 'handle' in your code is not stdout or stderr
23:24:39 <ph88> i don't want to write to stdout or stderr, but to a new FD
23:24:57 <mauke> yes, that is what's happening
23:25:18 <tri> quick questions, when uses functions from bytestring and vector package, the compiler says these packages are hidden. I could easily fix it by explicitly add them to cabal project config. But should i use these packages at all? Why is there the thing called hidden package?
23:25:38 <ph88> mauke, how to capture it to a file on the terminal ?
23:25:56 <mauke> ph88: that doesn't make sense
23:25:58 <sclv> they are hidden because the cabal file does not specify them
23:25:58 × iakov quits (~iakov@2a02:8106:244:b000:bb8c:d849:459b:3c4) (Quit: Client closed)
23:26:10 <mauke> ph88: files are not "on the terminal". they're files.
23:26:29 <sclv> using them is good. hidden just means any package installed but not specified to be used
23:26:42 <ph88> mauke, haskell program write to 3> output goes to file
23:26:51 <tri> sclv: ah ok. Im just afraid it's deprecated or something. Thank you
23:27:11 <mauke> ph88: why 3?
23:27:23 <ph88> any number other than 1 for stdout or 2 for stderr
23:27:36 <mauke> that seems like a terrible interface
23:27:51 <mauke> this still feels like an XY problem
23:30:58 <mauke> the main thing that bothers me is that I see file descriptor numbers as hidden internals of a program (except for the standard 0/1/2), but you seem to want to expose them as part of the public interface
23:31:35 <ph88> https://unix.stackexchange.com/questions/385569/is-it-possible-to-write-to-other-file-descriptors-in-c
23:31:49 <mauke> why not provide a command line option such as '-o somefile'?
23:32:07 <ph88> file descriptors and tied to the OS, it's not hidden internal or a program
23:32:15 <ph88> of a program *
23:32:34 <dmj`> Does anybody know what instances of typeclasses GHC *cannot* monomorphize (dictionary passing translation + specialization)? Oleg K says GHC can't monomorphize all cases, but doesn't give specifics.
23:32:36 <geekosaur> but it is terrible UX
23:32:54 <mauke> what I talk about with my OS is none of your business
23:33:00 <geekosaur> dmj`, any use that involves polymorphic recursion
23:34:13 <geekosaur> for an example, most Show instances invoke the Show instances of other types under control of the passed-in Show dictionary, so neither of those can be monomorphized
23:35:08 <mauke> that doesn't follow directly. you still need polymorphic recursion
23:35:13 <dmj`> geekosaur: yea so he mentions that too (that existential types and arbitrary rank polymorphism are incompatbile w/ monomorph), but vanilla haskell98 doesn't have that stuff (and that's what I think he's referring to in his paper -- to Haskell98, not GHC per se)
23:35:49 <mauke> polymorphic recursion doesn't involve existentials or higher ranks
23:37:00 <mauke> > let foo :: (Show a) => Int -> a -> String; foo 0 x = show x; foo n x = foo (n - 1) ((), x) in foo 5 'x'
23:37:02 <lambdabot> "((),((),((),((),((),'x')))))"
23:37:25 <mauke> > let foo :: (Show a) => Int -> a -> String; foo 0 x = show x; foo n x = foo (n - 1) ((), x) in foo 10 'x'
23:37:27 <lambdabot> "((),((),((),((),((),((),((),((),((),((),'x'))))))))))"
23:38:09 <dmj`> mauke: he mentions both "Furthermore, monomorphization cannot be done for polymorphically recursive or higher-rank (first-class polymorphic) functions."
23:38:31 <mauke> my example is H98
23:39:18 Sgeo joins (~Sgeo@user/sgeo)
23:40:29 Lycurgus joins (~georg@li1192-118.members.linode.com)
23:40:29 × Lycurgus quits (~georg@li1192-118.members.linode.com) (Changing host)
23:40:29 Lycurgus joins (~georg@user/Lycurgus)
23:41:10 <mauke> foo 5 'x' recursively invokes foo at the types Char, ((), Char), ((), ((), Char)), ((), ((), ((), Char))), ...
23:41:29 <mauke> these are all distinct types and they're generated at runtime
23:42:02 <mauke> > let foo :: (Show a) => Int -> a -> String; foo 0 x = show x; foo n x = foo (n - 1) [x] in foo 5 'x'
23:42:04 <lambdabot> "[[[[\"x\"]]]]"
23:42:36 <mauke> this one is Char, [Char], [[Char]], [[[Char]]], [[[Char]]], [[[[Char]]]]
23:44:23 <mauke> this is something you can't do with C++ templates because the body of foo<T> would contain a call to foo<list<T>>
23:45:04 <mauke> the call is conditional (at runtime), but at compile time you'd have to pre-generate an infinite number of functions, "just in case"
23:45:57 <mauke> the dictionary passing implementation works just fine because the [a] instance for Show is basically just a function that transforms the 'a' dictionary to a '[a]' dictionary
23:46:13 Guest73 joins (~Guest73@94.139.221.210)
23:46:24 <mauke> so we can easily generate dictionaries at runtime, at whatever depth is needed
23:46:50 <Guest73> Hi
23:46:51 <mauke> (similarly, for the first example, the Show (a, b) instance is built from Show dictionaries for a and b)
23:48:46 × mmhat quits (~mmh@p200300f1c724f91bee086bfffe095315.dip0.t-ipconnect.de) (Quit: WeeChat 4.1.3)
23:48:47 <geekosaur> Guest73, hi
23:48:55 <dmj`> mauke: that is a really good example, thank you
23:50:31 × Guest73 quits (~Guest73@94.139.221.210) (Client Quit)
23:51:23 <dmj`> mauke: too bad, was hoping to be able to do away with runtime dictionaries
23:51:32 × xff0x quits (~xff0x@ai085147.d.east.v6connect.net) (Ping timeout: 252 seconds)
23:51:51 iakov joins (~iakov@2a02:8106:244:b000:57f6:37d4:b4f4:dc14)
23:53:10 <dmj`> mauke: Lennart says Mu does complete monomorphization, wonder if they disallowed polymorphic recursion
23:53:38 <c_wraith> Yeah, you'd have to disable polymorphic recursion over class-constrained types
23:53:39 xff0x joins (~xff0x@178.255.149.135)
23:54:10 <c_wraith> That's the feature that results in building arbitrary dictionaries at runtime
23:54:32 × iakov quits (~iakov@2a02:8106:244:b000:57f6:37d4:b4f4:dc14) (Client Quit)
23:54:36 <c_wraith> Well, ok. You'd also need to make sure existentials were off...
23:54:50 <c_wraith> (or at least disable existentials + classes)
23:55:36 <mauke> are existentials even useful without classes?
23:57:00 <c_wraith> yes.
23:57:11 <c_wraith> CoYoneda is great
23:58:03 <EvanR> the dependent map container thing uses existentials and cheats to get the value back but no classes
23:58:04 <c_wraith> I guess it's capitalized as Coyoneda, but eh. otherwise great
23:58:50 <c_wraith> that shuttle thing I never finished used an existential to bundle refs with generators

All times are in UTC on 2024-01-22.