2022/12/30

2022-12-30 00:01:39 +0100coot(~coot@213.134.171.3) (Quit: coot)
2022-12-30 00:04:15 +0100mstruebing(~mstruebin@ip4d14fa11.dynamic.kabel-deutschland.de) (Quit: Client closed)
2022-12-30 00:17:13 +0100`2jt(~jtomas@84.red-88-17-186.dynamicip.rima-tde.net) (Remote host closed the connection)
2022-12-30 00:17:37 +0100`2jt(~jtomas@84.red-88-17-186.dynamicip.rima-tde.net)
2022-12-30 00:19:16 +0100[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470)
2022-12-30 00:21:18 +0100kmein(~weechat@user/kmein) (Quit: ciao kakao)
2022-12-30 00:23:24 +0100kmein(~weechat@user/kmein)
2022-12-30 00:26:54 +0100random-jellyfish(~random-je@user/random-jellyfish) (Quit: Client closed)
2022-12-30 00:29:47 +0100freeside(~mengwong@103.252.202.159) (Ping timeout: 246 seconds)
2022-12-30 00:32:57 +0100cheater_(~Username@user/cheater)
2022-12-30 00:35:00 +0100sammelweis(~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.)
2022-12-30 00:35:23 +0100cheater(~Username@user/cheater) (Ping timeout: 256 seconds)
2022-12-30 00:36:16 +0100sammelweis(~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10)
2022-12-30 00:36:49 +0100cheater(~Username@user/cheater)
2022-12-30 00:38:29 +0100cheater_(~Username@user/cheater) (Ping timeout: 246 seconds)
2022-12-30 00:41:16 +0100Cybro(~Cybro@cpc83049-enfi23-2-0-cust89.20-2.cable.virginm.net)
2022-12-30 00:48:01 +0100Cybro(~Cybro@cpc83049-enfi23-2-0-cust89.20-2.cable.virginm.net) (Quit: Leaving)
2022-12-30 00:48:56 +0100Cybro(~Cybro@cpc83049-enfi23-2-0-cust89.20-2.cable.virginm.net)
2022-12-30 00:57:43 +0100freeside(~mengwong@103.252.202.159)
2022-12-30 01:01:32 +0100mmhat(~mmh@p200300f1c721be69ee086bfffe095315.dip0.t-ipconnect.de) (Quit: WeeChat 3.7.1)
2022-12-30 01:02:36 +0100freeside(~mengwong@103.252.202.159) (Ping timeout: 265 seconds)
2022-12-30 01:08:57 +0100freeside(~mengwong@103.252.202.159)
2022-12-30 01:14:31 +0100finsternis(~X@23.226.237.192) (Read error: Connection reset by peer)
2022-12-30 01:14:52 +0100Guest9971(~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 272 seconds)
2022-12-30 01:25:46 +0100 <Cybro> What's the use of Applicative? I can't think of anything I'd want to use it for. Functors and Monads make more sense
2022-12-30 01:26:48 +0100acidjnk(~acidjnk@p200300d6e7137a52305f770ee2a81388.dip0.t-ipconnect.de) (Ping timeout: 260 seconds)
2022-12-30 01:26:57 +0100ddellacosta(~ddellacos@89.46.62.213) (Ping timeout: 268 seconds)
2022-12-30 01:27:45 +0100`2jt(~jtomas@84.red-88-17-186.dynamicip.rima-tde.net) (Remote host closed the connection)
2022-12-30 01:28:37 +0100 <hpc> some types are Applicative but not Monad, like ZipList
2022-12-30 01:28:52 +0100ddellacosta(~ddellacos@143.244.47.68)
2022-12-30 01:29:10 +0100 <hpc> https://hackage.haskell.org/package/base-4.17.0.0/docs/Control-Applicative.html#t:ZipList
2022-12-30 01:29:57 +0100emmanuelux(~emmanuelu@user/emmanuelux)
2022-12-30 01:30:38 +0100 <jean-paul[m]> Cybro: Consider calling `a -> b -> c` when you have `f a` and `f b`.
2022-12-30 01:33:13 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 260 seconds)
2022-12-30 01:33:26 +0100 <hpc> > (+) <$> ZipList [10, 20, 30] <*> ZipList [1, 2, 3]
2022-12-30 01:33:28 +0100 <lambdabot> ZipList {getZipList = [11,22,33]}
2022-12-30 01:33:41 +0100 <hpc> > (+) `liftM` ZipList [10, 20, 30] `ap` ZipList [1, 2, 3]
2022-12-30 01:33:43 +0100 <lambdabot> error:
2022-12-30 01:33:43 +0100 <lambdabot> • Could not deduce (Monad ZipList) arising from a use of ‘ap’
2022-12-30 01:33:43 +0100 <lambdabot> from the context: Num b
2022-12-30 01:34:38 +0100 <hpc> ^ can't be written with fmap alone either, no matter what you try
2022-12-30 01:35:44 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net)
2022-12-30 01:36:02 +0100azimut(~azimut@gateway/tor-sasl/azimut)
2022-12-30 01:39:07 +0100 <Cybro> hpc So now what's a ZipList?
2022-12-30 01:39:15 +0100jmorris(uid537181@id-537181.uxbridge.irccloud.com)
2022-12-30 01:40:12 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 272 seconds)
2022-12-30 01:40:48 +0100 <glguy> Cybro: another example of something that's a useful Applicative but not a Monad is https://hackage.haskell.org/package/async-2.2.4/docs/Control-Concurrent-Async.html#t:Concurrently
2022-12-30 01:41:34 +0100 <glguy> I've got a schema definition library where as long as you define your schemas using Applicative operations you can extract documentation from the definition
2022-12-30 01:41:42 +0100 <glguy> while Monad wouldn't allow that
2022-12-30 01:46:54 +0100 <glguy> https://hackage.haskell.org/package/base-4.17.0.0/docs/Control-Applicative.html#t:ZipList
2022-12-30 01:48:11 +0100azimut(~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds)
2022-12-30 01:48:35 +0100azimut(~azimut@gateway/tor-sasl/azimut)
2022-12-30 01:49:49 +0100 <Cybro> Looking at the applicative definition: (<*>) :: f (a -> b) -> f a -> f b
2022-12-30 01:50:27 +0100 <Cybro> I don't really understand why you'd want an "f(a->b)" in the first place
2022-12-30 01:51:06 +0100 <glguy> then think about why you might want: f a -> f b -> f (a,b)
2022-12-30 01:51:32 +0100 <glguy> they apply in the same situations
2022-12-30 01:53:09 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net)
2022-12-30 01:53:39 +0100wroathe(~wroathe@207-153-38-140.fttp.usinternet.com)
2022-12-30 01:53:39 +0100wroathe(~wroathe@207-153-38-140.fttp.usinternet.com) (Changing host)
2022-12-30 01:53:39 +0100wroathe(~wroathe@user/wroathe)
2022-12-30 01:55:11 +0100 <Cybro> That makes sense. It's having a function within a context that's weird to me. I understand the use of functors though.
2022-12-30 01:56:02 +0100 <monochrom> http://www.cs.utoronto.ca/~trebla/CSCC24-2022-Summer/06-functor-applicative.html#applicative is my course notes motivating Applicative after you've accepted Functor.
2022-12-30 01:56:59 +0100 <monochrom> But one perspective is to look at ($) :: (a -> b) -> a -> b and wonder about generalizing to F (a -> b) -> F a -> F b.
2022-12-30 02:00:13 +0100 <EvanR> this is one reason why I question the intuitiveness of f A, m A as being "A in a context"
2022-12-30 02:00:37 +0100 <EvanR> it's a type and what it means depends on the type
2022-12-30 02:00:52 +0100 <EvanR> and who's talking and what day of the week it is, etc
2022-12-30 02:00:58 +0100 <monochrom> "intuitive" means personal subjective axioms.
2022-12-30 02:01:29 +0100 <monochrom> People's brains simply classify, very arbitrarily, something as "intuitive" and the rest as not.
2022-12-30 02:02:21 +0100 <EvanR> in so far as "in a context" is a placeholder to be swapped out for "in a container" "in a type" all meaningless, ok xD
2022-12-30 02:02:24 +0100 <ggVGc> I find that statement very non-intuitive
2022-12-30 02:02:56 +0100 <monochrom> And the fad of using the word "context" (the previous fad being "computation") is simply once again the disease of "explain in your own words to show you're full of it".
2022-12-30 02:04:38 +0100 <monochrom> Survival of the "fittest". Monads as "computations", "containers", "contexts".
2022-12-30 02:05:24 +0100 <EvanR> why do I want to use f at a function type? Well the type signature for <*> wants it. And we want to use <*>
2022-12-30 02:05:33 +0100 <monochrom> Comforting words of zero predictive power.
2022-12-30 02:05:48 +0100 <ggVGc> My personal perspective when people talk about concepts, like let's say Monad and Applicative in this case, is reaching for more than I feel is necessary. Rather than just saying what can be done and what can't be done. E.g just talking about the properties of the thing
2022-12-30 02:06:06 +0100 <ggVGc> From my recent maths studies, that is a lot more how the maths courses are laid out
2022-12-30 02:06:20 +0100 <ggVGc> "here's a thing. These are the properties. Now let's see where that gets us"
2022-12-30 02:06:36 +0100 <EvanR> here's a bunch of operations and their properties
2022-12-30 02:06:52 +0100 <ggVGc> This stuff about context in relation to Monads always confused me
2022-12-30 02:06:57 +0100 <EvanR> <*>, fmap, >>=
2022-12-30 02:07:13 +0100 <ggVGc> and now that I know how to use and write Mondad implementations, I also don't really understand the context thing
2022-12-30 02:07:16 +0100 <jle``> i do agree though that looking at <*> isn't the clearest jump to make about why applicative is useful or how you would use it
2022-12-30 02:07:25 +0100 <monochrom> This is why my course notes on FAM open with "What is a number? You normally don't ask that, nor do you answer it directly."
2022-12-30 02:08:03 +0100 <jle``> if the goal is to understand Applicative, then liftA2 is a clearer path. (<*>) kind of obscures the intent behind a few layers of extra concepts and connections
2022-12-30 02:08:07 +0100 <Cybro> I need to understand why something works to be able to use it properly, otherwise I'll end up just guessing code
2022-12-30 02:08:56 +0100 <monochrom> You can prove that all the claimed instances of Applicative satisfy the Applicative laws.
2022-12-30 02:09:03 +0100 <EvanR> for that you should implement several Applicatives to see how they work
2022-12-30 02:09:28 +0100 <Cybro> jle``, looking at Hackage now and liftA2 makes more sense. Idk why school just taught us <*> straight away
2022-12-30 02:09:45 +0100 <EvanR> :t liftA2
2022-12-30 02:09:46 +0100 <lambdabot> Applicative f => (a -> b -> c) -> f a -> f b -> f c
2022-12-30 02:09:59 +0100 <EvanR> :t liftA3
2022-12-30 02:10:00 +0100 <lambdabot> Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d
2022-12-30 02:10:00 +0100 <monochrom> You can also prove properties of a specific instance such as [], for example that [f, g] <*> [x, y] = [f x, f y, g x, g y].
2022-12-30 02:10:48 +0100 <monochrom> You can also prove that pure ($) <*> [f, g] <*> [x, y] does the same, which is an example of how liftA2 relates to <*>
2022-12-30 02:11:09 +0100 <jle``> Cybro: i think <*> is more often useful in practice (and theoretically nicer too) but liftA2 is probably the clearest way to teach what the purpose of the abstraction is imo
2022-12-30 02:11:46 +0100 <monochrom> <*> is a nice solution to "OK I have liftA2, now how about liftA3 and liftA4 and so on".
2022-12-30 02:12:04 +0100albet70(~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection)
2022-12-30 02:12:25 +0100 <monochrom> I teach liftA2 and then <*> and their equivalence. Then liftA3 etc is a walk in the park. (Just add more <*>s)
2022-12-30 02:12:30 +0100freeside(~mengwong@103.252.202.159) (Ping timeout: 272 seconds)
2022-12-30 02:13:19 +0100 <monochrom> By which point you begin to see how "pure f <*> x <*> y <*> z <*> ..." is like "f x y z ..." on steroid.
2022-12-30 02:13:42 +0100 <monochrom> and so <*> is really a generalization of $
2022-12-30 02:13:52 +0100 <mauke[m]> :t liftA2 ($)
2022-12-30 02:13:53 +0100 <lambdabot> Applicative f => f (a -> c) -> f a -> f c
2022-12-30 02:14:30 +0100 <monochrom> this generalizing being from I (a -> b) -> I a -> I b (where I is the identity functor) to arbitrary s/I/F?
2022-12-30 02:14:35 +0100 <monochrom> err s/I/F/
2022-12-30 02:16:11 +0100gurkenglas(~gurkengla@p548ac72e.dip0.t-ipconnect.de) (Ping timeout: 246 seconds)
2022-12-30 02:16:12 +0100 <monochrom> Now, when will you ask about pure? :)
2022-12-30 02:17:05 +0100 <Cybro> pure makes sense
2022-12-30 02:18:11 +0100albet70(~xxx@2400:8902::f03c:92ff:fe60:98d8)
2022-12-30 02:19:23 +0100freeside(~mengwong@103.252.202.159)
2022-12-30 02:25:31 +0100Tuplanolla(~Tuplanoll@91-159-68-152.elisa-laajakaista.fi) (Quit: Leaving.)
2022-12-30 02:26:46 +0100freeside(~mengwong@103.252.202.159) (Ping timeout: 268 seconds)
2022-12-30 02:26:53 +0100 <glguy> mauke[m]: the other day you suggested using an IntMap for the aoc problem with the graph of valves. I was wrong when I said I'd tried it (it was a different problem) trying it takes 120ms down to 110ms . not a big deal but just correcting my mistake
2022-12-30 02:29:33 +0100Cybro(~Cybro@cpc83049-enfi23-2-0-cust89.20-2.cable.virginm.net) (Quit: Leaving)
2022-12-30 02:31:04 +0100Cybro(~Cybro@cpc83049-enfi23-2-0-cust89.20-2.cable.virginm.net)
2022-12-30 02:32:43 +0100Cybro(~Cybro@cpc83049-enfi23-2-0-cust89.20-2.cable.virginm.net) (Client Quit)
2022-12-30 02:32:55 +0100 <glguy> but I wish there was a way to know which would be faster
2022-12-30 02:33:06 +0100 <glguy> There are two opportunities but it only paid to switch one and not the other
2022-12-30 02:35:50 +0100mikoto-chan(~mikoto-ch@164.5.249.78) (Read error: Connection reset by peer)
2022-12-30 02:37:51 +0100freeside(~mengwong@103.252.202.159)
2022-12-30 02:39:10 +0100sammelweis(~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.)
2022-12-30 02:40:27 +0100sammelweis(~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10)
2022-12-30 02:42:54 +0100freeside(~mengwong@103.252.202.159) (Ping timeout: 272 seconds)
2022-12-30 02:49:47 +0100razetime(~Thunderbi@49.207.228.176)
2022-12-30 02:59:05 +0100albet70(~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection)
2022-12-30 02:59:35 +0100tcard(~tcard@2400:4051:5801:7500:cf17:befc:ff82:5303) (Remote host closed the connection)
2022-12-30 03:00:40 +0100ft(~ft@i59F5448E.versanet.de) (Ping timeout: 252 seconds)
2022-12-30 03:02:39 +0100ft(~ft@i59F54B83.versanet.de)
2022-12-30 03:05:12 +0100albet70(~xxx@2400:8902::f03c:92ff:fe60:98d8)
2022-12-30 03:10:29 +0100tcard(~tcard@2400:4051:5801:7500:cf17:befc:ff82:5303)
2022-12-30 03:13:35 +0100freeside(~mengwong@103.252.202.159)
2022-12-30 03:16:49 +0100beteigeuze(~Thunderbi@bl14-81-220.dsl.telepac.pt) (Ping timeout: 260 seconds)
2022-12-30 03:17:05 +0100thongpv(~thongpv87@2402:9d80:3db:44f4:2cb2:e04c:4067:cfda)
2022-12-30 03:17:06 +0100albet70(~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection)
2022-12-30 03:21:12 +0100 <glguy> ok, kept hammering on the Ints and it runs in 90ms vs the old 120ms
2022-12-30 03:23:13 +0100albet70(~xxx@2400:8902::f03c:92ff:fe60:98d8)
2022-12-30 03:27:21 +0100sammelweis(~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.)
2022-12-30 03:29:22 +0100sammelweis(~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10)
2022-12-30 03:37:55 +0100justsomeguywishes he was smart enought to take a class with monochrome
2022-12-30 03:57:14 +0100azimut(~azimut@gateway/tor-sasl/azimut) (Quit: ZNC - https://znc.in)
2022-12-30 03:57:24 +0100azimut_(~azimut@gateway/tor-sasl/azimut)
2022-12-30 03:59:32 +0100razetime(~Thunderbi@49.207.228.176) (Ping timeout: 272 seconds)
2022-12-30 04:01:37 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:2914:f025:7ef3:a77d)
2022-12-30 04:07:19 +0100hyperbolic-dg(~quassel@i577AA562.versanet.de) (Ping timeout: 256 seconds)
2022-12-30 04:08:40 +0100finn_elija(~finn_elij@user/finn-elija/x-0085643)
2022-12-30 04:08:40 +0100FinnElija(~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija)))
2022-12-30 04:08:40 +0100finn_elijaFinnElija
2022-12-30 04:09:26 +0100hyperbolic-dg(~quassel@i577AA562.versanet.de)
2022-12-30 04:16:59 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 264 seconds)
2022-12-30 04:18:23 +0100td_(~td@83.135.9.29) (Ping timeout: 268 seconds)
2022-12-30 04:19:10 +0100freeside(~mengwong@103.252.202.159) (Ping timeout: 272 seconds)
2022-12-30 04:19:58 +0100td_(~td@83.135.9.0)
2022-12-30 04:22:19 +0100phma(phma@2001:5b0:210d:5d58:64bb:4721:a872:cb87) (Read error: Connection reset by peer)
2022-12-30 04:22:44 +0100phma(~phma@host-67-44-208-169.hnremote.net)
2022-12-30 04:32:41 +0100freeside(~mengwong@103.252.202.159)
2022-12-30 04:33:55 +0100morb(~morb@pool-72-80-94-112.nycmny.fios.verizon.net)
2022-12-30 04:37:32 +0100freeside(~mengwong@103.252.202.159) (Ping timeout: 272 seconds)
2022-12-30 04:37:38 +0100[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470) (Remote host closed the connection)
2022-12-30 04:38:35 +0100waleee(~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Ping timeout: 264 seconds)
2022-12-30 04:39:23 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net)
2022-12-30 04:47:27 +0100justsomeguy(~justsomeg@user/justsomeguy) (Ping timeout: 260 seconds)
2022-12-30 04:47:56 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Quit: leaving)
2022-12-30 04:48:14 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-30 04:49:24 +0100freeside(~mengwong@103.252.202.159)
2022-12-30 04:51:22 +0100Lycurgus(~juan@user/Lycurgus)
2022-12-30 04:54:44 +0100instantaphex(~jb@c-73-171-252-84.hsd1.fl.comcast.net)
2022-12-30 05:01:14 +0100ddellacosta(~ddellacos@143.244.47.68) (Ping timeout: 260 seconds)
2022-12-30 05:04:08 +0100Lycurgus(~juan@user/Lycurgus) (Quit: Exeunt: personae.ai-integration.biz)
2022-12-30 05:07:09 +0100Feuermagier(~Feuermagi@user/feuermagier) (Remote host closed the connection)
2022-12-30 05:12:38 +0100sympt9(~sympt@user/sympt)
2022-12-30 05:13:40 +0100hyperbolic-dg(~quassel@i577AA562.versanet.de) (Quit: https://quassel-irc.org - Komfortabler Chat. Überall.)
2022-12-30 05:14:03 +0100sympt(~sympt@user/sympt) (Ping timeout: 260 seconds)
2022-12-30 05:14:04 +0100sympt9sympt
2022-12-30 05:25:08 +0100beefbambi(~beefbambi@183.82.24.237) (Read error: Connection reset by peer)
2022-12-30 05:25:50 +0100beefbambi(~beefbambi@183.82.24.237)
2022-12-30 05:31:16 +0100v0id_ptr(~adrift@user/ptr-frac7al/x-0038398)
2022-12-30 05:37:34 +0100Feuermagier(~Feuermagi@user/feuermagier)
2022-12-30 05:39:42 +0100Qudit(~user@user/Qudit)
2022-12-30 05:52:47 +0100freeside(~mengwong@103.252.202.159) (Ping timeout: 246 seconds)
2022-12-30 05:54:49 +0100morb(~morb@pool-72-80-94-112.nycmny.fios.verizon.net) (Remote host closed the connection)
2022-12-30 05:55:14 +0100shriekingnoise(~shrieking@186.137.167.202) (Quit: Quit)
2022-12-30 05:59:36 +0100freeside(~mengwong@103.252.202.159)
2022-12-30 06:03:46 +0100shriekingnoise(~shrieking@186.137.167.202)
2022-12-30 06:04:23 +0100freeside(~mengwong@103.252.202.159) (Ping timeout: 264 seconds)
2022-12-30 06:04:54 +0100johnw(~johnw@76-234-69-149.lightspeed.frokca.sbcglobal.net)
2022-12-30 06:07:06 +0100shriekingnoise(~shrieking@186.137.167.202) (Client Quit)
2022-12-30 06:07:10 +0100zmt01(~zmt00@user/zmt00)
2022-12-30 06:10:38 +0100beefbambi(~beefbambi@183.82.24.237) (Ping timeout: 272 seconds)
2022-12-30 06:11:00 +0100zmt00(~zmt00@user/zmt00) (Ping timeout: 260 seconds)
2022-12-30 06:11:11 +0100beefbambi(~beefbambi@2401:4900:230d:f57c:538c:d7cc:50c0:e377)
2022-12-30 06:18:11 +0100[Leary](~Leary]@user/Leary/x-0910699) (Ping timeout: 264 seconds)
2022-12-30 06:18:18 +0100freeside(~mengwong@103.252.202.159)
2022-12-30 06:19:52 +0100[Leary](~Leary]@user/Leary/x-0910699)
2022-12-30 06:23:35 +0100freeside(~mengwong@103.252.202.159) (Ping timeout: 246 seconds)
2022-12-30 06:41:14 +0100freeside(~mengwong@103.252.202.159)
2022-12-30 06:51:50 +0100titibandit(~titibandi@xdsl-89-0-163-79.nc.de)
2022-12-30 06:59:20 +0100instantaphex(~jb@c-73-171-252-84.hsd1.fl.comcast.net) (Ping timeout: 268 seconds)
2022-12-30 07:11:00 +0100bjourne(~bjorn@94.191.136.87.mobile.tre.se) (Read error: Connection reset by peer)
2022-12-30 07:35:31 +0100takuan(~takuan@178-116-218-225.access.telenet.be)
2022-12-30 07:46:16 +0100freeside(~mengwong@103.252.202.159) (Ping timeout: 272 seconds)
2022-12-30 07:50:41 +0100freeside(~mengwong@103.252.202.159)
2022-12-30 07:52:23 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 252 seconds)
2022-12-30 07:53:16 +0100Maeda(~Maeda@91-161-10-149.subs.proxad.net) (Ping timeout: 252 seconds)
2022-12-30 07:55:08 +0100freeside(~mengwong@103.252.202.159) (Ping timeout: 272 seconds)
2022-12-30 07:56:59 +0100wroathe(~wroathe@user/wroathe) (Quit: leaving)
2022-12-30 08:02:08 +0100bitdex(~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 255 seconds)
2022-12-30 08:02:11 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net)
2022-12-30 08:03:11 +0100tose(~tose@cst-prg-38-106.cust.vodafone.cz)
2022-12-30 08:05:32 +0100bitdex(~bitdex@gateway/tor-sasl/bitdex)
2022-12-30 08:09:19 +0100freeside(~mengwong@103.252.202.159)
2022-12-30 08:13:32 +0100freeside(~mengwong@103.252.202.159) (Ping timeout: 246 seconds)
2022-12-30 08:14:18 +0100Unicorn_Princess(~Unicorn_P@user/Unicorn-Princess/x-3540542) (Remote host closed the connection)
2022-12-30 08:15:05 +0100kritzefitz(~kritzefit@debian/kritzefitz) (Ping timeout: 255 seconds)
2022-12-30 08:18:40 +0100kritzefitz(~kritzefit@debian/kritzefitz)
2022-12-30 08:19:04 +0100xff0x(~xff0x@ai071162.d.east.v6connect.net) (Quit: xff0x)
2022-12-30 08:21:15 +0100v0id_ptr(~adrift@user/ptr-frac7al/x-0038398) (Ping timeout: 248 seconds)
2022-12-30 08:24:28 +0100tose(~tose@cst-prg-38-106.cust.vodafone.cz) (Ping timeout: 260 seconds)
2022-12-30 08:24:42 +0100trev(~trev@user/trev)
2022-12-30 08:26:10 +0100kritzefitz(~kritzefit@debian/kritzefitz) (Ping timeout: 272 seconds)
2022-12-30 08:26:15 +0100freeside(~mengwong@103.252.202.159)
2022-12-30 08:40:05 +0100ft(~ft@i59F54B83.versanet.de) (Quit: leaving)
2022-12-30 08:42:20 +0100lortabac(~lortabac@2a01:e0a:541:b8f0:1ac5:7c71:7184:d83)
2022-12-30 08:46:08 +0100zeenk(~zeenk@2a02:2f04:a110:ac00::7fe)
2022-12-30 08:46:36 +0100kritzefitz(~kritzefit@debian/kritzefitz)
2022-12-30 08:50:09 +0100tose(~tose@cst-prg-38-106.cust.vodafone.cz)
2022-12-30 08:52:55 +0100VY2(~user@213.24.126.116)
2022-12-30 08:54:23 +0100gnalzo(~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c)
2022-12-30 09:05:01 +0100Sgeo(~Sgeo@user/sgeo) (Read error: Connection reset by peer)
2022-12-30 09:08:50 +0100v0id_ptr(~adrift@user/ptr-frac7al/x-0038398)
2022-12-30 09:13:09 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 268 seconds)
2022-12-30 09:18:41 +0100Hugo86576(~Hugo86576@p4fe8b885.dip0.t-ipconnect.de)
2022-12-30 09:19:55 +0100jmdaemon(~jmdaemon@user/jmdaemon) (Ping timeout: 248 seconds)
2022-12-30 09:22:22 +0100troydm(~troydm@host-176-37-124-197.b025.la.net.ua) (Ping timeout: 265 seconds)
2022-12-30 09:28:41 +0100Hugo86576(~Hugo86576@p4fe8b885.dip0.t-ipconnect.de) (Remote host closed the connection)
2022-12-30 09:33:23 +0100ft(~ft@dynamic-046-114-194-225.46.114.pool.telefonica.de)
2022-12-30 09:35:42 +0100razetime(~Thunderbi@49.207.228.176)
2022-12-30 09:37:21 +0100xff0x(~xff0x@2405:6580:b080:900:a46:d342:a53f:ec6a)
2022-12-30 09:42:07 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net)
2022-12-30 09:42:48 +0100tose(~tose@cst-prg-38-106.cust.vodafone.cz) (Ping timeout: 272 seconds)
2022-12-30 09:46:48 +0100mei(~mei@user/mei)
2022-12-30 09:47:17 +0100freeside_(~mengwong@bb115-66-48-84.singnet.com.sg)
2022-12-30 09:47:53 +0100freeside(~mengwong@103.252.202.159) (Ping timeout: 260 seconds)
2022-12-30 09:52:54 +0100tose(~tose@cst-prg-38-106.cust.vodafone.cz)
2022-12-30 10:01:04 +0100freeside_(~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 260 seconds)
2022-12-30 10:01:30 +0100econo(uid147250@user/econo) (Quit: Connection closed for inactivity)
2022-12-30 10:02:49 +0100freeside(~mengwong@103.252.202.159)
2022-12-30 10:06:28 +0100mc47(~mc47@xmonad/TheMC47)
2022-12-30 10:08:53 +0100acidjnk(~acidjnk@p200300d6e7137a527546c6117c6e6714.dip0.t-ipconnect.de)
2022-12-30 10:12:00 +0100jakalx(~jakalx@base.jakalx.net) ()
2022-12-30 10:16:03 +0100APic(apic@apic.name) (Ping timeout: 268 seconds)
2022-12-30 10:16:22 +0100APic(apic@apic.name)
2022-12-30 10:20:10 +0100VY2_(~user@217.107.126.152)
2022-12-30 10:20:25 +0100gnalzo(~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c) (Quit: WeeChat 3.7.1)
2022-12-30 10:20:33 +0100jakalx(~jakalx@base.jakalx.net)
2022-12-30 10:22:06 +0100Tuplanolla(~Tuplanoll@91-159-68-152.elisa-laajakaista.fi)
2022-12-30 10:22:50 +0100VY2(~user@213.24.126.116) (Ping timeout: 268 seconds)
2022-12-30 10:25:12 +0100gehmehgehgmg
2022-12-30 10:27:55 +0100caryhartline(~caryhartl@2600:1700:2d0:8d30:486e:abe:5ebb:c6a0) (Quit: caryhartline)
2022-12-30 10:28:29 +0100simple(skralg@user/simple) (Remote host closed the connection)
2022-12-30 10:30:50 +0100simple(skralg@user/simple)
2022-12-30 10:37:49 +0100trev(~trev@user/trev) (Remote host closed the connection)
2022-12-30 10:38:00 +0100rburkholder(~blurb@96.45.2.121) (Remote host closed the connection)
2022-12-30 10:38:06 +0100trev(~trev@user/trev)
2022-12-30 10:39:08 +0100tose(~tose@cst-prg-38-106.cust.vodafone.cz) (Ping timeout: 246 seconds)
2022-12-30 10:39:47 +0100L29Ah(~L29Ah@wikipedia/L29Ah) (Ping timeout: 264 seconds)
2022-12-30 10:44:32 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 265 seconds)
2022-12-30 10:45:07 +0100cheater_(~Username@user/cheater)
2022-12-30 10:46:47 +0100cheater(~Username@user/cheater) (Ping timeout: 246 seconds)
2022-12-30 10:46:48 +0100ft(~ft@dynamic-046-114-194-225.46.114.pool.telefonica.de) (Quit: leaving)
2022-12-30 10:46:53 +0100cheater_cheater
2022-12-30 10:48:05 +0100freeside(~mengwong@103.252.202.159) (Ping timeout: 260 seconds)
2022-12-30 10:50:47 +0100jakalx(~jakalx@base.jakalx.net) ()
2022-12-30 10:52:27 +0100cheater_(~Username@user/cheater)
2022-12-30 10:52:43 +0100jakalx(~jakalx@base.jakalx.net)
2022-12-30 10:53:09 +0100coot(~coot@213.134.171.3)
2022-12-30 10:53:19 +0100cheater(~Username@user/cheater) (Ping timeout: 260 seconds)
2022-12-30 10:53:22 +0100cheater_cheater
2022-12-30 10:56:49 +0100califax(~califax@user/califx) (Remote host closed the connection)
2022-12-30 10:57:56 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net)
2022-12-30 10:57:58 +0100califax(~califax@user/califx)
2022-12-30 11:05:22 +0100zer0bitz(~zer0bitz@196.244.192.55)
2022-12-30 11:07:33 +0100 <tomjaguarpaw> I'm just watching "Unresolved challenges of scoped effects" by lexi-lambda (https://www.twitch.tv/videos/1163853841). I'm curious: is <|> an "algebraic operation" in the Plotkin-Power sense?
2022-12-30 11:11:28 +0100thongpv(~thongpv87@2402:9d80:3db:44f4:2cb2:e04c:4067:cfda) (Read error: Connection reset by peer)
2022-12-30 11:12:16 +0100ft(~ft@dynamic-046-114-194-225.46.114.pool.telefonica.de)
2022-12-30 11:19:03 +0100L29Ah(~L29Ah@wikipedia/L29Ah)
2022-12-30 11:19:22 +0100thyriaen(~thyriaen@2a01:aea0:dd4:4bae:6245:cbff:fe9f:48b1)
2022-12-30 11:21:30 +0100mmhat(~mmh@p200300f1c721be69ee086bfffe095315.dip0.t-ipconnect.de)
2022-12-30 11:22:55 +0100mei(~mei@user/mei) (Quit: mei)
2022-12-30 11:23:07 +0100albet70(~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection)
2022-12-30 11:24:40 +0100 <tomjaguarpaw> I guess it is, based on the paper https://homepages.inf.ed.ac.uk/gdp/publications/alg_ops_gen_effects.pdf. "an algebraic operation is ... α_x : (T x)^v → (T x)^w"
2022-12-30 11:24:59 +0100 <tomjaguarpaw> (satisfying a commutative diagram)
2022-12-30 11:29:10 +0100troydm(~troydm@host-176-37-124-197.b025.la.net.ua)
2022-12-30 11:29:14 +0100albet70(~xxx@2400:8902::f03c:92ff:fe60:98d8)
2022-12-30 11:30:46 +0100 <eldritchcookie[4> is there a way to generically turn a t (t m) a into t m a? assuming m monad and t monad transformer
2022-12-30 11:31:52 +0100Lord_of_Life_(~Lord@user/lord-of-life/x-2819915)
2022-12-30 11:32:43 +0100Lord_of_Life(~Lord@user/lord-of-life/x-2819915) (Ping timeout: 252 seconds)
2022-12-30 11:33:09 +0100Lord_of_Life_Lord_of_Life
2022-12-30 11:36:03 +0100wootehfoot(~wootehfoo@user/wootehfoot)
2022-12-30 11:41:00 +0100gnalzo(~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c)
2022-12-30 11:41:35 +0100CiaoSen(~Jura@p200300c9571bac002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
2022-12-30 11:44:14 +0100 <tomjaguarpaw> eldritchcookie[4: Some variant of embed? https://hackage.haskell.org/package/mmorph-1.2.0/docs/Control-Monad-Morph.html#v:embed
2022-12-30 11:45:20 +0100 <tomjaguarpaw> embed id :: (MMonad t, Monad n) => t (t n) b -> t n b
2022-12-30 11:46:14 +0100 <tomjaguarpaw> The key thing to note is that this is a "higher rank join", and join = (>>= id)
2022-12-30 11:51:16 +0100 <eldritchcookie[4> nice squash does this exactly
2022-12-30 11:53:09 +0100 <[Leary]> tomjaguarpaw: It may depend on the instance, but `(<|>)` is usually like `catch`, which isn't algebraic. See 'Example 3' on page 8 of the paper you linked, though there seems to be an error there: they probably mean to define `handle_e(e,b) = b; handle_e(a,b) = a`.
2022-12-30 11:53:50 +0100trev(~trev@user/trev) (Remote host closed the connection)
2022-12-30 11:53:56 +0100tzh(~tzh@c-24-21-73-154.hsd1.or.comcast.net) (Quit: zzz)
2022-12-30 11:54:07 +0100trev(~trev@user/trev)
2022-12-30 11:57:01 +0100 <eldritchcookie[4> but if i am understanding correctly we can't do this for every monad transformer t
2022-12-30 11:59:28 +0100allbery_b(~geekosaur@xmonad/geekosaur)
2022-12-30 11:59:33 +0100geekosaur(~geekosaur@xmonad/geekosaur) (Killed (NickServ (GHOST command used by allbery_b)))
2022-12-30 12:00:08 +0100Lycurgus(~juan@user/Lycurgus)
2022-12-30 12:00:14 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 272 seconds)
2022-12-30 12:09:32 +0100xff0x(~xff0x@2405:6580:b080:900:a46:d342:a53f:ec6a) (Quit: xff0x)
2022-12-30 12:10:57 +0100beteigeuze(~Thunderbi@bl14-81-220.dsl.telepac.pt)
2022-12-30 12:11:08 +0100VY2_(~user@217.107.126.152) (Ping timeout: 246 seconds)
2022-12-30 12:11:28 +0100xff0x(~xff0x@2405:6580:b080:900:18f:39b6:7457:a86b)
2022-12-30 12:13:04 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:2914:f025:7ef3:a77d) (Remote host closed the connection)
2022-12-30 12:20:18 +0100trev(~trev@user/trev) (Remote host closed the connection)
2022-12-30 12:20:40 +0100trev(~trev@user/trev)
2022-12-30 12:21:29 +0100meinside(uid24933@id-24933.helmsley.irccloud.com) (Quit: Connection closed for inactivity)
2022-12-30 12:26:17 +0100xff0x(~xff0x@2405:6580:b080:900:18f:39b6:7457:a86b) (Ping timeout: 252 seconds)
2022-12-30 12:26:36 +0100sammelweis(~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.)
2022-12-30 12:26:44 +0100sammelweis(~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10)
2022-12-30 12:27:05 +0100mmhat(~mmh@p200300f1c721be69ee086bfffe095315.dip0.t-ipconnect.de) (Quit: WeeChat 3.7.1)
2022-12-30 12:27:05 +0100CiaoSen(~Jura@p200300c9571bac002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 255 seconds)
2022-12-30 12:27:57 +0100thongpv(~thongpv87@2402:9d80:3db:44f4:3a10:72cf:c3cd:6f03)
2022-12-30 12:28:28 +0100xff0x(~xff0x@178.255.149.135)
2022-12-30 12:31:06 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net)
2022-12-30 12:32:17 +0100 <lyxia> eldritchcookie[4: can't do that for StateT
2022-12-30 12:33:26 +0100tose(~tose@cst-prg-38-106.cust.vodafone.cz)
2022-12-30 12:33:40 +0100beefbambi(~beefbambi@2401:4900:230d:f57c:538c:d7cc:50c0:e377) (Ping timeout: 260 seconds)
2022-12-30 12:36:02 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 268 seconds)
2022-12-30 12:36:20 +0100xff0x(~xff0x@178.255.149.135) (Ping timeout: 272 seconds)
2022-12-30 12:37:44 +0100xff0x(~xff0x@2405:6580:b080:900:18f:39b6:7457:a86b)
2022-12-30 12:39:24 +0100__monty__(~toonn@user/toonn)
2022-12-30 12:53:57 +0100 <tomjaguarpaw> [Leary]: Thanks. I'm particularly interested in non-determinism, where I think <|> is algebraic, at least from how lexi-lambda talks about it. I haven't worked through the condition though.
2022-12-30 13:01:11 +0100zeenk(~zeenk@2a02:2f04:a110:ac00::7fe) (Quit: Konversation terminated!)
2022-12-30 13:01:15 +0100xff0x(~xff0x@2405:6580:b080:900:18f:39b6:7457:a86b) (Ping timeout: 248 seconds)
2022-12-30 13:03:14 +0100Lycurgus(~juan@user/Lycurgus) (Quit: Exeunt: personae.ai-integration.biz)
2022-12-30 13:03:21 +0100xff0x(~xff0x@178.255.149.135)
2022-12-30 13:03:28 +0100ft(~ft@dynamic-046-114-194-225.46.114.pool.telefonica.de) (Quit: leaving)
2022-12-30 13:04:55 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net)
2022-12-30 13:08:42 +0100jakalx(~jakalx@base.jakalx.net) (Error from remote client)
2022-12-30 13:08:44 +0100jmorris(uid537181@id-537181.uxbridge.irccloud.com) (Quit: Connection closed for inactivity)
2022-12-30 13:08:52 +0100jakalx(~jakalx@base.jakalx.net)
2022-12-30 13:09:16 +0100tose(~tose@cst-prg-38-106.cust.vodafone.cz) (Ping timeout: 272 seconds)
2022-12-30 13:09:54 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 272 seconds)
2022-12-30 13:09:54 +0100xff0x(~xff0x@178.255.149.135) (Ping timeout: 272 seconds)
2022-12-30 13:10:17 +0100xff0x(~xff0x@178.255.149.135)
2022-12-30 13:13:32 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:2914:f025:7ef3:a77d)
2022-12-30 13:15:30 +0100 <[Leary]> tomjaguarpaw: Yeah, in that case it should be---note 'Example 1' on the previous page.
2022-12-30 13:17:41 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:2914:f025:7ef3:a77d) (Ping timeout: 246 seconds)
2022-12-30 13:17:41 +0100xff0x(~xff0x@178.255.149.135) (Ping timeout: 246 seconds)
2022-12-30 13:18:32 +0100mzan(~quassel@mail.asterisell.com) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
2022-12-30 13:19:34 +0100xff0x(~xff0x@2405:6580:b080:900:18f:39b6:7457:a86b)
2022-12-30 13:22:41 +0100tose(~tose@cst-prg-38-106.cust.vodafone.cz)
2022-12-30 13:24:29 +0100mzan(~quassel@mail.asterisell.com)
2022-12-30 13:29:30 +0100eldritch_(~eldritch@2804:7f4:8180:b77d:9367:1155:b601:f590)
2022-12-30 13:30:23 +0100dextaa6(~DV@user/dextaa)
2022-12-30 13:32:15 +0100dextaa(~DV@user/dextaa) (Ping timeout: 265 seconds)
2022-12-30 13:32:16 +0100dextaa6dextaa
2022-12-30 13:38:37 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net)
2022-12-30 13:39:02 +0100tose(~tose@cst-prg-38-106.cust.vodafone.cz) (Ping timeout: 246 seconds)
2022-12-30 13:39:25 +0100 <tomjaguarpaw> [Leary]++
2022-12-30 13:40:43 +0100acidjnk(~acidjnk@p200300d6e7137a527546c6117c6e6714.dip0.t-ipconnect.de) (Ping timeout: 248 seconds)
2022-12-30 13:41:47 +0100titibandit(~titibandi@xdsl-89-0-163-79.nc.de) (Ping timeout: 255 seconds)
2022-12-30 13:42:20 +0100son0p(~ff@2604:3d08:5b7f:5540:98a9:2169:15a1:4c7f) (Remote host closed the connection)
2022-12-30 13:44:44 +0100eldritch_(~eldritch@2804:7f4:8180:b77d:9367:1155:b601:f590) (Quit: Leaving)
2022-12-30 13:49:31 +0100Guest9971(~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr)
2022-12-30 13:58:05 +0100bitdex(~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 255 seconds)
2022-12-30 14:01:00 +0100bitdex(~bitdex@gateway/tor-sasl/bitdex)
2022-12-30 14:03:11 +0100v0id_ptr(~adrift@user/ptr-frac7al/x-0038398) (Ping timeout: 264 seconds)
2022-12-30 14:05:05 +0100hyperbolic-dg(~quassel@i577AA562.versanet.de)
2022-12-30 14:11:26 +0100hussam(~hussam@user/hussam)
2022-12-30 14:13:10 +0100hussam(~hussam@user/hussam) (Quit: issued !quit command)
2022-12-30 14:14:06 +0100ft(~ft@p4fc2a257.dip0.t-ipconnect.de)
2022-12-30 14:17:04 +0100hussam(~hussam@user/hussam)
2022-12-30 14:22:24 +0100son0p(~ff@2604:3d08:5b7f:5540::417e)
2022-12-30 14:22:40 +0100thongpv87(~thongpv87@2402:9d80:3db:44f4:3a10:72cf:c3cd:6f03)
2022-12-30 14:22:49 +0100waleee(~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340)
2022-12-30 14:22:50 +0100emmanuelux(~emmanuelu@user/emmanuelux) (Read error: Connection reset by peer)
2022-12-30 14:23:40 +0100perrierjouet(~perrier-j@modemcable048.127-56-74.mc.videotron.ca)
2022-12-30 14:24:22 +0100thyriaen(~thyriaen@2a01:aea0:dd4:4bae:6245:cbff:fe9f:48b1) (Quit: Leaving)
2022-12-30 14:25:33 +0100thongpv(~thongpv87@2402:9d80:3db:44f4:3a10:72cf:c3cd:6f03) (Ping timeout: 260 seconds)
2022-12-30 14:30:42 +0100bjourne(~bjorn@94.191.136.87.mobile.tre.se)
2022-12-30 14:33:17 +0100sammelweis(~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.)
2022-12-30 14:34:24 +0100sammelweis(~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10)
2022-12-30 14:35:00 +0100titibandit(~titibandi@xdsl-89-0-163-79.nc.de)
2022-12-30 14:36:19 +0100n0den1te(~aaaa@2401:4900:1cc8:ae75:8ca5:24cf:a3c6:3784)
2022-12-30 14:36:25 +0100waleee(~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Ping timeout: 252 seconds)
2022-12-30 14:39:33 +0100cheater(~Username@user/cheater) (Ping timeout: 260 seconds)
2022-12-30 14:41:11 +0100cheater(~Username@user/cheater)
2022-12-30 14:42:14 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 260 seconds)
2022-12-30 14:46:53 +0100freeside(~mengwong@103.252.202.159)
2022-12-30 14:51:02 +0100freeside(~mengwong@103.252.202.159) (Ping timeout: 252 seconds)
2022-12-30 14:52:00 +0100Unicorn_Princess(~Unicorn_P@user/Unicorn-Princess/x-3540542)
2022-12-30 14:53:41 +0100tose(~tose@cst-prg-38-106.cust.vodafone.cz)
2022-12-30 14:59:22 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net)
2022-12-30 15:03:47 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 264 seconds)
2022-12-30 15:08:38 +0100perrierjouet(~perrier-j@modemcable048.127-56-74.mc.videotron.ca) (Quit: WeeChat 3.7.1)
2022-12-30 15:08:40 +0100Guest41(~Guest41@ip-084-118-041-183.um23.pools.vodafone-ip.de)
2022-12-30 15:09:07 +0100 <Guest41> Hello, is some advanced haskellian here?
2022-12-30 15:10:35 +0100 <razetime> https://dontasktoask.com/
2022-12-30 15:10:38 +0100 <Guest41> I'd like to ask something about mFilter: Why does the Monoid needs to be an instance of Applicative there?
2022-12-30 15:12:32 +0100 <Guest41> cause mFilter requires a MonadPlus instance, which Requires an Alternative instance, which requires Applicative instance...
2022-12-30 15:12:33 +0100 <Guest41> But I don't understand why the Type needs to be Applicative to be thrown into mFilter
2022-12-30 15:12:55 +0100 <razetime> I don't understand this question, but https://discourse.haskell.org/ may also be a good place to ask your question.
2022-12-30 15:13:24 +0100 <c_wraith> Guest41: mfilter :: MonadPlus m => (a -> Bool) -> m a -> m a
2022-12-30 15:13:47 +0100 <c_wraith> what function are you asking about?
2022-12-30 15:14:15 +0100 <Guest41> there it says "MonadPlus"? Why isn't Monad enough?
2022-12-30 15:14:57 +0100Maeda(~Maeda@91-161-10-149.subs.proxad.net)
2022-12-30 15:15:58 +0100 <Guest41> I mean I hardly understand Monad's, but I don't understand why the data Structure needs to be Appliactive (which seems to be required for MonadPlus) to work for filter
2022-12-30 15:15:58 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:2914:f025:7ef3:a77d)
2022-12-30 15:16:07 +0100 <c_wraith> well, the type `(a -> Bool) -> m a -> m a` is enough to see that `Monad m` isn't a sufficient constraint
2022-12-30 15:17:20 +0100 <Guest41> c_wraith: I don't see why Monda m isn't enough to be honest
2022-12-30 15:17:40 +0100 <c_wraith> Monad gives you (>>=) and return.
2022-12-30 15:17:44 +0100 <Guest41> well yes
2022-12-30 15:17:47 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net)
2022-12-30 15:18:13 +0100 <Guest41> and mfilter needs <*> as well or what?
2022-12-30 15:18:15 +0100 <c_wraith> neither of those introduce a value of type `m a` without something else
2022-12-30 15:18:26 +0100 <c_wraith> MonadPlus, on the other hand, provides mzero
2022-12-30 15:18:38 +0100 <c_wraith> which actually gives you something to do if the predicate fails
2022-12-30 15:19:07 +0100 <c_wraith> Check out the source: https://hackage.haskell.org/package/base-4.17.0.0/docs/src/Control.Monad.html#mfilter (towards the bottom, it's the last definition in the file)
2022-12-30 15:20:05 +0100 <Guest41> Ahh that makes sense and this mzero comes from "Alternative"?
2022-12-30 15:20:11 +0100 <c_wraith> it comes from MonadPlus
2022-12-30 15:20:23 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:2914:f025:7ef3:a77d) (Ping timeout: 260 seconds)
2022-12-30 15:20:34 +0100 <c_wraith> You seem to be mixing filterM and mfilter
2022-12-30 15:20:43 +0100 <c_wraith> or else you're talking about some third thing entirely
2022-12-30 15:21:28 +0100perrierjouet(~perrier-j@modemcable048.127-56-74.mc.videotron.ca)
2022-12-30 15:22:35 +0100 <Guest41> Well, by trial and Error I now have some code working for mfilter. And I am trying to understand it..:
2022-12-30 15:22:36 +0100 <Guest41> I am instanciating the MonadPlus simply by providing "instance Alternative" and "instance Monad"
2022-12-30 15:23:03 +0100 <c_wraith> Alternative and MonadPlus are almost the same
2022-12-30 15:23:32 +0100 <lortabac> I guess (Monad m, Alternative m) would make sense too
2022-12-30 15:23:50 +0100 <c_wraith> It would, but that's the default implementation of MonadPlus
2022-12-30 15:23:53 +0100 <lortabac> the (MonadPlus m) is probably for historical reasons (?)
2022-12-30 15:24:22 +0100 <c_wraith> I mean, I suppose it'd be nice to not have to basically-identical class with only a difference in superclass requirements
2022-12-30 15:24:29 +0100 <c_wraith> that predates the AMP changes
2022-12-30 15:24:59 +0100 <c_wraith> But now that we're stuck with both for backwards compatibility, might as well use MonadPlus to mean both of those more compactly?
2022-12-30 15:25:19 +0100 <lortabac> IMHO the superclass requirement is kind of useless
2022-12-30 15:25:41 +0100 <lortabac> you can always add the (Monad m) constraint when needed
2022-12-30 15:25:56 +0100 <Guest41> My Problem now is that I instanciated the "Applicative" class, but with Rubbish, cause I don't even want it
2022-12-30 15:26:48 +0100 <lortabac> Guest41: why do you want to use mfilter then? if 'm' is not an Applicative it doesn't make sense
2022-12-30 15:27:05 +0100 <Guest41> I might missunderstand what applicative means?
2022-12-30 15:27:30 +0100 <Guest41> I thought it means you can apply the datastructure as function
2022-12-30 15:28:12 +0100 <Guest41> But I don't want to apply my data as a Function on another
2022-12-30 15:28:36 +0100 <Guest41> Atleast I think I don't want that
2022-12-30 15:28:57 +0100 <lortabac> can I ask why you need mfilter?
2022-12-30 15:29:00 +0100 <c_wraith> It means that if you have one chunk of your data holding functions and another chunk holding values, you can apply those functions to those values to get a new data structure holding results. I mean, in some wobby sense.
2022-12-30 15:29:28 +0100 <c_wraith> :t (<*>) -- this is a much more compact way of saying roughly the same thing, but much more precisely
2022-12-30 15:29:29 +0100 <lambdabot> Applicative f => f (a -> b) -> f a -> f b
2022-12-30 15:30:36 +0100 <Guest41> Like I have a Tree.
2022-12-30 15:30:36 +0100 <Guest41> You mean Applicative means that If I have 2 trees, one of them full with functions and one full with values, I can apply them on each other?
2022-12-30 15:30:38 +0100 <ncf> you might want to have a look at https://wiki.haskell.org/Typeclassopedia#Applicative
2022-12-30 15:33:00 +0100 <lortabac> Guest41: yes, technically that's what Applicative does
2022-12-30 15:34:32 +0100 <Guest41> How could that be sensefully implemented for a Tree?
2022-12-30 15:34:43 +0100CiaoSen(~Jura@p200300c9571bac002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
2022-12-30 15:34:46 +0100 <c_wraith> Depends. There are a few ways.
2022-12-30 15:35:05 +0100 <c_wraith> But... Mostly they aren't what you'd expect.
2022-12-30 15:35:19 +0100 <Guest41> well, always returning Nil (empty Tree) did work for my use case, but that can't be right?
2022-12-30 15:35:26 +0100 <c_wraith> Which means... Let's back up to lortabac's question. Why are you trying to use mfilter?
2022-12-30 15:35:56 +0100 <Guest41> Well, it is a Tree... I want to filter it... so I thought about using mfilter
2022-12-30 15:36:30 +0100 <c_wraith> that's not what it's for, really. For the same reason you don't think it's easy to write a meaningful Applicative instance
2022-12-30 15:36:38 +0100shriekingnoise(~shrieking@186.137.167.202)
2022-12-30 15:37:11 +0100 <c_wraith> The thing that actually is for that is https://hackage.haskell.org/package/witherable-0.4.2/docs/Witherable.html#t:Filterable
2022-12-30 15:37:18 +0100 <c_wraith> But it's no shortcut.
2022-12-30 15:37:34 +0100 <c_wraith> You're going to have to write all the critical logic yourself, and it's going to be hard, because the question is hard.
2022-12-30 15:38:01 +0100 <c_wraith> Tree deletes are just not free
2022-12-30 15:38:44 +0100 <Guest41> But my current filtering via mfilter does in a way work? But you say I am missuing stuff I shoudn't have?
2022-12-30 15:39:09 +0100 <c_wraith> the difference between "in a way" and "correct"
2022-12-30 15:40:04 +0100 <c_wraith> what should the result of `filter even (Node 3 (Node 2 Nil Nil) (Node 4 Nil Nil))` be?
2022-12-30 15:41:23 +0100cheater(~Username@user/cheater) (Ping timeout: 260 seconds)
2022-12-30 15:41:55 +0100 <Guest41> Node 3 []
2022-12-30 15:41:56 +0100 <Guest41> (My subtrees are lists and if a Node doesn't fulfill the condition, the full sub-Tree may be deleted
2022-12-30 15:42:01 +0100cheater(~Username@user/cheater)
2022-12-30 15:42:47 +0100 <c_wraith> that's definitely the wrong answer. filter keeps the things that match the predicate. Nil?
2022-12-30 15:43:56 +0100 <Guest41> Oh yeah, then Nil is the answer
2022-12-30 15:45:26 +0100allbery_bgeekosaur
2022-12-30 15:46:08 +0100 <jean-paul[m]> using Hedgehog, why does Gen.text (Range.linear 0 999) (Gen.filterT (/= '\n') Gen.unicode) seem to loop forever
2022-12-30 15:49:52 +0100[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470)
2022-12-30 15:54:09 +0100 <Guest41> So, mFilter is only for applicative data, but obviously it is enough for mfilter to work, that the data Type provides:
2022-12-30 15:54:10 +0100 <Guest41> return
2022-12-30 15:54:10 +0100 <Guest41> >>=
2022-12-30 15:54:11 +0100 <Guest41> empty(=mzero)
2022-12-30 15:54:11 +0100 <Guest41> So why does it require so much more
2022-12-30 15:54:50 +0100CiaoSen(~Jura@p200300c9571bac002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 246 seconds)
2022-12-30 15:56:13 +0100 <ncf> every Monad is an Applicative and every MonadPlus is an Alternative, so the only thing it requires that it doesn't need is <|>
2022-12-30 15:56:22 +0100 <jean-paul[m]> Oh, it didn't loop forever, just a long long time :/
2022-12-30 15:56:46 +0100motherfsck(~motherfsc@user/motherfsck)
2022-12-30 15:57:01 +0100 <Guest41> It doesn't requires <*> to filter?
2022-12-30 15:58:29 +0100 <ncf> did you read its implementation? it's not very long
2022-12-30 15:58:35 +0100 <ncf> @src mfilter
2022-12-30 15:58:35 +0100 <lambdabot> Source not found. BOB says: You seem to have forgotten your passwd, enter another!
2022-12-30 15:58:51 +0100 <ncf> mfilter p ma = do a <- ma; if p a then return a else mzero
2022-12-30 15:59:06 +0100 <Guest41> Yeah, I read it
2022-12-30 15:59:17 +0100 <Guest41> Not that I would understand it
2022-12-30 15:59:25 +0100 <Guest41> But i dont see <*> in there
2022-12-30 16:00:18 +0100 <ncf> it doesn't use <*>. my point is that you can define <*> "for free" using >>= and return, so it's not really an additional constraint
2022-12-30 16:00:46 +0100 <ncf> :t ap
2022-12-30 16:00:47 +0100 <lambdabot> Monad m => m (a -> b) -> m a -> m b
2022-12-30 16:01:04 +0100cheater_(~Username@user/cheater)
2022-12-30 16:01:09 +0100 <Guest41> How would it be defined using >>= and return?
2022-12-30 16:01:37 +0100 <Guest41> cause my Compiler requires me to define it anyway
2022-12-30 16:01:46 +0100 <ncf> mf <*> ma = do f <- mf; a <- ma; return (f a)
2022-12-30 16:02:13 +0100 <ncf> if you already have a Monad instance, you can just do instance Applicative YourThing where pure = return; (<*>) = ap
2022-12-30 16:03:23 +0100 <Guest41> How can the programm take f out of mf?
2022-12-30 16:03:25 +0100 <ggVGc> are we still discussing monads?
2022-12-30 16:03:49 +0100 <Guest41> Why? Are Monads to trivial?
2022-12-30 16:03:54 +0100cheater(~Username@user/cheater) (Ping timeout: 260 seconds)
2022-12-30 16:03:59 +0100tose(~tose@cst-prg-38-106.cust.vodafone.cz) (Ping timeout: 255 seconds)
2022-12-30 16:04:01 +0100cheater_cheater
2022-12-30 16:04:07 +0100 <ggVGc> no, but it's been the topic the last two times I checked this window too :)
2022-12-30 16:04:21 +0100 <ggVGc> with several hours spacing. Anyway, please continue
2022-12-30 16:04:34 +0100 <Guest41> Well it wasn't me the last times
2022-12-30 16:06:38 +0100 <Guest41> So, the apply function takes 2 instances of a Monad and could just use something like this?:
2022-12-30 16:06:38 +0100 <Guest41> mf <*> ma = ma >>= (mf >>= <*>)
2022-12-30 16:06:39 +0100 <Guest41> ??
2022-12-30 16:07:08 +0100 <Guest41> I don't like that its infix, that confuses me :D
2022-12-30 16:07:42 +0100 <ggVGc> in cases where it gets confusing, it's sometimes better to write out the full lambda
2022-12-30 16:07:51 +0100 <ggVGc> I do this often with operators to make things clearer
2022-12-30 16:08:10 +0100 <ncf> the do-notation i used desugars to mf <*> ma = mf >>= \ f -> ma >>= \ a -> return (f a)
2022-12-30 16:09:28 +0100 <Guest41> with braces like this? mf <*> ma = mf >>= (\ f -> ma >>= (\ a -> return (f a)))
2022-12-30 16:09:40 +0100 <ncf> yes
2022-12-30 16:09:53 +0100 <ncf> you could also do it with a single use of (>>=): mf <*> ma = mf >>= \ f -> fmap f ma
2022-12-30 16:12:04 +0100 <Guest41> Hmm I am just trying to evaluate it step by step: Does a infix operator curry the left operand first?
2022-12-30 16:12:38 +0100bitdex(~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 255 seconds)
2022-12-30 16:12:40 +0100 <ncf> a ? b is equivalent to (?) a b
2022-12-30 16:12:52 +0100 <Guest41> thanks
2022-12-30 16:13:41 +0100 <Guest41> I had the idea of >>= taking a function and returning a new one, but it rather stores the value and then applies the other function on it does it?
2022-12-30 16:14:49 +0100azimut(~azimut@gateway/tor-sasl/azimut)
2022-12-30 16:15:10 +0100 <ncf> :t (>>=)
2022-12-30 16:15:11 +0100 <lambdabot> Monad m => m a -> (a -> m b) -> m b
2022-12-30 16:15:46 +0100bitdex(~bitdex@gateway/tor-sasl/bitdex)
2022-12-30 16:15:47 +0100azimut_(~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds)
2022-12-30 16:16:27 +0100wootehfoot(~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer)
2022-12-30 16:19:29 +0100 <geekosaur> Guest41, it might be best to think of it as injecting a callback. when the `m a` produces a value, the callback `f` is invoked on the `a` to produce an `m b`. (this, unlike the container view, works with IO too)
2022-12-30 16:20:04 +0100 <geekosaur> for the trivial Monads like Maybe, this amounts to unwrapping and rewrapping. for IO, it really does function like a callback that is run whenever the IO is
2022-12-30 16:20:14 +0100 <ggVGc> Guest41: Youmaybe know this already, but, something to keep in mind in Haskell and currying operators is that (+ 2) 1 is not the same as ((+) 2) 1. The former gives 1 + 2, while the latter gives 2 + 1
2022-12-30 16:20:39 +0100 <geekosaur> (-) might have been a better example
2022-12-30 16:20:48 +0100 <glguy> Partial application
2022-12-30 16:21:03 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 260 seconds)
2022-12-30 16:21:06 +0100 <ggVGc> geekosaur: I was gonna use that, but then I realised there's also the confusion about -1 and - 1 :)
2022-12-30 16:21:10 +0100 <ggVGc> anyway, the point stands
2022-12-30 16:21:28 +0100 <glguy> Currying is to do with the relationship between (a,b)-> and a->b->
2022-12-30 16:21:36 +0100lortabac(~lortabac@2a01:e0a:541:b8f0:1ac5:7c71:7184:d83) (Quit: WeeChat 2.8)
2022-12-30 16:21:54 +0100 <ggVGc> yeah, true, wrong wording
2022-12-30 16:22:08 +0100 <ggVGc> well, I guess that's me trying to be helpful for today
2022-12-30 16:22:18 +0100 <ggVGc> maybe ask me about quantum mechanics instead :(
2022-12-30 16:22:24 +0100 <ggVGc> (I also won't have the correct answer)
2022-12-30 16:23:31 +0100 <Guest41> ggVGc I didn't thought about this part of currying but it makes sense...
2022-12-30 16:23:32 +0100 <Guest41> InPlace operators get uglier and uglier
2022-12-30 16:25:00 +0100 <Guest41> Sadly I never really worked with Callbacks so far, (worked with in a way that I had to understand them), so that example doesn't enlighten me either
2022-12-30 16:29:25 +0100razetime(~Thunderbi@49.207.228.176) (Quit: razetime)
2022-12-30 16:31:28 +0100 <witcher> Hi. I'm fairly new to haskell, still learning, and was wondering if there's an option to have ADTs share a field, e.g. when having a binary tree where each node/leaf also carries a value. For now I created a type with fields containing two fields - one for the ADT and the other for the value. can i improve on this somehow?
2022-12-30 16:32:56 +0100 <witcher> the definition of this might make it easier: https://paste.sr.ht/~witcher/abd932a57aec258d238bb0ec50d72d22425cb0c1
2022-12-30 16:33:00 +0100 <ggVGc> witcher: it's easier to answer questions like this if you can show a paste of some code (using some pasting service)
2022-12-30 16:33:07 +0100 <ggVGc> haha, like that :)
2022-12-30 16:33:09 +0100 <witcher> beat you by a second :p
2022-12-30 16:34:06 +0100ddellacosta(~ddellacos@143.244.47.68)
2022-12-30 16:34:18 +0100 <ggVGc> witcher: it looks like you're doing a tagged union (in C-speak), right?
2022-12-30 16:35:25 +0100 <witcher> I guess so, yes
2022-12-30 16:36:36 +0100 <ggVGc> What you would do in Haskell is to have each constructor of the HTree type carry the information it needs. Something like this: https://gist.github.com/7e39e035278ee1e93bc42e60d8f7ce15
2022-12-30 16:37:21 +0100 <bjourne> the usual way of writing trees: data Node a = Tree a [Node a] | Leaf a
2022-12-30 16:38:11 +0100Tuplanolla(~Tuplanoll@91-159-68-152.elisa-laajakaista.fi) (Ping timeout: 246 seconds)
2022-12-30 16:38:17 +0100 <ggVGc> Yeah, this implementation of a "Tree" that I did (which is a copy of the original), is more like a line
2022-12-30 16:38:26 +0100 <ggVGc> since each node can only have either another node, or a leaf
2022-12-30 16:38:42 +0100 <ggVGc> ah, wait, I missed the second HTree param
2022-12-30 16:38:43 +0100 <witcher> Exactly, this is what I had before. I had situations where I'd like to access the `Integer` field and it didn't matter if the type is a `Node` or a `Leaf`, which made that solution a little cumbersom, leading to code duplication when the type didn't matter
2022-12-30 16:39:20 +0100 <witcher> my previous definition was this: `data HTree = Node HTree HTree Integer | Leaf Char Integer`
2022-12-30 16:40:08 +0100 <ggVGc> witcher: I would still do it this way then, https://gist.github.com/7e39e035278ee1e93bc42e60d8f7ce15
2022-12-30 16:40:19 +0100 <ggVGc> e.g having a helper to access the data you want in an easier way
2022-12-30 16:40:31 +0100 <glguy> You can have a record field shared between constructors
2022-12-30 16:40:50 +0100 <witcher> I'm not sure how I didn't think of defining a helper function to extract the value :v)
2022-12-30 16:40:50 +0100Vajb(~Vajb@2001:999:250:c9:8588:6e93:7809:7816) (Read error: Connection reset by peer)
2022-12-30 16:40:56 +0100 <witcher> thank you!
2022-12-30 16:41:27 +0100 <witcher> looks like i was thinking of way too complicated solutions when an easy one does it
2022-12-30 16:43:19 +0100Kaiepi(~Kaiepi@nwcsnbsc03w-47-55-159-86.dhcp-dynamic.fibreop.nb.bellaliant.net) (Ping timeout: 268 seconds)
2022-12-30 16:43:36 +0100waleee(~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340)
2022-12-30 16:44:28 +0100dagit(~dagit@2001:558:6025:38:6476:a063:d05a:44da)
2022-12-30 16:45:10 +0100Guest9971(~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 268 seconds)
2022-12-30 16:46:46 +0100 <Guest41> So, applicative means, we can apply a Tree of Functions  (Tree (a->b)) on a Tree of Values. (Tree a) to get a Tree of different Values (Tree b)
2022-12-30 16:46:47 +0100 <Guest41> A Tree doesn't really seem to be applicative, (because different Structure)
2022-12-30 16:46:47 +0100 <Guest41> And Monad means we can apply any Function that is able to deal with one Value of a Tree (a->b) to a Tree of Values (Tree a) to get a new Tree (Tree b)
2022-12-30 16:46:48 +0100 <Guest41> A Tree Feels to be a Monad, cause that sounds just like mapping each Value (????Functor????)
2022-12-30 16:46:48 +0100 <Guest41> It is weird that a Monad also means that we can use the apply Function on a Tree of Functions, because the apply Function gets a Function as parameter (which are the values of the tree, right).
2022-12-30 16:46:49 +0100 <Guest41> Whatever this apply function then returns, it can deal with a Tree and returns a Tree:D  Which means we can apply Trees on Trees, but Trees don't feel like they can be applied on trees
2022-12-30 16:47:50 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net)
2022-12-30 16:48:41 +0100ratapaca(~ratapaca@98.40.240.33)
2022-12-30 16:49:37 +0100Vajb(~Vajb@hag-jnsbng11-58c3a5-27.dhcp.inet.fi)
2022-12-30 16:52:25 +0100n0den1te(~aaaa@2401:4900:1cc8:ae75:8ca5:24cf:a3c6:3784) (Quit: Quitting...)
2022-12-30 16:52:47 +0100Tuplanolla(~Tuplanoll@91-159-68-152.elisa-laajakaista.fi)
2022-12-30 16:52:50 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 272 seconds)
2022-12-30 16:53:52 +0100 <Guest41> Ah, the difference between Monad ist then, that the Function we apply to the tree does itself returns a Tree instead of only one value
2022-12-30 16:55:07 +0100Sgeo(~Sgeo@user/sgeo)
2022-12-30 16:57:00 +0100 <chreekat> Guest41: you might be having a hard time because you're trying to use too much intuition (using words like "feels" and "sounds like"). Try working from the type class laws -- can you prove them true for your Tree type? It'll probably be enlightening
2022-12-30 16:58:47 +0100 <Guest41> Are these laws what functions need to be implemented?
2022-12-30 16:58:59 +0100 <chreekat> SIde note, https://hackage.haskell.org/package/selective is interesting
2022-12-30 17:00:03 +0100 <chreekat> Guest41: Haskell doesn't enforce the laws, so you have to do a math proof by hand. For instance the Applicative laws are https://wiki.haskell.org/Typeclassopedia#Laws_2
2022-12-30 17:00:04 +0100 <ggVGc> I like how the link to the referenced paper is dead :)
2022-12-30 17:00:18 +0100Dominik[m](~dschrempf@2001:470:69fc:105::2:bbb6)
2022-12-30 17:00:40 +0100Dominik[m](~dschrempf@2001:470:69fc:105::2:bbb6) ()
2022-12-30 17:00:47 +0100 <Guest41> the link to the paper downloads a pdf?
2022-12-30 17:01:19 +0100 <chreekat> it goes to a 404 :(
2022-12-30 17:01:26 +0100 <ggVGc> ah, the link in the readme works
2022-12-30 17:01:27 +0100 <chreekat> maybe google will find it
2022-12-30 17:01:32 +0100 <chreekat> ah cool
2022-12-30 17:02:41 +0100 <chreekat> afk
2022-12-30 17:04:25 +0100 <ggVGc> What I wonder in regards to Selective is, how many things are almost-monadic but does not have join
2022-12-30 17:05:10 +0100 <Guest41> Can someone explain me why there is a $ here:?
2022-12-30 17:05:11 +0100 <Guest41> u <*> pure y = pure ($ y) <*> u
2022-12-30 17:05:14 +0100Kaiepi(~Kaiepi@nwcsnbsc03w-47-55-159-86.dhcp-dynamic.fibreop.nb.bellaliant.net)
2022-12-30 17:05:39 +0100 <geekosaur> it reads better than `` `id` ``
2022-12-30 17:06:07 +0100 <chreekat> Someone couldn't find the energy to write (\f -> f y)
2022-12-30 17:06:20 +0100 <geekosaur> it's function application, with the thing to be applied supplied and the thing to apply as a parameter
2022-12-30 17:06:22 +0100 <ggVGc> $ is function application. ($ y) is the same as (\f -> f y)
2022-12-30 17:06:24 +0100 <geekosaur> like … that
2022-12-30 17:06:46 +0100 <ggVGc> geekosaur: hm, is it id?
2022-12-30 17:06:59 +0100 <ggVGc> oh, right
2022-12-30 17:07:01 +0100 <ggVGc> I get it now :)
2022-12-30 17:07:14 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net)
2022-12-30 17:07:23 +0100 <Guest41> So it returns a Function which gets a function to apply this function :D
2022-12-30 17:07:53 +0100 <Guest41> So u is a Context of Functions?
2022-12-30 17:09:57 +0100 <Guest41> Shit, my Applicative Tree Fullfills these Laws so far
2022-12-30 17:10:03 +0100 <Guest41> (first 3)
2022-12-30 17:12:30 +0100ddellacosta(~ddellacos@143.244.47.68) (Ping timeout: 260 seconds)
2022-12-30 17:12:31 +0100ratapaca(~ratapaca@98.40.240.33) (Quit: Leaving)
2022-12-30 17:13:08 +0100jakalx(~jakalx@base.jakalx.net) (Error from remote client)
2022-12-30 17:15:21 +0100jakalx(~jakalx@base.jakalx.net)
2022-12-30 17:16:42 +0100briandaed(~briandaed@185.234.210.211.r.toneticgroup.pl)
2022-12-30 17:19:37 +0100ddellacosta(~ddellacos@143.244.47.68)
2022-12-30 17:20:12 +0100acidjnk(~acidjnk@p200300d6e7137a73b4a4bff990465aaa.dip0.t-ipconnect.de)
2022-12-30 17:21:06 +0100Guest41(~Guest41@ip-084-118-041-183.um23.pools.vodafone-ip.de) (Quit: Ping timeout (120 seconds))
2022-12-30 17:21:16 +0100Guest41(~Guest41@ip-084-118-041-183.um23.pools.vodafone-ip.de)
2022-12-30 17:21:20 +0100tose(~tose@cst-prg-38-106.cust.vodafone.cz)
2022-12-30 17:21:45 +0100 <Guest41> I don't like the fact, that I am Fullfilling all 4 rules without having known them
2022-12-30 17:22:48 +0100 <Guest41> Its frightening
2022-12-30 17:22:52 +0100Vajb(~Vajb@hag-jnsbng11-58c3a5-27.dhcp.inet.fi) (Read error: Connection reset by peer)
2022-12-30 17:25:47 +0100ddellacosta(~ddellacos@143.244.47.68) (Ping timeout: 248 seconds)
2022-12-30 17:26:17 +0100mei(~mei@user/mei)
2022-12-30 17:26:32 +0100 <Guest41> I now have the follwing definition for applicative:
2022-12-30 17:26:32 +0100 <Guest41> ma >>= (\a -> mf >>= (\ f -> return (f a)))
2022-12-30 17:26:33 +0100 <Guest41> Somehow it is different to:
2022-12-30 17:26:33 +0100 <Guest41> mf >>= (\f -> ma >>= (\ a -> return (f a)))
2022-12-30 17:26:34 +0100 <Guest41> Is that bad?
2022-12-30 17:28:03 +0100Vajb(~Vajb@2001:999:405:5eb2:8d39:b832:a9ee:9bdf)
2022-12-30 17:28:52 +0100gnalzocan't imagine a good definition for applicative Tree
2022-12-30 17:30:29 +0100morb(~morb@pool-72-80-94-112.nycmny.fios.verizon.net)
2022-12-30 17:31:49 +0100 <Guest41> Well, If I apply a tree of Functions to a Node with a single value, it gets the tree of functions each applied to the value.
2022-12-30 17:31:49 +0100 <Guest41> If I apply a Node with a single Function to a tree, it applies this function to every value at its own...
2022-12-30 17:31:50 +0100 <Guest41> The other cases... well I don't know whats happening there either, but it is happening
2022-12-30 17:32:59 +0100 <Guest41> I am going to check whether the third monads rule holds true, but then it should be fine
2022-12-30 17:33:24 +0100danza(~francesco@151.35.209.134)
2022-12-30 17:33:36 +0100thongpv87(~thongpv87@2402:9d80:3db:44f4:3a10:72cf:c3cd:6f03) (Read error: Connection reset by peer)
2022-12-30 17:34:37 +0100justsomeguy(~justsomeg@user/justsomeguy)
2022-12-30 17:34:56 +0100morb(~morb@pool-72-80-94-112.nycmny.fios.verizon.net) (Ping timeout: 252 seconds)
2022-12-30 17:35:40 +0100pavonia(~user@user/siracusa) (Quit: Bye!)
2022-12-30 17:36:40 +0100 <mauke[m]> one of those applies effects backwards
2022-12-30 17:36:47 +0100tjakway(~tjakway@cpe-107-184-74-161.socal.res.rr.com)
2022-12-30 17:36:57 +0100 <mauke[m]> in terms of trees it probably affects the nesting structure if I had to guess
2022-12-30 17:37:36 +0100 <mauke[m]> also, if you already have a Monad instance, (<*>) = ap
2022-12-30 17:37:38 +0100 <mauke[m]> :t ap
2022-12-30 17:37:39 +0100 <lambdabot> Monad m => m (a -> b) -> m a -> m b
2022-12-30 17:38:47 +0100 <geekosaur> (if you're wondering, `ap` exists because `Monad` predates the idea of `Applicative` by around a decade
2022-12-30 17:38:48 +0100 <geekosaur> )
2022-12-30 17:39:20 +0100 <Guest41> Makes sense, though how is it defined?
2022-12-30 17:39:36 +0100 <Guest41> I cant get the third rule to calculate
2022-12-30 17:39:41 +0100 <geekosaur> @src ap
2022-12-30 17:39:41 +0100 <lambdabot> ap = liftM2 id
2022-12-30 17:39:48 +0100 <geekosaur> @src liftM2
2022-12-30 17:39:48 +0100 <lambdabot> liftM2 f m1 m2 = do
2022-12-30 17:39:48 +0100 <lambdabot> x1 <- m1
2022-12-30 17:39:48 +0100 <lambdabot> x2 <- m2
2022-12-30 17:39:48 +0100 <lambdabot> return (f x1 x2)
2022-12-30 17:42:06 +0100econo(uid147250@user/econo)
2022-12-30 17:42:32 +0100 <geekosaur> this imposes an unnecessary relationship between `m1` and `m2` because it's `Monad`; a proper `Applicative` definition (`liftA2` and `<*>`) wouldn't
2022-12-30 17:43:17 +0100 <Guest41> Would this be equal to one of these? [17:26:32] <Guest41> ma >>= (\a -> mf >>= (\ f -> return (f a)))
2022-12-30 17:43:17 +0100 <Guest41> [17:26:32] <Guest41> mf >>= (\f -> ma >>= (\ a -> return (f a)))
2022-12-30 17:43:41 +0100 <Guest41> Cause I don't get this definition
2022-12-30 17:43:50 +0100 <geekosaur> @do mf >>= (\f -> ma >>= (\ a -> return (f a)))
2022-12-30 17:43:51 +0100 <lambdabot> do { b <- mf; (\ f -> do { b <- ma; (\ a -> return (f a)) b}) b}
2022-12-30 17:44:02 +0100 <mauke[m]> boo
2022-12-30 17:44:09 +0100 <geekosaur> yeh
2022-12-30 17:44:23 +0100 <mauke[m]> @do mf >>= \f -> ma >>= \a -> return (f a)
2022-12-30 17:44:23 +0100 <lambdabot> do { f <- mf; a <- ma; return (f a)}
2022-12-30 17:45:44 +0100 <Guest41> @do ma >>= \a -> mf >>= \f -> return (f a)
2022-12-30 17:45:44 +0100 <lambdabot> do { a <- ma; f <- mf; return (f a)}
2022-12-30 17:46:15 +0100 <Guest41> They seem to be equal, but I could swear the behave differently
2022-12-30 17:46:50 +0100justsomeguy(~justsomeg@user/justsomeguy) (Ping timeout: 246 seconds)
2022-12-30 17:47:25 +0100 <mauke[m]> they perform the actions/effects in a different order
2022-12-30 17:47:34 +0100 <Guest41> yeah
2022-12-30 17:47:52 +0100justsomeguy(~justsomeg@user/justsomeguy)
2022-12-30 17:48:02 +0100 <Guest41> :t m >>= (\x -> k x >>= h) = (m >>= k) >>= h
2022-12-30 17:48:03 +0100 <lambdabot> error: parse error on input ‘=’
2022-12-30 17:48:11 +0100 <Guest41> :t m >>= (\x -> k x >>= h)
2022-12-30 17:48:12 +0100 <lambdabot> error:
2022-12-30 17:48:12 +0100 <lambdabot> • Couldn't match expected type ‘m t0’ with actual type ‘Expr’
2022-12-30 17:48:12 +0100 <lambdabot> • In the first argument of ‘(>>=)’, namely ‘m’
2022-12-30 17:48:28 +0100 <Guest41> :t f m k h = m >>= (\x -> k x >>= h)
2022-12-30 17:48:29 +0100 <lambdabot> error: parse error on input ‘=’
2022-12-30 17:48:40 +0100 <mauke[m]> :t \m k h -> m >>= (\x -> k x >>= h)
2022-12-30 17:48:41 +0100 <lambdabot> Monad m => m t -> (t -> m a) -> (a -> m b) -> m b
2022-12-30 17:48:51 +0100 <Guest41> thanks
2022-12-30 17:49:04 +0100 <mauke[m]> alternatively ...
2022-12-30 17:49:18 +0100 <mauke[m]> :t ?m >>= (\x -> ?k x >>= ?h)
2022-12-30 17:49:19 +0100 <lambdabot> (Monad m, ?h::a -> m b, ?k::t -> m a, ?m::m t) => m b
2022-12-30 17:51:32 +0100danza(~francesco@151.35.209.134) (Quit: Leaving)
2022-12-30 17:52:15 +0100justsomeguy(~justsomeg@user/justsomeguy) (Ping timeout: 252 seconds)
2022-12-30 17:52:22 +0100jakalx(~jakalx@base.jakalx.net) (Error from remote client)
2022-12-30 17:53:02 +0100justsomeguy(justsomegu@user/justsomeguy)
2022-12-30 17:56:38 +0100 <Guest41> Well my Monad Tree also fullfills the rules of Monads, well
2022-12-30 17:57:43 +0100 <mauke[m]> btw, sometimes it's easier to think about the Monad interface not in terms of return/>>=, but in terms of return/fmap/join
2022-12-30 17:57:56 +0100 <mauke[m]> fmap is also known as liftM and liftA
2022-12-30 17:58:05 +0100jakalx(~jakalx@base.jakalx.net)
2022-12-30 17:58:40 +0100 <Guest41> Huhh, fmap and join
2022-12-30 17:58:41 +0100 <Guest41> I can't join my trees can I?
2022-12-30 17:59:16 +0100 <Guest41> @src liftM
2022-12-30 17:59:16 +0100 <lambdabot> liftM f m1 = do
2022-12-30 17:59:16 +0100 <lambdabot> x1 <- m1
2022-12-30 17:59:16 +0100 <lambdabot> return (f x1)
2022-12-30 18:00:39 +0100freeside(~mengwong@103.252.202.159)
2022-12-30 18:01:08 +0100 <mauke[m]> if they're monads, you can
2022-12-30 18:01:25 +0100justsomeguy(justsomegu@user/justsomeguy) (Ping timeout: 252 seconds)
2022-12-30 18:01:27 +0100 <mauke[m]> basically, you need to be able to turn Tree (Tree a) into Tree a
2022-12-30 18:02:14 +0100morb(~morb@pool-72-80-94-112.nycmny.fios.verizon.net)
2022-12-30 18:03:22 +0100justsomeguy(~justsomeg@user/justsomeguy)
2022-12-30 18:05:05 +0100freeside(~mengwong@103.252.202.159) (Ping timeout: 252 seconds)
2022-12-30 18:05:45 +0100 <Guest41> Ah, I see... I think I added that in <*> somehwere...
2022-12-30 18:05:46 +0100 <Guest41> I think i am folding it from the Leafs upwards and say
2022-12-30 18:05:46 +0100 <Guest41> tree a subTrees        is joined together with            ListOfTrees                    as                              tree a (subTrees ++ ListOfTrees)
2022-12-30 18:06:19 +0100 <Guest41> @src mfilter
2022-12-30 18:06:19 +0100 <lambdabot> Source not found. That's something I cannot allow to happen.
2022-12-30 18:06:42 +0100igghibu(~igghibu@37.120.201.86)
2022-12-30 18:06:51 +0100morb(~morb@pool-72-80-94-112.nycmny.fios.verizon.net) (Ping timeout: 260 seconds)
2022-12-30 18:07:49 +0100 <Guest41> @do p  >>= f
2022-12-30 18:07:49 +0100 <lambdabot> do { a <- p�; f a}
2022-12-30 18:08:20 +0100yahb2(~yahb2@2a01:4f8:c0c:5c7b::2) (Remote host closed the connection)
2022-12-30 18:08:23 +0100 <mauke[m]> @src join
2022-12-30 18:08:23 +0100 <lambdabot> join x = x >>= id
2022-12-30 18:08:42 +0100yahb2(~yahb2@2a01:4f8:c0c:5c7b::2)
2022-12-30 18:08:44 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 260 seconds)
2022-12-30 18:09:34 +0100 <Guest41> join just puts x into the identity? :D
2022-12-30 18:09:35 +0100 <Guest41> But yes I think I understand
2022-12-30 18:10:37 +0100 <geekosaur> as defined in Haskell. mathematically fmap and join are the key operations, but in Haskell >>= is more useful so we reconstruct join from it
2022-12-30 18:11:59 +0100 <Guest41> I see I see
2022-12-30 18:12:06 +0100 <mauke[m]> another way to look at it: join mmx = do { mx <- mmx; x <- mx; return x }
2022-12-30 18:12:37 +0100 <mauke[m]> but the last part, x <- mx; return x, can be simplified to just mx
2022-12-30 18:12:41 +0100 <mauke[m]> due to laws or something
2022-12-30 18:13:10 +0100 <Guest41> In mfilter:
2022-12-30 18:13:10 +0100 <Guest41> mfilter p ma = do
2022-12-30 18:13:11 +0100 <mauke[m]> @undo do { mx <- mmx; mx }
2022-12-30 18:13:11 +0100 <lambdabot> mmx >>= \ mx -> mx
2022-12-30 18:13:11 +0100 <Guest41>   a <- ma
2022-12-30 18:13:11 +0100 <Guest41>   if p a then return a else mzero
2022-12-30 18:13:12 +0100 <Guest41> How does "p a" evaluate to a boolean?
2022-12-30 18:13:29 +0100 <mauke[m]> and \mx -> mx is the identity function
2022-12-30 18:13:46 +0100 <mauke[m]> presumably because 'p' is a function that returns Bool?
2022-12-30 18:14:52 +0100 <Guest41> I think I don't get how ma is "unpacked"
2022-12-30 18:15:02 +0100 <geekosaur> yeh, the whole point of (m)filter is you pass it a predicate `x -> Bool` where (for mfilter) `x` is the type of `a`
2022-12-30 18:15:36 +0100 <Guest41> @undo do {a <- ma; p a }
2022-12-30 18:15:36 +0100 <lambdabot> ma >>= \ a -> p a
2022-12-30 18:16:09 +0100 <Guest41> It all boils down to >>= doesnt it
2022-12-30 18:16:22 +0100igghibu(~igghibu@37.120.201.86) (Quit: igghibu)
2022-12-30 18:17:24 +0100 <geekosaur> that's why it's mfilter instead of filter
2022-12-30 18:18:20 +0100 <Guest41> But >>= returns a Monoid as result
2022-12-30 18:18:21 +0100 <Guest41> Thats unequal to bool isn't it?
2022-12-30 18:20:20 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net)
2022-12-30 18:20:29 +0100 <geekosaur> but we're not using the result of >>= as a Bool, we are applying the function passed to mfilter to get a Bool
2022-12-30 18:20:51 +0100 <geekosaur> (a selection function which returns True if the value it's passed is one we want)
2022-12-30 18:21:50 +0100 <Guest41> mfilter:
2022-12-30 18:21:50 +0100 <Guest41> mfilter p ma = do
2022-12-30 18:21:51 +0100 <Guest41>   a <- ma
2022-12-30 18:21:51 +0100 <Guest41>   if p a then return a else mzero
2022-12-30 18:21:52 +0100 <Guest41> mfilter rewritten:?
2022-12-30 18:21:52 +0100 <Guest41> mfilter p ma = if ma >>= p then return ?????? else mzero
2022-12-30 18:22:13 +0100 <geekosaur> wrong rewrite
2022-12-30 18:22:21 +0100 <monochrom> No. ma >>= \a -> if p a then ... else ...
2022-12-30 18:22:30 +0100 <Guest41> Yeah, I guessed, but I don't see the mistake :D
2022-12-30 18:23:16 +0100 <monochrom> Or, you already know how to use @undo
2022-12-30 18:23:46 +0100 <geekosaur> with your version, p would need to have type `a -> m b`, not `a -> Bool`
2022-12-30 18:23:51 +0100 <mauke[m]> @undo do { a <- ma; if p a then return a else mzero }
2022-12-30 18:23:51 +0100 <lambdabot> ma >>= \ a -> if p a then return a else mzero
2022-12-30 18:24:35 +0100 <Guest41> I see I only "undid" the part up to the if
2022-12-30 18:24:53 +0100 <mauke[m]> you can't just >>= into p because p has the wrong type for that
2022-12-30 18:25:01 +0100 <mauke[m]> and you can't use >>= as the condition in 'if' because >>= has the wrong type for that
2022-12-30 18:25:20 +0100 <mauke[m]> if is normal expression syntax; it is unrelated to do notation
2022-12-30 18:25:49 +0100 <Guest41> Also confusing that "return" wraps the value back into the Monoid... I always just think it returns from the function
2022-12-30 18:26:05 +0100 <mauke[m]> wait, there was a Monoid?
2022-12-30 18:26:10 +0100 <Guest41> "Monad"
2022-12-30 18:26:23 +0100 <monochrom> This is why we use "pure" instead.
2022-12-30 18:26:36 +0100 <Guest41> yes, pure makes so much more sense lmao
2022-12-30 18:26:41 +0100 <mauke[m]> yeah, I was about to say. Monoids are much simpler :-)
2022-12-30 18:26:45 +0100 <monochrom> In your career later you will find that all names are meaningless.
2022-12-30 18:28:09 +0100 <Guest41> "In my career"
2022-12-30 18:30:20 +0100califax(~califax@user/califx) (Ping timeout: 255 seconds)
2022-12-30 18:31:02 +0100 <Guest41> However I think I now understand how I used "mfilter" on my Tree :D
2022-12-30 18:31:02 +0100 <Guest41> It all started yesterday when I thought: "Why not derive Foldable, instead of implementing my own to List".
2022-12-30 18:31:03 +0100 <Guest41> And where am I now? Implementing weird Monads to use predefined filter functions instead of just redefining them
2022-12-30 18:31:35 +0100tose(~tose@cst-prg-38-106.cust.vodafone.cz) (Ping timeout: 246 seconds)
2022-12-30 18:32:19 +0100califax(~califax@user/califx)
2022-12-30 18:34:15 +0100wroathe(~wroathe@207-153-38-140.fttp.usinternet.com)
2022-12-30 18:34:15 +0100wroathe(~wroathe@207-153-38-140.fttp.usinternet.com) (Changing host)
2022-12-30 18:34:15 +0100wroathe(~wroathe@user/wroathe)
2022-12-30 18:36:27 +0100Cybro(~Cybro@cpc83049-enfi23-2-0-cust89.20-2.cable.virginm.net)
2022-12-30 18:36:57 +0100sammelweis(~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.)
2022-12-30 18:38:45 +0100sammelweis(~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10)
2022-12-30 18:40:46 +0100 <Guest41> Can someone explain me the "<" operator?
2022-12-30 18:40:46 +0100 <Guest41> As in <* is somehow defined and <*> is something different and such
2022-12-30 18:40:54 +0100 <Guest41> Or give me a link?
2022-12-30 18:41:27 +0100 <mizlan> there are conventions for what they mean but there is no perfect rule or explanation
2022-12-30 18:42:09 +0100 <mizlan> if you look at their type signatures in ghci that should give you a good clue
2022-12-30 18:42:11 +0100Cybro(~Cybro@cpc83049-enfi23-2-0-cust89.20-2.cable.virginm.net) (Changing host)
2022-12-30 18:42:11 +0100Cybro(~Cybro@user/Cybro)
2022-12-30 18:42:27 +0100 <mauke[m]> @src <*
2022-12-30 18:42:27 +0100 <lambdabot> (<*) = liftA2 const
2022-12-30 18:42:46 +0100 <Guest41> Again this wird lift operator
2022-12-30 18:42:49 +0100 <mauke[m]> @src liftA2
2022-12-30 18:42:49 +0100 <lambdabot> liftA2 f a b = f <$> a <*> b
2022-12-30 18:43:16 +0100 <Guest41> @src <$>
2022-12-30 18:43:16 +0100 <lambdabot> f <$> a = fmap f a
2022-12-30 18:43:17 +0100 <mauke[m]> thus (<*) = \a b -> const <$> a <*> b
2022-12-30 18:44:02 +0100 <mauke[m]> thus `(<*) = \a b -> fmap const a <*> b`
2022-12-30 18:44:41 +0100Cybro(~Cybro@user/Cybro) (Quit: Leaving)
2022-12-30 18:45:00 +0100Cybro(~Cybro@cpc83049-enfi23-2-0-cust89.20-2.cable.virginm.net)
2022-12-30 18:45:20 +0100Cybro(~Cybro@cpc83049-enfi23-2-0-cust89.20-2.cable.virginm.net) (Changing host)
2022-12-30 18:45:20 +0100Cybro(~Cybro@user/Cybro)
2022-12-30 18:45:29 +0100 <Guest41> @src const
2022-12-30 18:45:29 +0100 <lambdabot> const x _ = x
2022-12-30 18:45:51 +0100Cybro(~Cybro@user/Cybro) ()
2022-12-30 18:45:55 +0100 <mauke[m]> in monadic terms, `do { a <- ma; _ <- mb; pure a }`
2022-12-30 18:46:58 +0100 <EvanR> the types for <* and <*> kind of explain it
2022-12-30 18:47:04 +0100 <EvanR> :t (<*>)
2022-12-30 18:47:05 +0100 <lambdabot> Applicative f => f (a -> b) -> f a -> f b
2022-12-30 18:47:06 +0100 <EvanR> :t (<*)
2022-12-30 18:47:06 +0100Cybro(~Cybro@user/Cybro)
2022-12-30 18:47:07 +0100 <lambdabot> Applicative f => f a -> f b -> f a
2022-12-30 18:47:13 +0100 <EvanR> the b is discarded
2022-12-30 18:47:44 +0100 <EvanR> :t liftA2
2022-12-30 18:47:45 +0100 <lambdabot> Applicative f => (a -> b -> c) -> f a -> f b -> f c
2022-12-30 18:47:50 +0100 <EvanR> b is used
2022-12-30 18:48:48 +0100 <Guest41> Why would you ever use "<*"?
2022-12-30 18:49:51 +0100 <Guest41> @src liftA2
2022-12-30 18:49:51 +0100 <lambdabot> liftA2 f a b = f <$> a <*> b
2022-12-30 18:49:54 +0100 <geekosaur> it's useful in parsers, when you want to parse something followed by an end marker but discard the marker
2022-12-30 18:50:16 +0100 <geekosaur> (Applicative is really nice for parsers)
2022-12-30 18:50:26 +0100 <Guest41> (and for trees)
2022-12-30 18:51:03 +0100 <monochrom> I use "x <* y" when I want "do { m <- x; y; pure m }"
2022-12-30 18:51:18 +0100 <mauke[m]> let's say you want to parse an expression in parentheses. that's basically just: `token '(' *> expr <* token ')'`
2022-12-30 18:51:57 +0100 <mauke[m]> if you wanted to do that by hand, you'd have to write `do { token '('; x <- expr; token ')'; return x }`
2022-12-30 18:52:12 +0100 <mauke[m]> i.e. manually saving/passing on the return value of expr
2022-12-30 18:52:21 +0100Cybro(~Cybro@user/Cybro) (Leaving)
2022-12-30 18:52:23 +0100ham(~ham@user/ham)
2022-12-30 18:52:44 +0100Cybro(~Cybro@cpc83049-enfi23-2-0-cust89.20-2.cable.virginm.net)
2022-12-30 18:52:53 +0100 <Guest41> what is token?
2022-12-30 18:52:56 +0100 <Guest41> :t token
2022-12-30 18:52:57 +0100 <lambdabot> error: Variable not in scope: token
2022-12-30 18:53:19 +0100 <monochrom> putStrLn "please enter your password" *> getLine <* putStrLn "thank you"
2022-12-30 18:53:58 +0100 <Guest41> So the getLine isn't printed?
2022-12-30 18:54:12 +0100 <mauke[m]> a hypothetical parser function
2022-12-30 18:54:22 +0100wroathe(~wroathe@user/wroathe) (Ping timeout: 252 seconds)
2022-12-30 18:54:29 +0100 <Guest41> I didn't deal with IO in Haskell like at all
2022-12-30 18:54:41 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Quit: mizlan)
2022-12-30 18:54:54 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net)
2022-12-30 18:54:55 +0100 <mauke[m]> to make this work in practice, you'd probably have to define something like: `token c = char c <* whitespace`
2022-12-30 18:54:57 +0100 <geekosaur> in parsec we'd write `char` instead of `token`, but each parser library has its own way of doing things
2022-12-30 18:55:35 +0100Cybro(~Cybro@cpc83049-enfi23-2-0-cust89.20-2.cable.virginm.net) (Client Quit)
2022-12-30 18:56:14 +0100 <EvanR> Guest41, <* is similar to >>. Effects yes but discard the result
2022-12-30 18:56:23 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Client Quit)
2022-12-30 18:56:24 +0100 <mauke[m]> I'm not sure what you mean by "getLine isn't printed"; getLine simply reads a line of input
2022-12-30 18:56:36 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net)
2022-12-30 18:56:39 +0100CiaoSen(~Jura@p200300c9571bac002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
2022-12-30 18:56:49 +0100Cybro(~Cybro@user/Cybro)
2022-12-30 18:56:52 +0100 <EvanR> :t (>>)
2022-12-30 18:56:54 +0100 <lambdabot> Monad m => m a -> m b -> m b
2022-12-30 18:56:55 +0100 <monochrom> This is what happens when you ask "when is it useful?" prematurely.
2022-12-30 18:57:33 +0100 <EvanR> I'm still waiting for 99.99% of math to become useful xD
2022-12-30 18:57:58 +0100 <geekosaur> may be a long wait 🙂
2022-12-30 18:58:27 +0100 <Guest41> Well most of maths already is used, just no on notices
2022-12-30 18:58:46 +0100 <Guest41> @src >>
2022-12-30 18:58:46 +0100 <lambdabot> m >> k = m >>= \_ -> k
2022-12-30 18:58:47 +0100 <monochrom> There is some chance all of math will be useful but at the same time at every moment 99.99% of math is not yet useful.
2022-12-30 18:59:17 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Client Quit)
2022-12-30 18:59:21 +0100 <EvanR> the a is discarded
2022-12-30 18:59:57 +0100 <monochrom> In the same way that suppose you have a thread that adds elements to a queue quickly and another thread that takes elements slowly, every element will be taken eventually, but at every moment it looks like the queue is growing.
2022-12-30 18:59:57 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net)
2022-12-30 18:59:58 +0100 <geekosaur> this is most useful when the a is useless, for example putStrLn produces IO () because there's nothing useful to return
2022-12-30 19:00:04 +0100 <geekosaur> so we use >> with it
2022-12-30 19:00:10 +0100inversed(~inversed@bcdcac82.skybroadband.com) (Read error: Connection reset by peer)
2022-12-30 19:00:31 +0100 <geekosaur> or *> as shown earlier, which is the same thing (discards its left result)
2022-12-30 19:00:43 +0100 <monochrom> See also https://www.youtube.com/watch?v=M4f_D17zIBw
2022-12-30 19:00:46 +0100titibandit(~titibandi@xdsl-89-0-163-79.nc.de) (Ping timeout: 272 seconds)
2022-12-30 19:02:13 +0100Cybro(~Cybro@user/Cybro) (Leaving)
2022-12-30 19:02:53 +0100titibandit(~titibandi@xdsl-89-0-163-79.nc.de)
2022-12-30 19:03:55 +0100inversed(~inversed@bcdcac82.skybroadband.com)
2022-12-30 19:04:05 +0100 <Guest41> @src >>
2022-12-30 19:04:05 +0100 <lambdabot> m >> k = m >>= \_ -> k
2022-12-30 19:04:09 +0100 <Guest41> @src *>
2022-12-30 19:04:09 +0100 <lambdabot> (*>) = liftA2 (const id)
2022-12-30 19:04:26 +0100 <Guest41> isn't *> and >> just the same?
2022-12-30 19:04:36 +0100 <EvanR> go back to the types
2022-12-30 19:04:38 +0100 <geekosaur[m]> one defined via Monad, the other defined via Applicative
2022-12-30 19:04:43 +0100 <Guest41> :t >>
2022-12-30 19:04:44 +0100 <lambdabot> error: parse error on input ‘>>’
2022-12-30 19:04:45 +0100 <EvanR> :t (>>)
2022-12-30 19:04:46 +0100 <lambdabot> Monad m => m a -> m b -> m b
2022-12-30 19:04:48 +0100 <EvanR> :t (*>)
2022-12-30 19:04:49 +0100 <lambdabot> Applicative f => f a -> f b -> f b
2022-12-30 19:05:00 +0100 <EvanR> *> works even if f is not a Monad
2022-12-30 19:05:02 +0100 <Guest41> But It does the same?
2022-12-30 19:05:08 +0100 <EvanR> yeah
2022-12-30 19:05:49 +0100 <Guest41> But Monads are older, so the feature is duplicate?
2022-12-30 19:06:09 +0100 <EvanR> >> is redundant now, technically
2022-12-30 19:06:30 +0100 <Guest41> :thumbsup:
2022-12-30 19:07:48 +0100 <geekosaur[m]> there are some things that are `Applicative` but not `Monad` (`ZipList`, `Concurrent`) so you must use `*>` with those. with `Monad` you can use either as they are by definition the same
2022-12-30 19:09:05 +0100 <Guest41> Makes sense...
2022-12-30 19:09:06 +0100 <Guest41> The difference to "const is", that const doesn't even evaluete its second operand?
2022-12-30 19:09:11 +0100 <Guest41> :t const
2022-12-30 19:09:12 +0100 <lambdabot> a -> b -> a
2022-12-30 19:09:22 +0100 <Guest41> And doesn't need Monads
2022-12-30 19:09:28 +0100 <Guest41> appearantly
2022-12-30 19:09:32 +0100acidjnk(~acidjnk@p200300d6e7137a73b4a4bff990465aaa.dip0.t-ipconnect.de) (Ping timeout: 252 seconds)
2022-12-30 19:10:36 +0100 <monochrom> It is very easy to observe that x <* y is different from const x y.
2022-12-30 19:10:37 +0100 <gnalzo> const is a function not related to Monad, nor to Applicative, even.
2022-12-30 19:10:48 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 260 seconds)
2022-12-30 19:11:14 +0100 <monochrom> For example [4] <* [1,2] vs const [4] [1,2]
2022-12-30 19:11:39 +0100 <monochrom> For example Just 4 <* Nothing vs const (Just 4) Nothing
2022-12-30 19:11:42 +0100bitdex(~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection)
2022-12-30 19:11:50 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net)
2022-12-30 19:11:51 +0100 <monochrom> I'm sure you can also find examples in your Tree monad.
2022-12-30 19:12:12 +0100 <monochrom> tree1 <* tree2 vs const tree1 tree2
2022-12-30 19:12:24 +0100 <Guest41> Wait, so <* does't really discard the second input?
2022-12-30 19:12:47 +0100 <monochrom> That can also be answered by trying those examples.
2022-12-30 19:13:02 +0100bjourne(~bjorn@94.191.136.87.mobile.tre.se) (Read error: Connection reset by peer)
2022-12-30 19:13:05 +0100 <monochrom> Observe concrete examples. Don't write words.
2022-12-30 19:13:06 +0100Neuromancer(~Neuromanc@user/neuromancer) (Remote host closed the connection)
2022-12-30 19:13:33 +0100bitdex(~bitdex@gateway/tor-sasl/bitdex)
2022-12-30 19:13:40 +0100 <Guest41> I did the examples and was suprised by the result
2022-12-30 19:14:13 +0100 <monochrom> This is why when I teach this I just write "x <* y = liftA2 (\a b -> a) x y".
2022-12-30 19:14:23 +0100 <geekosaur[m]> there is a difference between discarding a value, and performing the value as an action while discarding the result
2022-12-30 19:14:34 +0100 <Guest41> @src liftA2
2022-12-30 19:14:34 +0100 <lambdabot> liftA2 f a b = f <$> a <*> b
2022-12-30 19:15:54 +0100 <monochrom> I don't explain it in words, I just give the formula. Students already know liftA2.
2022-12-30 19:16:15 +0100 <Guest41> Well we barely now map and filter
2022-12-30 19:16:33 +0100 <Guest41> But map and filter are kinda boring
2022-12-30 19:17:02 +0100 <Guest41> So I get myself headaches with Monads :D
2022-12-30 19:18:16 +0100 <Guest41> x <* y = fmap (\a b -> a) (x <*> y)
2022-12-30 19:18:16 +0100 <Guest41> ???
2022-12-30 19:18:23 +0100 <Guest41> :t <*>
2022-12-30 19:18:24 +0100 <lambdabot> error: parse error on input ‘<*>’
2022-12-30 19:18:29 +0100 <Guest41> :t (<*>)
2022-12-30 19:18:31 +0100 <lambdabot> Applicative f => f (a -> b) -> f a -> f b
2022-12-30 19:18:38 +0100hamhamster
2022-12-30 19:18:57 +0100 <monochrom> You probably didn't know that "f <$> a <*> b" means "(f <$> a) <*> b"
2022-12-30 19:20:17 +0100 <Guest41> x <* y = (fmap (\a b -> a) x ) <*> y)
2022-12-30 19:20:18 +0100 <Guest41> = (fmap \b -> x) <*> y
2022-12-30 19:20:18 +0100 <Guest41> ???
2022-12-30 19:21:16 +0100 <mauke[m]> that doesn't look right
2022-12-30 19:21:28 +0100 <Guest41> Ah stupid me
2022-12-30 19:21:37 +0100 <mauke[m]> `fmap (\a b -> a) x` means `(fmap (\a b -> a)) x`
2022-12-30 19:21:52 +0100 <mauke[m]> you can't just reduce the lambda with the x
2022-12-30 19:21:59 +0100 <Guest41> @src fmap
2022-12-30 19:21:59 +0100 <lambdabot> Source not found. You untyped fool!
2022-12-30 19:22:07 +0100 <Guest41> @src (fmap)
2022-12-30 19:22:07 +0100 <lambdabot> Source not found. My mind is going. I can feel it.
2022-12-30 19:22:10 +0100unit73e(~emanuel@2001:818:e8dd:7c00:656:e5ff:fe72:9d36)
2022-12-30 19:22:11 +0100 <mauke[m]> that's a method of Functor
2022-12-30 19:22:28 +0100 <gnalzo> @src (<<$>)
2022-12-30 19:22:28 +0100 <lambdabot> Source not found. My pet ferret can type better than you!
2022-12-30 19:22:41 +0100 <unit73e> working on a RGSS decrypt so for RPGMaker VX and friends: https://gitlab.com/unit73e/rgss-archive
2022-12-30 19:22:41 +0100shapr(~user@68.54.166.125) (Read error: Connection reset by peer)
2022-12-30 19:22:44 +0100 <unit73e> it's still monkey code
2022-12-30 19:22:54 +0100shapr(~user@68.54.166.125)
2022-12-30 19:22:54 +0100 <unit73e> but it does work
2022-12-30 19:23:18 +0100 <mauke[m]> `class Functor f where { fmap :: (a -> b) -> f a -> f b }`
2022-12-30 19:23:22 +0100 <unit73e> it's not for illegal activities mind you, it's for personal translations
2022-12-30 19:24:04 +0100 <unit73e> interestingly rpg maker just serializes everything to ruby objects
2022-12-30 19:24:35 +0100 <Guest41> Is there a way to derive some kind of "fold" for a Tree by instanciating the right typeclasses
2022-12-30 19:24:35 +0100 <Guest41> (In a way it doesn't fold it as a List, but folds from the bottom upwards)?
2022-12-30 19:26:26 +0100 <unit73e> Guest41, idk, how do you expect it to work? traverse every element in order?
2022-12-30 19:26:29 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 252 seconds)
2022-12-30 19:26:54 +0100 <unit73e> because Tree is Traversable
2022-12-30 19:27:05 +0100 <unit73e> and Foldable
2022-12-30 19:27:15 +0100tremon(~tremon@83-85-213-108.cable.dynamic.v4.ziggo.nl)
2022-12-30 19:27:20 +0100 <Guest41> Something like:
2022-12-30 19:27:21 +0100 <Guest41> foldTree _ nilVal Nil = nilVal
2022-12-30 19:27:21 +0100 <Guest41> foldTree f nilVal (Node val forest) = f val (map (foldTree f nilVal) forest)
2022-12-30 19:27:22 +0100 <Guest41> But by using the right typeclass
2022-12-30 19:28:00 +0100 <unit73e> you can just use fold since Tree is Foldable
2022-12-30 19:28:00 +0100 <monochrom> Just write it yourself. Enough over-generalizations for a day.
2022-12-30 19:28:35 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net)
2022-12-30 19:29:28 +0100 <unit73e> to me that foldTree is just the regular fold
2022-12-30 19:29:34 +0100 <unit73e> no?
2022-12-30 19:30:01 +0100 <monochrom> And Data.Tree already has it as foldTree
2022-12-30 19:30:32 +0100 <Guest41> But Foldable destroys the structure before folding...
2022-12-30 19:30:33 +0100 <Guest41> You can't fold the tree in a string like " 3 -> [Subtrees Here]"
2022-12-30 19:31:22 +0100tose(~tose@cst-prg-38-106.cust.vodafone.cz)
2022-12-30 19:31:31 +0100 <unit73e> so you want a Tree to work as an actual tree? not a datastructure that is internally a tree?
2022-12-30 19:31:52 +0100 <unit73e> because trees are just fast lists, if you will
2022-12-30 19:32:06 +0100 <Guest41> But monochrom is probably right... that was enough for me today, just learned typeclasses this morning and I need to take some break....
2022-12-30 19:32:07 +0100 <Guest41> Will look at Data.Tree tomorrow as well, looks interesting
2022-12-30 19:32:27 +0100 <unit73e> yeah but just to give you a tip
2022-12-30 19:32:35 +0100 <unit73e> don't think of a tree as a real tree
2022-12-30 19:32:42 +0100 <Guest41> But it is a real Tree
2022-12-30 19:32:45 +0100 <unit73e> because then you're going to get into problems with what kind of tree
2022-12-30 19:32:50 +0100 <unit73e> red black tree?
2022-12-30 19:32:56 +0100 <unit73e> balanced tree?
2022-12-30 19:32:57 +0100 <unit73e> b+?
2022-12-30 19:33:14 +0100 <unit73e> it's a list, but the insertion order is sorted
2022-12-30 19:33:15 +0100 <unit73e> that's all
2022-12-30 19:33:22 +0100 <Guest41> Atleat mine is a Tree as in "Directed Acyclic Graph"
2022-12-30 19:33:57 +0100 <Guest41> Something like representing a directory Tree in
2022-12-30 19:34:15 +0100 <Guest41> like not a List which internally is a Tree, but just a Tree
2022-12-30 19:34:30 +0100 <unit73e> I see
2022-12-30 19:34:39 +0100 <Guest41> However: thanks all you helped me a ton :)
2022-12-30 19:35:11 +0100 <unit73e> you're right, it's a rose tree. silly me. ok but still, it does have what you want
2022-12-30 19:36:14 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 272 seconds)
2022-12-30 19:41:04 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net)
2022-12-30 19:45:34 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 260 seconds)
2022-12-30 19:48:54 +0100azimut(~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection)
2022-12-30 19:49:33 +0100azimut(~azimut@gateway/tor-sasl/azimut)
2022-12-30 19:50:19 +0100Guest41(~Guest41@ip-084-118-041-183.um23.pools.vodafone-ip.de) (Quit: Client closed)
2022-12-30 19:52:01 +0100tose(~tose@cst-prg-38-106.cust.vodafone.cz) (Ping timeout: 268 seconds)
2022-12-30 19:54:27 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net)
2022-12-30 19:54:44 +0100dsrt^(~dsrt@76.145.185.103) (Remote host closed the connection)
2022-12-30 19:57:46 +0100sammelweis(~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.)
2022-12-30 19:58:25 +0100 <Hecate> tcard: hi! hope you're having a good time in this end of the year. I'm exploring the automated generation of several markdown pages from several .lhs files using literatex, and I was wondering if a cabal project was adapted to drive the build, and if yes, if you had recommendations for this
2022-12-30 19:58:33 +0100titibandit(~titibandi@xdsl-89-0-163-79.nc.de) (Quit: Leaving.)
2022-12-30 19:59:38 +0100sammelweis(~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10)
2022-12-30 20:03:39 +0100slime(~slime@2603-9001-670a-9ce3-0000-0902-bb5b-0cd7.inf6.spectrum.com)
2022-12-30 20:04:53 +0100cheater_(~Username@user/cheater)
2022-12-30 20:05:04 +0100slime(~slime@2603-9001-670a-9ce3-0000-0902-bb5b-0cd7.inf6.spectrum.com) (Remote host closed the connection)
2022-12-30 20:07:43 +0100cheater(~Username@user/cheater) (Ping timeout: 260 seconds)
2022-12-30 20:07:50 +0100cheater_cheater
2022-12-30 20:08:03 +0100tzh(~tzh@c-24-21-73-154.hsd1.or.comcast.net)
2022-12-30 20:09:49 +0100cheater_(~Username@user/cheater)
2022-12-30 20:13:19 +0100cheater(~Username@user/cheater) (Ping timeout: 260 seconds)
2022-12-30 20:13:26 +0100cheater_cheater
2022-12-30 20:13:40 +0100stef204(~stef204@user/stef204)
2022-12-30 20:19:45 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:b011:11:9945:c47d)
2022-12-30 20:21:27 +0100 <fizbin> I've got a very weird double-encoded strangeness going on with haskell and windows terminal. I find it odd that no one has run across this before, but I'm unsuccessful at locating this bug via Google.
2022-12-30 20:21:58 +0100 <fizbin> I also find this bug sort of hard to believe. It's *really* weird.
2022-12-30 20:22:37 +0100jmdaemon(~jmdaemon@user/jmdaemon)
2022-12-30 20:22:54 +0100 <Rembane> fizbin: How to reproduce the bug?
2022-12-30 20:24:05 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:b011:11:9945:c47d) (Ping timeout: 255 seconds)
2022-12-30 20:24:23 +0100acidjnk(~acidjnk@p200300d6e7137a73b4a4bff990465aaa.dip0.t-ipconnect.de)
2022-12-30 20:31:54 +0100stef204(~stef204@user/stef204) (Quit: WeeChat 3.7.1)
2022-12-30 20:32:11 +0100 <fizbin> Rembrane: 1) You need windows. 2) you need windows terminal. Then, a .hs file that says this will do it: main = putStrLn "\8226"
2022-12-30 20:32:20 +0100 <fizbin> See https://imgur.com/a/oJdsM2s
2022-12-30 20:32:53 +0100tjakway(~tjakway@cpe-107-184-74-161.socal.res.rr.com) (Quit: WeeChat 3.5)
2022-12-30 20:38:32 +0100 <fizbin> The basic issue is that in a windows terminal window with windows codepage 65001 set, when asking haskell to output the character U+2022 it apparently outputs the 6-byte sequence CE 93 C3 87 C3 B3. Windows terminal correctly displays this as ΓÇó
2022-12-30 20:38:32 +0100 <fizbin> (Greek capital gamma, Latin C cedilla, Latin o acute)
2022-12-30 20:38:33 +0100 <geekosaur[m]> fizbin, does anything change if you use --io-manager=native? (ghc 9.0+)
2022-12-30 20:38:39 +0100bjourne(~bjorn@94.191.136.145.mobile.tre.se)
2022-12-30 20:39:01 +0100 <geekosaur[m]> using the codepage causes various breakages and is disrecommended
2022-12-30 20:40:35 +0100 <fizbin> geekosaur[m], Where do I give that flag? runhaskell-9.4.2.exe --io-manager=native tmp.hs says "ghc-9.4.2.exe: unrecognised flag: --io-manager=native"
2022-12-30 20:40:59 +0100 <geekosaur[m]> RTS flag, iirc
2022-12-30 20:41:16 +0100 <geekosaur[m]> +RTS --io-manager=native -RTS
2022-12-30 20:43:55 +0100 <fizbin> It was accepted as an RTS flag. It didn't change anything.
2022-12-30 20:45:33 +0100 <geekosaur[m]> hrm
2022-12-30 20:45:55 +0100 <geekosaur[m]> Phyx- doesn't seem to be around in here, sadly
2022-12-30 20:46:09 +0100 <geekosaur[m]> probably the best person to talk to about Windows I/O issues
2022-12-30 20:46:38 +0100 <fizbin> Odd thing is that if you take the sequence (Greek capital gamma, Latin C cedilla, Latin o acute) and write it in windows codepage 437 (the native codepage on US English windows), you'd write that as the bytes E2 80 A2, which are the UTF-8 bytes for U+2022.
2022-12-30 20:46:54 +0100 <fizbin> That's what makes me say this is a double-encoding issue.
2022-12-30 20:47:27 +0100 <EvanR> windows isn't unicode still?
2022-12-30 20:47:46 +0100 <fizbin> For extra fun, the behavior on a cmd.exe window is different.
2022-12-30 20:47:56 +0100 <fizbin> EvanR: well....
2022-12-30 20:48:06 +0100 <EvanR> by windows terminal I thought you meant cmd.exe
2022-12-30 20:48:13 +0100 <geekosaur[m]> windows is unicode but requuires a completely different API for console unicode
2022-12-30 20:48:13 +0100 <monochrom> Windows is unicode, but windows console retains the codepage system.
2022-12-30 20:48:15 +0100 <fizbin> So, what part of windows?
2022-12-30 20:48:19 +0100 <geekosaur[m]> that's what the new io manager is about
2022-12-30 20:48:46 +0100 <monochrom> Hmm what if you're in powershell?
2022-12-30 20:49:15 +0100 <fizbin> monochrom: powershell invoked as itself, or from cmd?
2022-12-30 20:49:26 +0100 <monochrom> invoked as itself
2022-12-30 20:49:32 +0100cheater_(~Username@user/cheater)
2022-12-30 20:49:48 +0100 <fizbin> Powershell invoked as itself (modern versions) gets you the windows terminal window I was talking about initially.
2022-12-30 20:49:58 +0100 <monochrom> Ah OK.
2022-12-30 20:50:01 +0100 <geekosaur[m]> actually now I wonder if runhaskell needs to be invoked in a way that passes the RTS options on
2022-12-30 20:50:14 +0100 <geekosaur[m]> or use $GHCRTS, however you do that on Windows
2022-12-30 20:51:57 +0100 <fizbin> geekosaur[m]: Ah!
2022-12-30 20:52:12 +0100 <fizbin> Yes, passing the options on gets me something that seems to work.
2022-12-30 20:52:47 +0100 <monochrom> Wait, passing on to whom?
2022-12-30 20:53:02 +0100cheater(~Username@user/cheater) (Ping timeout: 246 seconds)
2022-12-30 20:53:18 +0100cheater_cheater
2022-12-30 20:53:25 +0100 <geekosaur[m]> runhaskell is a wrapper for ghc
2022-12-30 20:53:59 +0100 <geekosaur[m]> the hint there is ghc complaining about the --io-manager=native option passed directly instead of as an RTS option
2022-12-30 20:54:23 +0100 <geekosaur[m]> instead of runhaskell complaining about it
2022-12-30 20:55:36 +0100 <fizbin> So, I can't seem to pass --io-manager=native when using runhaskell, but if I compile it with ghc using -rtsopts then I can run it with +RTS --io-manager=native and it works.
2022-12-30 20:56:58 +0100 <geekosaur[m]> runhaskell --ghc-arg=+RTS --ghc-arg=--io-manager=native --ghc-arg=-RTS …
2022-12-30 20:57:01 +0100 <geekosaur[m]> …ick
2022-12-30 20:57:17 +0100 <fizbin> You'd think runhaskell-9.4.2.exe --ghc-arg=-with-rtsopts=--io-manager=native tmp.hs would work, but no.
2022-12-30 20:57:26 +0100 <geekosaur[m]> I think this is documented in the ghc manual somewhere
2022-12-30 20:58:35 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 246 seconds)
2022-12-30 20:59:17 +0100 <fizbin> Yeah, the three-ghc-arg thing worked.
2022-12-30 20:59:20 +0100 <geekosaur[m]> oh, apparently this should work too: runhaskell -- +RTS --io-manager=native -RTS …
2022-12-30 20:59:31 +0100 <geekosaur[m]> (note the --)
2022-12-30 21:00:11 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net)
2022-12-30 21:00:32 +0100 <fizbin> Nope, that (runhaskell-9.4.2.exe tmp.hs -- +RTS --io-manager=native -RTS) doesn't work.
2022-12-30 21:01:04 +0100 <geekosaur[m]> the -- and RTS opts have to come before the program name, according to the runhaskell manual
2022-12-30 21:01:46 +0100 <fizbin> Also no, but the error message is fun and different.
2022-12-30 21:01:57 +0100 <geekosaur[m]> interesting
2022-12-30 21:02:27 +0100 <fizbin> https://paste.tomsmeding.com/fOLcJq6o
2022-12-30 21:03:12 +0100 <monochrom> You need a second -- -_-
2022-12-30 21:03:28 +0100 <monochrom> runhaskell -- +RTS ... -RTS -- tmp.hs
2022-12-30 21:03:54 +0100 <monochrom> But I haven't tested it. I'm just marvelling at the complexity implied by the user guide...
2022-12-30 21:04:12 +0100pavonia(~user@user/siracusa)
2022-12-30 21:05:07 +0100 <geekosaur[m]> yeh
2022-12-30 21:05:49 +0100 <fizbin> monochrom: also no. Same error as without the second --
2022-12-30 21:08:26 +0100 <fizbin> https://paste.tomsmeding.com/1iuGVIih
2022-12-30 21:08:54 +0100 <fizbin> As you can see, the only thing that worked is the three-ghc-arg thing.
2022-12-30 21:10:27 +0100 <geekosaur[m]> oh, I see why that weirdness at the end, it's recommending `min' with ghc's usual fancy unicode quotes
2022-12-30 21:12:05 +0100 <fizbin> yeah.
2022-12-30 21:12:05 +0100bjourne(~bjorn@94.191.136.145.mobile.tre.se) (Read error: Connection reset by peer)
2022-12-30 21:12:46 +0100 <fizbin> Oddly enough, I did at one point do something that got a recommendation of "min" with the quotes correct, but I can't seem to reproduce that now.
2022-12-30 21:13:29 +0100 <geekosaur[m]> there's an option somewhere that turns off the unicode stuff in errors/warnings
2022-12-30 21:13:38 +0100 <geekosaur[m]> piping through a command might also do so
2022-12-30 21:14:54 +0100 <eldritchcookie[4> i was looking at graded and parametrized monads and ended finding this paper https://arxiv.org/pdf/2001.10274.pdf i mostly understand what is said but cannot understand the symbols where could i find these definitions. would learning category theory equip me with the knowledge to do so?
2022-12-30 21:15:28 +0100 <geekosaur[m]> one does not simply learn category theory…
2022-12-30 21:16:18 +0100ChaiTRex(~ChaiTRex@user/chaitrex) (Remote host closed the connection)
2022-12-30 21:16:54 +0100ChaiTRex(~ChaiTRex@user/chaitrex)
2022-12-30 21:21:49 +0100jmdaemon(~jmdaemon@user/jmdaemon) (Quit: ZNC 1.8.2 - https://znc.in)
2022-12-30 21:23:30 +0100jmdaemon(~jmdaemon@user/jmdaemon)
2022-12-30 21:25:38 +0100cheater_(~Username@user/cheater)
2022-12-30 21:26:32 +0100lortabac(~lortabac@2a01:e0a:541:b8f0:7b3b:ad71:81a3:47e4)
2022-12-30 21:26:53 +0100cheater__(~Username@user/cheater)
2022-12-30 21:27:27 +0100 <eldritchcookie[4> cool do you recommend any books for begginers?
2022-12-30 21:27:51 +0100 <Jadesheit[m]> https://github.com/hmemcpy/milewski-ctfp-pdf
2022-12-30 21:27:58 +0100 <Jadesheit[m]> This was a good read imo
2022-12-30 21:27:59 +0100cheater(~Username@user/cheater) (Ping timeout: 255 seconds)
2022-12-30 21:28:09 +0100cheater__cheater
2022-12-30 21:28:13 +0100 <Jadesheit[m]> s/imo/for me/
2022-12-30 21:29:58 +0100cheater_(~Username@user/cheater) (Ping timeout: 252 seconds)
2022-12-30 21:35:28 +0100CiaoSen(~Jura@p200300c9571bac002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 260 seconds)
2022-12-30 21:35:48 +0100jrm(~jrm@user/jrm) (Quit: ciao)
2022-12-30 21:36:08 +0100jrm(~jrm@user/jrm)
2022-12-30 21:36:38 +0100bitdex(~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 255 seconds)
2022-12-30 21:38:32 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2022-12-30 21:39:41 +0100bitdex(~bitdex@gateway/tor-sasl/bitdex)
2022-12-30 21:41:32 +0100titibandit(~titibandi@xdsl-89-0-163-79.nc.de)
2022-12-30 21:47:50 +0100trev(~trev@user/trev) (Remote host closed the connection)
2022-12-30 21:48:43 +0100bjourne(~bjorn@94.191.136.96.mobile.tre.se)
2022-12-30 21:53:03 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:b011:11:9945:c47d)
2022-12-30 21:57:52 +0100freeside(~mengwong@103.252.202.159)
2022-12-30 21:58:01 +0100sammelweis(~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.)
2022-12-30 21:59:18 +0100 <dmj`> eldritchcookie[4: there's #categorytheory as well
2022-12-30 21:59:18 +0100sammelweis(~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10)
2022-12-30 22:01:40 +0100mei(~mei@user/mei) (Quit: mei)
2022-12-30 22:01:56 +0100freeside(~mengwong@103.252.202.159) (Ping timeout: 246 seconds)
2022-12-30 22:08:15 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 260 seconds)
2022-12-30 22:08:17 +0100emmanuelux(~emmanuelu@user/emmanuelux)
2022-12-30 22:08:59 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net)
2022-12-30 22:10:00 +0100freeside(~mengwong@103.252.202.159)
2022-12-30 22:11:35 +0100 <unit73e> eldritchcookie[4, to me there was only one way to learn, just doing it
2022-12-30 22:12:13 +0100cods(~fred@82-65-232-44.subs.proxad.net) (Ping timeout: 260 seconds)
2022-12-30 22:12:26 +0100cods(~fred@82-65-232-44.subs.proxad.net)
2022-12-30 22:12:40 +0100 <unit73e> the biggest problem you will probably have is how to structure code with do blocks, monads, and applicatives
2022-12-30 22:12:59 +0100 <unit73e> at least that was the biggest one for me
2022-12-30 22:13:00 +0100beefbambi(~beefbambi@183.82.31.45)
2022-12-30 22:13:44 +0100 <unit73e> but once I got that monad is kind of like swithcing to the world of whatever type of monad you're working on, everything made sense
2022-12-30 22:13:57 +0100 <unit73e> other than that haskell is very simple
2022-12-30 22:14:19 +0100freeside(~mengwong@103.252.202.159) (Ping timeout: 260 seconds)
2022-12-30 22:15:25 +0100 <unit73e> I should probably switch to NixOS one of these days but I'm too lazy
2022-12-30 22:15:51 +0100sammelweis(~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.)
2022-12-30 22:16:58 +0100sammelweis(~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10)
2022-12-30 22:18:34 +0100 <jean-paul[m]> nixos is a good investment in future laziness
2022-12-30 22:18:44 +0100 <jean-paul[m]> not as good an investment as a hammock, but still
2022-12-30 22:23:25 +0100lortabac(~lortabac@2a01:e0a:541:b8f0:7b3b:ad71:81a3:47e4) (Quit: WeeChat 2.8)
2022-12-30 22:27:05 +0100wroathe(~wroathe@207-153-38-140.fttp.usinternet.com)
2022-12-30 22:27:05 +0100wroathe(~wroathe@207-153-38-140.fttp.usinternet.com) (Changing host)
2022-12-30 22:27:05 +0100wroathe(~wroathe@user/wroathe)
2022-12-30 22:32:26 +0100hgolden_(~hgolden@cpe-172-251-233-141.socal.res.rr.com) (Remote host closed the connection)
2022-12-30 22:35:21 +0100sammelweis(~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.)
2022-12-30 22:36:37 +0100sammelweis(~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10)
2022-12-30 22:37:38 +0100iqubic(~avi@2601:602:9502:c70:7d73:32ff:58fe:6d27) (Remote host closed the connection)
2022-12-30 22:41:48 +0100bjourne(~bjorn@94.191.136.96.mobile.tre.se) (Read error: Connection reset by peer)
2022-12-30 22:44:48 +0100briandaed(~briandaed@185.234.210.211.r.toneticgroup.pl) (Quit: leaving)
2022-12-30 22:46:24 +0100hgolden(~hgolden@cpe-172-251-233-141.socal.res.rr.com)
2022-12-30 22:48:50 +0100 <ggVGc> good investment for future need of storage space
2022-12-30 22:48:50 +0100Vajb(~Vajb@2001:999:405:5eb2:8d39:b832:a9ee:9bdf) (Read error: Connection reset by peer)
2022-12-30 22:49:35 +0100Vajb(~Vajb@hag-jnsbng11-58c3a5-27.dhcp.inet.fi)
2022-12-30 22:49:41 +0100 <Hecate> don't forget to use btrf + fs compression with zstd for your nix partition
2022-12-30 22:50:43 +0100 <geekosaur[m]> not that loading a bunch of stuff via flatpak is much better
2022-12-30 22:50:45 +0100 <ggVGc> unit73e: Haskell might be somewhat "simple", but I'd argue GHC with its extensions definitely are not
2022-12-30 22:51:09 +0100 <geekosaur[m]> I will note that that discussion started with things like parameterized monads
2022-12-30 22:51:23 +0100 <geekosaur[m]> (indexed monads, I assume)
2022-12-30 22:51:28 +0100 <ggVGc> especially since some of them even overlap in functionality?
2022-12-30 22:51:28 +0100 <geekosaur[m]> so we're already kinda not talking Haskell
2022-12-30 22:52:39 +0100 <geekosaur[m]> and for some of them the interactions aren't even known much less documented or standardized
2022-12-30 22:53:14 +0100 <geekosaur[m]> which is one reason this stuff hasn't been presented for standardization
2022-12-30 22:56:44 +0100bitdex(~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 255 seconds)
2022-12-30 22:57:21 +0100 <geekosaur[m]> hm, which also makes me think those symbols eldritch cookie was talking about might be type theory instead of category theory
2022-12-30 22:58:39 +0100beefbambi(~beefbambi@183.82.31.45) (Read error: Connection reset by peer)
2022-12-30 22:58:40 +0100 <eldritchcookie[4> they might be
2022-12-30 22:59:16 +0100bitdex(~bitdex@gateway/tor-sasl/bitdex)
2022-12-30 23:05:17 +0100ChaiTRex(~ChaiTRex@user/chaitrex) (Ping timeout: 255 seconds)
2022-12-30 23:05:54 +0100ChaiTRex(~ChaiTRex@user/chaitrex)
2022-12-30 23:06:28 +0100 <eldritchcookie[4> i noticed a thing about indexed monads they are even harder to compose than normal monads
2022-12-30 23:07:48 +0100 <Rembane> eldritchcookie[4: How?
2022-12-30 23:09:56 +0100 <eldritchcookie[4> well it isn't as straightforward to define transformers for them
2022-12-30 23:10:16 +0100 <geekosaur[m]> (okay, looking at your paper, that's definitely CT)
2022-12-30 23:10:42 +0100 <eldritchcookie[4> cool i at least know what i don't know nice
2022-12-30 23:12:37 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2022-12-30 23:12:43 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 252 seconds)
2022-12-30 23:17:05 +0100wroathe(~wroathe@user/wroathe) (Ping timeout: 260 seconds)
2022-12-30 23:17:17 +0100 <unit73e> ggVGc, so nixos makes a lot of copies of different versions of the same package? that's the issue?
2022-12-30 23:17:41 +0100 <unit73e> also yes, with extensions haskell gets somewhat more complex, but I'd say scala is way more complex
2022-12-30 23:17:48 +0100 <unit73e> or even java
2022-12-30 23:18:04 +0100 <geekosaur[m]> yes, because you may need to use an older version. otoh you can gc older versions if you don't need them
2022-12-30 23:18:12 +0100 <unit73e> well, that's not that bad
2022-12-30 23:18:18 +0100 <unit73e> I think
2022-12-30 23:18:57 +0100 <unit73e> so it's the same approach as cabal, so results are predictable
2022-12-30 23:19:04 +0100 <geekosaur[m]> but you also end up duplicating your installed system because nix goes out of its way to avoid using system packages
2022-12-30 23:19:34 +0100 <unit73e> I see, that does suck somewhat
2022-12-30 23:19:54 +0100 <unit73e> I'm still on arch but at least I could experiment
2022-12-30 23:20:38 +0100 <unit73e> btw is it possible to make a standalone executable with cabal? or is that only a stack thing? I haven't looked into it yet.
2022-12-30 23:21:28 +0100 <geekosaur[m]> with respect to haskell libs they're all standalone. system libs are another question
2022-12-30 23:21:57 +0100 <geekosaur[m]> (unless you use -dynamic for some reason. which you might, since you're on arch)
2022-12-30 23:22:20 +0100 <unit73e> I'm not, I'm using ghcup to avoid all of those problems
2022-12-30 23:22:31 +0100 <unit73e> arch is crap with haskell... sadly
2022-12-30 23:26:25 +0100mizlan(~mizlan@c-67-169-7-31.hsd1.ca.comcast.net)
2022-12-30 23:27:29 +0100 <unit73e> but anyway, what I mean is if cabal can create an executable with the libraries included
2022-12-30 23:27:43 +0100 <unit73e> or maybe it does that already?
2022-12-30 23:27:49 +0100 <ggVGc> unit73e: in my personal experience, if using nix seriously, one should count on 50-100gb of nix-store
2022-12-30 23:30:43 +0100 <unit73e> ggVGc, that's not that bad. I have 2TB with a weird mix of 1TB M2, 500GB SSD and 500 GB HDD, because I borrowed from older computers lol
2022-12-30 23:30:57 +0100 <unit73e> should be enough for my needs
2022-12-30 23:32:38 +0100 <eldritchcookie[4> nix is not docker it won't waste too much space
2022-12-30 23:34:08 +0100beefbambi(~beefbambi@183.82.31.45)
2022-12-30 23:34:50 +0100 <unit73e> modern games take a lot of space but other than that
2022-12-30 23:34:59 +0100 <unit73e> and I'm not a fan of modern games
2022-12-30 23:35:24 +0100 <unit73e> if I want to play a walk simulator I will just go outside do real walking
2022-12-30 23:38:18 +0100 <sm> unit73e: yes, usually executables produced with ghc/cabal/stack are mostly-static, including all the haskell libs, but not all C libs. With special flags you can produce almost-but-still-not-entirely-static executables I think.
2022-12-30 23:39:03 +0100 <unit73e> sm, alright, I have to check that. it would be weird for stack to be able to do that but not cabal.
2022-12-30 23:39:23 +0100 <unit73e> thanks
2022-12-30 23:39:50 +0100gnalzo(~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c) (Quit: WeeChat 3.7.1)
2022-12-30 23:40:20 +0100 <geekosaur[m]> making a binary with everything but libc static is difficult across the board. making one with libc static is effectively impossible with glibc and dicey with musl or other alternative libcs
2022-12-30 23:45:44 +0100justsomeguy(~justsomeg@user/justsomeguy) (Ping timeout: 268 seconds)
2022-12-30 23:46:27 +0100justsomeguy(~justsomeg@user/justsomeguy)
2022-12-30 23:51:08 +0100 <sm> maybe using upx or similar packer is a way
2022-12-30 23:51:40 +0100 <sm> "Programs and libraries compressed by UPX are completely self-contained and run exactly as before, with no runtime or memory penalty for most of the supported formats."
2022-12-30 23:52:14 +0100titibandit(~titibandi@xdsl-89-0-163-79.nc.de) (Quit: Leaving.)
2022-12-30 23:52:25 +0100 <sm> "UPX will typically reduce the file size of programs and DLLs by around 50%-70%"
2022-12-30 23:52:50 +0100 <sm> nice, looks like it had a major release recently
2022-12-30 23:54:12 +0100mc47(~mc47@xmonad/TheMC47) (Remote host closed the connection)
2022-12-30 23:56:02 +0100 <DigitalKiwi> https://github.com/nh2/static-haskell-nix
2022-12-30 23:57:19 +0100 <sm> "upx seems to be particularly good at reducing binary sizes for Haskell code" -- https://www.reddit.com/r/haskell/comments/emszks/writing_small_programs_in_haskell/
2022-12-30 23:58:22 +0100 <DigitalKiwi> ggVGc: i have nixos on production servers with 25GB of storage lol
2022-12-30 23:58:43 +0100 <DigitalKiwi> you only need a lot for nix-store if you don't nix collect garbage
2022-12-30 23:59:36 +0100 <DigitalKiwi> it does help to have a little more though i'm more happy on a 40GB one but that's still not a lot