Logs on 2022-12-30 (liberachat/#haskell)
| 00:01:32 | × | mmhat quits (~mmh@p200300f1c721be69ee086bfffe095315.dip0.t-ipconnect.de) (Quit: WeeChat 3.7.1) |
| 00:02:36 | × | freeside quits (~mengwong@103.252.202.159) (Ping timeout: 265 seconds) |
| 00:08:57 | → | freeside joins (~mengwong@103.252.202.159) |
| 00:14:31 | × | finsternis quits (~X@23.226.237.192) (Read error: Connection reset by peer) |
| 00:14:52 | × | Guest9971 quits (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 272 seconds) |
| 00:25:46 | <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 |
| 00:26:48 | × | acidjnk quits (~acidjnk@p200300d6e7137a52305f770ee2a81388.dip0.t-ipconnect.de) (Ping timeout: 260 seconds) |
| 00:26:57 | × | ddellacosta quits (~ddellacos@89.46.62.213) (Ping timeout: 268 seconds) |
| 00:27:45 | × | `2jt quits (~jtomas@84.red-88-17-186.dynamicip.rima-tde.net) (Remote host closed the connection) |
| 00:28:37 | <hpc> | some types are Applicative but not Monad, like ZipList |
| 00:28:52 | → | ddellacosta joins (~ddellacos@143.244.47.68) |
| 00:29:10 | <hpc> | https://hackage.haskell.org/package/base-4.17.0.0/docs/Control-Applicative.html#t:ZipList |
| 00:29:57 | → | emmanuelux joins (~emmanuelu@user/emmanuelux) |
| 00:30:38 | <jean-paul[m]> | Cybro: Consider calling `a -> b -> c` when you have `f a` and `f b`. |
| 00:33:13 | × | mizlan quits (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 260 seconds) |
| 00:33:26 | <hpc> | > (+) <$> ZipList [10, 20, 30] <*> ZipList [1, 2, 3] |
| 00:33:28 | <lambdabot> | ZipList {getZipList = [11,22,33]} |
| 00:33:41 | <hpc> | > (+) `liftM` ZipList [10, 20, 30] `ap` ZipList [1, 2, 3] |
| 00:33:43 | <lambdabot> | error: |
| 00:33:43 | <lambdabot> | • Could not deduce (Monad ZipList) arising from a use of ‘ap’ |
| 00:33:43 | <lambdabot> | from the context: Num b |
| 00:34:38 | <hpc> | ^ can't be written with fmap alone either, no matter what you try |
| 00:35:44 | → | mizlan joins (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) |
| 00:36:02 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 00:39:07 | <Cybro> | hpc So now what's a ZipList? |
| 00:39:15 | → | jmorris joins (uid537181@id-537181.uxbridge.irccloud.com) |
| 00:40:12 | × | mizlan quits (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 272 seconds) |
| 00:40:48 | <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 |
| 00:41:34 | <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 |
| 00:41:42 | <glguy> | while Monad wouldn't allow that |
| 00:46:54 | <glguy> | https://hackage.haskell.org/package/base-4.17.0.0/docs/Control-Applicative.html#t:ZipList |
| 00:48:11 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds) |
| 00:48:35 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 00:49:49 | <Cybro> | Looking at the applicative definition: (<*>) :: f (a -> b) -> f a -> f b |
| 00:50:27 | <Cybro> | I don't really understand why you'd want an "f(a->b)" in the first place |
| 00:51:06 | <glguy> | then think about why you might want: f a -> f b -> f (a,b) |
| 00:51:32 | <glguy> | they apply in the same situations |
| 00:53:09 | → | mizlan joins (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) |
| 00:53:39 | → | wroathe joins (~wroathe@207-153-38-140.fttp.usinternet.com) |
| 00:53:39 | × | wroathe quits (~wroathe@207-153-38-140.fttp.usinternet.com) (Changing host) |
| 00:53:39 | → | wroathe joins (~wroathe@user/wroathe) |
| 00:55:11 | <Cybro> | That makes sense. It's having a function within a context that's weird to me. I understand the use of functors though. |
| 00:56:02 | <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. |
| 00:56:59 | <monochrom> | But one perspective is to look at ($) :: (a -> b) -> a -> b and wonder about generalizing to F (a -> b) -> F a -> F b. |
| 01:00:13 | <EvanR> | this is one reason why I question the intuitiveness of f A, m A as being "A in a context" |
| 01:00:37 | <EvanR> | it's a type and what it means depends on the type |
| 01:00:52 | <EvanR> | and who's talking and what day of the week it is, etc |
| 01:00:58 | <monochrom> | "intuitive" means personal subjective axioms. |
| 01:01:29 | <monochrom> | People's brains simply classify, very arbitrarily, something as "intuitive" and the rest as not. |
| 01:02:21 | <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 |
| 01:02:24 | <ggVGc> | I find that statement very non-intuitive |
| 01:02:56 | <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". |
| 01:04:38 | <monochrom> | Survival of the "fittest". Monads as "computations", "containers", "contexts". |
| 01:05:24 | <EvanR> | why do I want to use f at a function type? Well the type signature for <*> wants it. And we want to use <*> |
| 01:05:33 | <monochrom> | Comforting words of zero predictive power. |
| 01:05:48 | <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 |
| 01:06:06 | <ggVGc> | From my recent maths studies, that is a lot more how the maths courses are laid out |
| 01:06:20 | <ggVGc> | "here's a thing. These are the properties. Now let's see where that gets us" |
| 01:06:36 | <EvanR> | here's a bunch of operations and their properties |
| 01:06:52 | <ggVGc> | This stuff about context in relation to Monads always confused me |
| 01:06:57 | <EvanR> | <*>, fmap, >>= |
| 01:07:13 | <ggVGc> | and now that I know how to use and write Mondad implementations, I also don't really understand the context thing |
| 01:07:16 | <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 |
| 01:07:25 | <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." |
| 01:08:03 | <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 |
| 01:08:07 | <Cybro> | I need to understand why something works to be able to use it properly, otherwise I'll end up just guessing code |
| 01:08:56 | <monochrom> | You can prove that all the claimed instances of Applicative satisfy the Applicative laws. |
| 01:09:03 | <EvanR> | for that you should implement several Applicatives to see how they work |
| 01:09:28 | <Cybro> | jle``, looking at Hackage now and liftA2 makes more sense. Idk why school just taught us <*> straight away |
| 01:09:45 | <EvanR> | :t liftA2 |
| 01:09:46 | <lambdabot> | Applicative f => (a -> b -> c) -> f a -> f b -> f c |
| 01:09:59 | <EvanR> | :t liftA3 |
| 01:10:00 | <lambdabot> | Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d |
| 01:10:00 | <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]. |
| 01:10:48 | <monochrom> | You can also prove that pure ($) <*> [f, g] <*> [x, y] does the same, which is an example of how liftA2 relates to <*> |
| 01:11:09 | <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 |
| 01:11:46 | <monochrom> | <*> is a nice solution to "OK I have liftA2, now how about liftA3 and liftA4 and so on". |
| 01:12:04 | × | albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection) |
| 01:12:25 | <monochrom> | I teach liftA2 and then <*> and their equivalence. Then liftA3 etc is a walk in the park. (Just add more <*>s) |
| 01:12:30 | × | freeside quits (~mengwong@103.252.202.159) (Ping timeout: 272 seconds) |
| 01:13:19 | <monochrom> | By which point you begin to see how "pure f <*> x <*> y <*> z <*> ..." is like "f x y z ..." on steroid. |
| 01:13:42 | <monochrom> | and so <*> is really a generalization of $ |
| 01:13:52 | <mauke[m]> | :t liftA2 ($) |
| 01:13:53 | <lambdabot> | Applicative f => f (a -> c) -> f a -> f c |
| 01:14:30 | <monochrom> | this generalizing being from I (a -> b) -> I a -> I b (where I is the identity functor) to arbitrary s/I/F? |
| 01:14:35 | <monochrom> | err s/I/F/ |
| 01:16:11 | × | gurkenglas quits (~gurkengla@p548ac72e.dip0.t-ipconnect.de) (Ping timeout: 246 seconds) |
| 01:16:12 | <monochrom> | Now, when will you ask about pure? :) |
| 01:17:05 | <Cybro> | pure makes sense |
| 01:18:11 | → | albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8) |
| 01:19:23 | → | freeside joins (~mengwong@103.252.202.159) |
| 01:25:31 | × | Tuplanolla quits (~Tuplanoll@91-159-68-152.elisa-laajakaista.fi) (Quit: Leaving.) |
| 01:26:46 | × | freeside quits (~mengwong@103.252.202.159) (Ping timeout: 268 seconds) |
| 01:26:53 | <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 |
| 01:29:33 | × | Cybro quits (~Cybro@cpc83049-enfi23-2-0-cust89.20-2.cable.virginm.net) (Quit: Leaving) |
| 01:31:04 | → | Cybro joins (~Cybro@cpc83049-enfi23-2-0-cust89.20-2.cable.virginm.net) |
| 01:32:43 | × | Cybro quits (~Cybro@cpc83049-enfi23-2-0-cust89.20-2.cable.virginm.net) (Client Quit) |
| 01:32:55 | <glguy> | but I wish there was a way to know which would be faster |
| 01:33:06 | <glguy> | There are two opportunities but it only paid to switch one and not the other |
| 01:35:50 | × | mikoto-chan quits (~mikoto-ch@164.5.249.78) (Read error: Connection reset by peer) |
| 01:37:51 | → | freeside joins (~mengwong@103.252.202.159) |
| 01:39:10 | × | sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.) |
| 01:40:27 | → | sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 01:42:54 | × | freeside quits (~mengwong@103.252.202.159) (Ping timeout: 272 seconds) |
| 01:49:47 | → | razetime joins (~Thunderbi@49.207.228.176) |
| 01:59:05 | × | albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection) |
| 01:59:35 | × | tcard quits (~tcard@2400:4051:5801:7500:cf17:befc:ff82:5303) (Remote host closed the connection) |
| 02:00:40 | × | ft quits (~ft@i59F5448E.versanet.de) (Ping timeout: 252 seconds) |
| 02:02:39 | → | ft joins (~ft@i59F54B83.versanet.de) |
| 02:05:12 | → | albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8) |
| 02:10:29 | → | tcard joins (~tcard@2400:4051:5801:7500:cf17:befc:ff82:5303) |
| 02:13:35 | → | freeside joins (~mengwong@103.252.202.159) |
| 02:16:49 | × | beteigeuze quits (~Thunderbi@bl14-81-220.dsl.telepac.pt) (Ping timeout: 260 seconds) |
| 02:17:05 | → | thongpv joins (~thongpv87@2402:9d80:3db:44f4:2cb2:e04c:4067:cfda) |
| 02:17:06 | × | albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection) |
| 02:21:12 | <glguy> | ok, kept hammering on the Ints and it runs in 90ms vs the old 120ms |
| 02:23:13 | → | albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8) |
| 02:27:21 | × | sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.) |
| 02:29:22 | → | sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 02:37:55 | justsomeguy | wishes he was smart enought to take a class with monochrome |
| 02:57:14 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Quit: ZNC - https://znc.in) |
| 02:57:24 | → | azimut_ joins (~azimut@gateway/tor-sasl/azimut) |
| 02:59:32 | × | razetime quits (~Thunderbi@49.207.228.176) (Ping timeout: 272 seconds) |
| 03:01:37 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:2914:f025:7ef3:a77d) |
| 03:07:19 | × | hyperbolic-dg quits (~quassel@i577AA562.versanet.de) (Ping timeout: 256 seconds) |
| 03:08:40 | → | finn_elija joins (~finn_elij@user/finn-elija/x-0085643) |
| 03:08:40 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija))) |
| 03:08:40 | finn_elija | is now known as FinnElija |
| 03:09:26 | → | hyperbolic-dg joins (~quassel@i577AA562.versanet.de) |
| 03:16:59 | × | mizlan quits (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 264 seconds) |
| 03:18:23 | × | td_ quits (~td@83.135.9.29) (Ping timeout: 268 seconds) |
| 03:19:10 | × | freeside quits (~mengwong@103.252.202.159) (Ping timeout: 272 seconds) |
| 03:19:58 | → | td_ joins (~td@83.135.9.0) |
| 03:22:19 | × | phma quits (phma@2001:5b0:210d:5d58:64bb:4721:a872:cb87) (Read error: Connection reset by peer) |
| 03:22:44 | → | phma joins (~phma@host-67-44-208-169.hnremote.net) |
| 03:32:41 | → | freeside joins (~mengwong@103.252.202.159) |
| 03:33:55 | → | morb joins (~morb@pool-72-80-94-112.nycmny.fios.verizon.net) |
| 03:37:32 | × | freeside quits (~mengwong@103.252.202.159) (Ping timeout: 272 seconds) |
| 03:37:38 | × | [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Remote host closed the connection) |
| 03:38:35 | × | waleee quits (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Ping timeout: 264 seconds) |
| 03:39:23 | → | mizlan joins (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) |
| 03:47:27 | × | justsomeguy quits (~justsomeg@user/justsomeguy) (Ping timeout: 260 seconds) |
| 03:47:56 | × | werneta quits (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Quit: leaving) |
| 03:48:14 | → | werneta joins (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) |
| 03:49:24 | → | freeside joins (~mengwong@103.252.202.159) |
| 03:51:22 | → | Lycurgus joins (~juan@user/Lycurgus) |
| 03:54:44 | → | instantaphex joins (~jb@c-73-171-252-84.hsd1.fl.comcast.net) |
| 04:01:14 | × | ddellacosta quits (~ddellacos@143.244.47.68) (Ping timeout: 260 seconds) |
| 04:04:08 | × | Lycurgus quits (~juan@user/Lycurgus) (Quit: Exeunt: personae.ai-integration.biz) |
| 04:07:09 | × | Feuermagier quits (~Feuermagi@user/feuermagier) (Remote host closed the connection) |
| 04:12:38 | → | sympt9 joins (~sympt@user/sympt) |
| 04:13:40 | × | hyperbolic-dg quits (~quassel@i577AA562.versanet.de) (Quit: https://quassel-irc.org - Komfortabler Chat. Überall.) |
| 04:14:03 | × | sympt quits (~sympt@user/sympt) (Ping timeout: 260 seconds) |
| 04:14:04 | sympt9 | is now known as sympt |
| 04:25:08 | × | beefbambi quits (~beefbambi@183.82.24.237) (Read error: Connection reset by peer) |
| 04:25:50 | → | beefbambi joins (~beefbambi@183.82.24.237) |
| 04:31:16 | → | v0id_ptr joins (~adrift@user/ptr-frac7al/x-0038398) |
| 04:37:34 | → | Feuermagier joins (~Feuermagi@user/feuermagier) |
| 04:39:42 | → | Qudit joins (~user@user/Qudit) |
| 04:52:47 | × | freeside quits (~mengwong@103.252.202.159) (Ping timeout: 246 seconds) |
| 04:54:49 | × | morb quits (~morb@pool-72-80-94-112.nycmny.fios.verizon.net) (Remote host closed the connection) |
| 04:55:14 | × | shriekingnoise quits (~shrieking@186.137.167.202) (Quit: Quit) |
| 04:59:36 | → | freeside joins (~mengwong@103.252.202.159) |
| 05:03:46 | → | shriekingnoise joins (~shrieking@186.137.167.202) |
| 05:04:23 | × | freeside quits (~mengwong@103.252.202.159) (Ping timeout: 264 seconds) |
| 05:04:54 | → | johnw joins (~johnw@76-234-69-149.lightspeed.frokca.sbcglobal.net) |
| 05:07:06 | × | shriekingnoise quits (~shrieking@186.137.167.202) (Client Quit) |
| 05:07:10 | → | zmt01 joins (~zmt00@user/zmt00) |
| 05:10:38 | × | beefbambi quits (~beefbambi@183.82.24.237) (Ping timeout: 272 seconds) |
| 05:11:00 | × | zmt00 quits (~zmt00@user/zmt00) (Ping timeout: 260 seconds) |
| 05:11:11 | → | beefbambi joins (~beefbambi@2401:4900:230d:f57c:538c:d7cc:50c0:e377) |
| 05:18:11 | × | [Leary] quits (~Leary]@user/Leary/x-0910699) (Ping timeout: 264 seconds) |
| 05:18:18 | → | freeside joins (~mengwong@103.252.202.159) |
| 05:19:52 | → | [Leary] joins (~Leary]@user/Leary/x-0910699) |
| 05:23:35 | × | freeside quits (~mengwong@103.252.202.159) (Ping timeout: 246 seconds) |
| 05:41:14 | → | freeside joins (~mengwong@103.252.202.159) |
| 05:51:50 | → | titibandit joins (~titibandi@xdsl-89-0-163-79.nc.de) |
| 05:59:20 | × | instantaphex quits (~jb@c-73-171-252-84.hsd1.fl.comcast.net) (Ping timeout: 268 seconds) |
| 06:11:00 | × | bjourne quits (~bjorn@94.191.136.87.mobile.tre.se) (Read error: Connection reset by peer) |
| 06:35:31 | → | takuan joins (~takuan@178-116-218-225.access.telenet.be) |
| 06:46:16 | × | freeside quits (~mengwong@103.252.202.159) (Ping timeout: 272 seconds) |
| 06:50:41 | → | freeside joins (~mengwong@103.252.202.159) |
| 06:52:23 | × | mizlan quits (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 252 seconds) |
| 06:53:16 | × | Maeda quits (~Maeda@91-161-10-149.subs.proxad.net) (Ping timeout: 252 seconds) |
| 06:55:08 | × | freeside quits (~mengwong@103.252.202.159) (Ping timeout: 272 seconds) |
| 06:56:59 | × | wroathe quits (~wroathe@user/wroathe) (Quit: leaving) |
| 07:02:08 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 255 seconds) |
| 07:02:11 | → | mizlan joins (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) |
| 07:03:11 | → | tose joins (~tose@cst-prg-38-106.cust.vodafone.cz) |
| 07:05:32 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 07:09:19 | → | freeside joins (~mengwong@103.252.202.159) |
| 07:13:32 | × | freeside quits (~mengwong@103.252.202.159) (Ping timeout: 246 seconds) |
| 07:14:18 | × | Unicorn_Princess quits (~Unicorn_P@user/Unicorn-Princess/x-3540542) (Remote host closed the connection) |
| 07:15:05 | × | kritzefitz quits (~kritzefit@debian/kritzefitz) (Ping timeout: 255 seconds) |
| 07:18:40 | → | kritzefitz joins (~kritzefit@debian/kritzefitz) |
| 07:19:04 | × | xff0x quits (~xff0x@ai071162.d.east.v6connect.net) (Quit: xff0x) |
| 07:21:15 | × | v0id_ptr quits (~adrift@user/ptr-frac7al/x-0038398) (Ping timeout: 248 seconds) |
| 07:24:28 | × | tose quits (~tose@cst-prg-38-106.cust.vodafone.cz) (Ping timeout: 260 seconds) |
| 07:24:42 | → | trev joins (~trev@user/trev) |
| 07:26:10 | × | kritzefitz quits (~kritzefit@debian/kritzefitz) (Ping timeout: 272 seconds) |
| 07:26:15 | → | freeside joins (~mengwong@103.252.202.159) |
| 07:40:05 | × | ft quits (~ft@i59F54B83.versanet.de) (Quit: leaving) |
| 07:42:20 | → | lortabac joins (~lortabac@2a01:e0a:541:b8f0:1ac5:7c71:7184:d83) |
| 07:46:08 | → | zeenk joins (~zeenk@2a02:2f04:a110:ac00::7fe) |
| 07:46:36 | → | kritzefitz joins (~kritzefit@debian/kritzefitz) |
| 07:50:09 | → | tose joins (~tose@cst-prg-38-106.cust.vodafone.cz) |
| 07:52:55 | → | VY2 joins (~user@213.24.126.116) |
| 07:54:23 | → | gnalzo joins (~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c) |
| 08:05:01 | × | Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer) |
| 08:08:50 | → | v0id_ptr joins (~adrift@user/ptr-frac7al/x-0038398) |
| 08:13:09 | × | mizlan quits (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 268 seconds) |
| 08:18:41 | → | Hugo86576 joins (~Hugo86576@p4fe8b885.dip0.t-ipconnect.de) |
| 08:19:55 | × | jmdaemon quits (~jmdaemon@user/jmdaemon) (Ping timeout: 248 seconds) |
| 08:22:22 | × | troydm quits (~troydm@host-176-37-124-197.b025.la.net.ua) (Ping timeout: 265 seconds) |
| 08:28:41 | × | Hugo86576 quits (~Hugo86576@p4fe8b885.dip0.t-ipconnect.de) (Remote host closed the connection) |
| 08:33:23 | → | ft joins (~ft@dynamic-046-114-194-225.46.114.pool.telefonica.de) |
| 08:35:42 | → | razetime joins (~Thunderbi@49.207.228.176) |
| 08:37:21 | → | xff0x joins (~xff0x@2405:6580:b080:900:a46:d342:a53f:ec6a) |
| 08:42:07 | → | mizlan joins (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) |
| 08:42:48 | × | tose quits (~tose@cst-prg-38-106.cust.vodafone.cz) (Ping timeout: 272 seconds) |
| 08:46:48 | → | mei joins (~mei@user/mei) |
| 08:47:17 | → | freeside_ joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 08:47:53 | × | freeside quits (~mengwong@103.252.202.159) (Ping timeout: 260 seconds) |
| 08:52:54 | → | tose joins (~tose@cst-prg-38-106.cust.vodafone.cz) |
| 09:01:04 | × | freeside_ quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 260 seconds) |
| 09:01:30 | × | econo quits (uid147250@user/econo) (Quit: Connection closed for inactivity) |
| 09:02:49 | → | freeside joins (~mengwong@103.252.202.159) |
| 09:06:28 | → | mc47 joins (~mc47@xmonad/TheMC47) |
| 09:08:53 | → | acidjnk joins (~acidjnk@p200300d6e7137a527546c6117c6e6714.dip0.t-ipconnect.de) |
| 09:12:00 | ← | jakalx parts (~jakalx@base.jakalx.net) () |
| 09:16:03 | × | APic quits (apic@apic.name) (Ping timeout: 268 seconds) |
| 09:16:22 | → | APic joins (apic@apic.name) |
| 09:20:10 | → | VY2_ joins (~user@217.107.126.152) |
| 09:20:25 | × | gnalzo quits (~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c) (Quit: WeeChat 3.7.1) |
| 09:20:33 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 09:22:06 | → | Tuplanolla joins (~Tuplanoll@91-159-68-152.elisa-laajakaista.fi) |
| 09:22:50 | × | VY2 quits (~user@213.24.126.116) (Ping timeout: 268 seconds) |
| 09:25:12 | gehmehgeh | is now known as gmg |
| 09:27:55 | × | caryhartline quits (~caryhartl@2600:1700:2d0:8d30:486e:abe:5ebb:c6a0) (Quit: caryhartline) |
| 09:28:29 | × | simple quits (skralg@user/simple) (Remote host closed the connection) |
| 09:30:50 | → | simple joins (skralg@user/simple) |
| 09:37:49 | × | trev quits (~trev@user/trev) (Remote host closed the connection) |
| 09:38:00 | × | rburkholder quits (~blurb@96.45.2.121) (Remote host closed the connection) |
| 09:38:06 | → | trev joins (~trev@user/trev) |
| 09:39:08 | × | tose quits (~tose@cst-prg-38-106.cust.vodafone.cz) (Ping timeout: 246 seconds) |
| 09:39:47 | × | L29Ah quits (~L29Ah@wikipedia/L29Ah) (Ping timeout: 264 seconds) |
| 09:44:32 | × | mizlan quits (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 265 seconds) |
| 09:45:07 | → | cheater_ joins (~Username@user/cheater) |
| 09:46:47 | × | cheater quits (~Username@user/cheater) (Ping timeout: 246 seconds) |
| 09:46:48 | × | ft quits (~ft@dynamic-046-114-194-225.46.114.pool.telefonica.de) (Quit: leaving) |
| 09:46:53 | cheater_ | is now known as cheater |
| 09:48:05 | × | freeside quits (~mengwong@103.252.202.159) (Ping timeout: 260 seconds) |
| 09:50:47 | ← | jakalx parts (~jakalx@base.jakalx.net) () |
| 09:52:27 | → | cheater_ joins (~Username@user/cheater) |
| 09:52:43 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 09:53:09 | → | coot joins (~coot@213.134.171.3) |
| 09:53:19 | × | cheater quits (~Username@user/cheater) (Ping timeout: 260 seconds) |
| 09:53:22 | cheater_ | is now known as cheater |
| 09:56:49 | × | califax quits (~califax@user/califx) (Remote host closed the connection) |
| 09:57:56 | → | mizlan joins (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) |
| 09:57:58 | → | califax joins (~califax@user/califx) |
| 10:05:22 | → | zer0bitz joins (~zer0bitz@196.244.192.55) |
| 10:07:33 | <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? |
| 10:11:28 | × | thongpv quits (~thongpv87@2402:9d80:3db:44f4:2cb2:e04c:4067:cfda) (Read error: Connection reset by peer) |
| 10:12:16 | → | ft joins (~ft@dynamic-046-114-194-225.46.114.pool.telefonica.de) |
| 10:19:03 | → | L29Ah joins (~L29Ah@wikipedia/L29Ah) |
| 10:19:22 | → | thyriaen joins (~thyriaen@2a01:aea0:dd4:4bae:6245:cbff:fe9f:48b1) |
| 10:21:30 | → | mmhat joins (~mmh@p200300f1c721be69ee086bfffe095315.dip0.t-ipconnect.de) |
| 10:22:55 | × | mei quits (~mei@user/mei) (Quit: mei) |
| 10:23:07 | × | albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection) |
| 10:24:40 | <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" |
| 10:24:59 | <tomjaguarpaw> | (satisfying a commutative diagram) |
| 10:29:10 | → | troydm joins (~troydm@host-176-37-124-197.b025.la.net.ua) |
| 10:29:14 | → | albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8) |
| 10:30:46 | <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 |
| 10:31:52 | → | Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915) |
| 10:32:43 | × | Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 252 seconds) |
| 10:33:09 | Lord_of_Life_ | is now known as Lord_of_Life |
| 10:36:03 | → | wootehfoot joins (~wootehfoo@user/wootehfoot) |
| 10:41:00 | → | gnalzo joins (~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c) |
| 10:41:35 | → | CiaoSen joins (~Jura@p200300c9571bac002a3a4dfffe84dbd5.dip0.t-ipconnect.de) |
| 10:44:14 | <tomjaguarpaw> | eldritchcookie[4: Some variant of embed? https://hackage.haskell.org/package/mmorph-1.2.0/docs/Control-Monad-Morph.html#v:embed |
| 10:45:20 | <tomjaguarpaw> | embed id :: (MMonad t, Monad n) => t (t n) b -> t n b |
| 10:46:14 | <tomjaguarpaw> | The key thing to note is that this is a "higher rank join", and join = (>>= id) |
| 10:51:16 | <eldritchcookie[4> | nice squash does this exactly |
| 10:53:09 | <[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`. |
| 10:53:50 | × | trev quits (~trev@user/trev) (Remote host closed the connection) |
| 10:53:56 | × | tzh quits (~tzh@c-24-21-73-154.hsd1.or.comcast.net) (Quit: zzz) |
| 10:54:07 | → | trev joins (~trev@user/trev) |
| 10:57:01 | <eldritchcookie[4> | but if i am understanding correctly we can't do this for every monad transformer t |
| 10:59:28 | → | allbery_b joins (~geekosaur@xmonad/geekosaur) |
| 10:59:33 | × | geekosaur quits (~geekosaur@xmonad/geekosaur) (Killed (NickServ (GHOST command used by allbery_b))) |
| 11:00:08 | → | Lycurgus joins (~juan@user/Lycurgus) |
| 11:00:14 | × | mizlan quits (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 272 seconds) |
| 11:09:32 | × | xff0x quits (~xff0x@2405:6580:b080:900:a46:d342:a53f:ec6a) (Quit: xff0x) |
| 11:10:57 | → | beteigeuze joins (~Thunderbi@bl14-81-220.dsl.telepac.pt) |
| 11:11:08 | × | VY2_ quits (~user@217.107.126.152) (Ping timeout: 246 seconds) |
| 11:11:28 | → | xff0x joins (~xff0x@2405:6580:b080:900:18f:39b6:7457:a86b) |
| 11:13:04 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:2914:f025:7ef3:a77d) (Remote host closed the connection) |
| 11:20:18 | × | trev quits (~trev@user/trev) (Remote host closed the connection) |
| 11:20:40 | → | trev joins (~trev@user/trev) |
| 11:21:29 | × | meinside quits (uid24933@id-24933.helmsley.irccloud.com) (Quit: Connection closed for inactivity) |
| 11:26:17 | × | xff0x quits (~xff0x@2405:6580:b080:900:18f:39b6:7457:a86b) (Ping timeout: 252 seconds) |
| 11:26:36 | × | sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.) |
| 11:26:44 | → | sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 11:27:05 | × | mmhat quits (~mmh@p200300f1c721be69ee086bfffe095315.dip0.t-ipconnect.de) (Quit: WeeChat 3.7.1) |
| 11:27:05 | × | CiaoSen quits (~Jura@p200300c9571bac002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 255 seconds) |
| 11:27:57 | → | thongpv joins (~thongpv87@2402:9d80:3db:44f4:3a10:72cf:c3cd:6f03) |
| 11:28:28 | → | xff0x joins (~xff0x@178.255.149.135) |
| 11:31:06 | → | mizlan joins (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) |
| 11:32:17 | <lyxia> | eldritchcookie[4: can't do that for StateT |
| 11:33:26 | → | tose joins (~tose@cst-prg-38-106.cust.vodafone.cz) |
| 11:33:40 | × | beefbambi quits (~beefbambi@2401:4900:230d:f57c:538c:d7cc:50c0:e377) (Ping timeout: 260 seconds) |
| 11:36:02 | × | mizlan quits (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 268 seconds) |
| 11:36:20 | × | xff0x quits (~xff0x@178.255.149.135) (Ping timeout: 272 seconds) |
| 11:37:44 | → | xff0x joins (~xff0x@2405:6580:b080:900:18f:39b6:7457:a86b) |
| 11:39:24 | → | __monty__ joins (~toonn@user/toonn) |
| 11:53:57 | <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. |
| 12:01:11 | × | zeenk quits (~zeenk@2a02:2f04:a110:ac00::7fe) (Quit: Konversation terminated!) |
| 12:01:15 | × | xff0x quits (~xff0x@2405:6580:b080:900:18f:39b6:7457:a86b) (Ping timeout: 248 seconds) |
| 12:03:14 | × | Lycurgus quits (~juan@user/Lycurgus) (Quit: Exeunt: personae.ai-integration.biz) |
| 12:03:21 | → | xff0x joins (~xff0x@178.255.149.135) |
| 12:03:28 | × | ft quits (~ft@dynamic-046-114-194-225.46.114.pool.telefonica.de) (Quit: leaving) |
| 12:04:55 | → | mizlan joins (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) |
| 12:08:42 | ← | jakalx parts (~jakalx@base.jakalx.net) (Error from remote client) |
| 12:08:44 | × | jmorris quits (uid537181@id-537181.uxbridge.irccloud.com) (Quit: Connection closed for inactivity) |
| 12:08:52 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 12:09:16 | × | tose quits (~tose@cst-prg-38-106.cust.vodafone.cz) (Ping timeout: 272 seconds) |
| 12:09:54 | × | mizlan quits (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 272 seconds) |
| 12:09:54 | × | xff0x quits (~xff0x@178.255.149.135) (Ping timeout: 272 seconds) |
| 12:10:17 | → | xff0x joins (~xff0x@178.255.149.135) |
| 12:13:32 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:2914:f025:7ef3:a77d) |
| 12:15:30 | <[Leary]> | tomjaguarpaw: Yeah, in that case it should be---note 'Example 1' on the previous page. |
| 12:17:41 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:2914:f025:7ef3:a77d) (Ping timeout: 246 seconds) |
| 12:17:41 | × | xff0x quits (~xff0x@178.255.149.135) (Ping timeout: 246 seconds) |
| 12:18:32 | × | mzan quits (~quassel@mail.asterisell.com) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
| 12:19:34 | → | xff0x joins (~xff0x@2405:6580:b080:900:18f:39b6:7457:a86b) |
| 12:22:41 | → | tose joins (~tose@cst-prg-38-106.cust.vodafone.cz) |
| 12:24:29 | → | mzan joins (~quassel@mail.asterisell.com) |
| 12:29:30 | → | eldritch_ joins (~eldritch@2804:7f4:8180:b77d:9367:1155:b601:f590) |
| 12:30:23 | → | dextaa6 joins (~DV@user/dextaa) |
| 12:32:15 | × | dextaa quits (~DV@user/dextaa) (Ping timeout: 265 seconds) |
| 12:32:16 | dextaa6 | is now known as dextaa |
| 12:38:37 | → | mizlan joins (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) |
| 12:39:02 | × | tose quits (~tose@cst-prg-38-106.cust.vodafone.cz) (Ping timeout: 246 seconds) |
| 12:39:25 | <tomjaguarpaw> | [Leary]++ |
| 12:40:43 | × | acidjnk quits (~acidjnk@p200300d6e7137a527546c6117c6e6714.dip0.t-ipconnect.de) (Ping timeout: 248 seconds) |
| 12:41:47 | × | titibandit quits (~titibandi@xdsl-89-0-163-79.nc.de) (Ping timeout: 255 seconds) |
| 12:42:20 | × | son0p quits (~ff@2604:3d08:5b7f:5540:98a9:2169:15a1:4c7f) (Remote host closed the connection) |
| 12:44:44 | × | eldritch_ quits (~eldritch@2804:7f4:8180:b77d:9367:1155:b601:f590) (Quit: Leaving) |
| 12:49:31 | → | Guest9971 joins (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) |
| 12:58:05 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 255 seconds) |
| 13:01:00 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 13:03:11 | × | v0id_ptr quits (~adrift@user/ptr-frac7al/x-0038398) (Ping timeout: 264 seconds) |
| 13:05:05 | → | hyperbolic-dg joins (~quassel@i577AA562.versanet.de) |
| 13:11:26 | → | hussam joins (~hussam@user/hussam) |
| 13:13:10 | × | hussam quits (~hussam@user/hussam) (Quit: issued !quit command) |
| 13:14:06 | → | ft joins (~ft@p4fc2a257.dip0.t-ipconnect.de) |
| 13:17:04 | → | hussam joins (~hussam@user/hussam) |
| 13:22:24 | → | son0p joins (~ff@2604:3d08:5b7f:5540::417e) |
| 13:22:40 | → | thongpv87 joins (~thongpv87@2402:9d80:3db:44f4:3a10:72cf:c3cd:6f03) |
| 13:22:49 | → | waleee joins (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) |
| 13:22:50 | × | emmanuelux quits (~emmanuelu@user/emmanuelux) (Read error: Connection reset by peer) |
| 13:23:40 | → | perrierjouet joins (~perrier-j@modemcable048.127-56-74.mc.videotron.ca) |
| 13:24:22 | × | thyriaen quits (~thyriaen@2a01:aea0:dd4:4bae:6245:cbff:fe9f:48b1) (Quit: Leaving) |
| 13:25:33 | × | thongpv quits (~thongpv87@2402:9d80:3db:44f4:3a10:72cf:c3cd:6f03) (Ping timeout: 260 seconds) |
| 13:30:42 | → | bjourne joins (~bjorn@94.191.136.87.mobile.tre.se) |
| 13:33:17 | × | sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.) |
| 13:34:24 | → | sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 13:35:00 | → | titibandit joins (~titibandi@xdsl-89-0-163-79.nc.de) |
| 13:36:19 | → | n0den1te joins (~aaaa@2401:4900:1cc8:ae75:8ca5:24cf:a3c6:3784) |
| 13:36:25 | × | waleee quits (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Ping timeout: 252 seconds) |
| 13:39:33 | × | cheater quits (~Username@user/cheater) (Ping timeout: 260 seconds) |
| 13:41:11 | → | cheater joins (~Username@user/cheater) |
| 13:42:14 | × | mizlan quits (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 260 seconds) |
| 13:46:53 | → | freeside joins (~mengwong@103.252.202.159) |
| 13:51:02 | × | freeside quits (~mengwong@103.252.202.159) (Ping timeout: 252 seconds) |
| 13:52:00 | → | Unicorn_Princess joins (~Unicorn_P@user/Unicorn-Princess/x-3540542) |
| 13:53:41 | → | tose joins (~tose@cst-prg-38-106.cust.vodafone.cz) |
| 13:59:22 | → | mizlan joins (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) |
| 14:03:47 | × | mizlan quits (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 264 seconds) |
| 14:08:38 | × | perrierjouet quits (~perrier-j@modemcable048.127-56-74.mc.videotron.ca) (Quit: WeeChat 3.7.1) |
| 14:08:40 | → | Guest41 joins (~Guest41@ip-084-118-041-183.um23.pools.vodafone-ip.de) |
| 14:09:07 | <Guest41> | Hello, is some advanced haskellian here? |
| 14:10:35 | <razetime> | https://dontasktoask.com/ |
| 14:10:38 | <Guest41> | I'd like to ask something about mFilter: Why does the Monoid needs to be an instance of Applicative there? |
| 14:12:32 | <Guest41> | cause mFilter requires a MonadPlus instance, which Requires an Alternative instance, which requires Applicative instance... |
| 14:12:33 | <Guest41> | But I don't understand why the Type needs to be Applicative to be thrown into mFilter |
| 14:12:55 | <razetime> | I don't understand this question, but https://discourse.haskell.org/ may also be a good place to ask your question. |
| 14:13:24 | <c_wraith> | Guest41: mfilter :: MonadPlus m => (a -> Bool) -> m a -> m a |
| 14:13:47 | <c_wraith> | what function are you asking about? |
| 14:14:15 | <Guest41> | there it says "MonadPlus"? Why isn't Monad enough? |
| 14:14:57 | → | Maeda joins (~Maeda@91-161-10-149.subs.proxad.net) |
| 14:15:58 | <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 |
| 14:15:58 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:2914:f025:7ef3:a77d) |
| 14:16:07 | <c_wraith> | well, the type `(a -> Bool) -> m a -> m a` is enough to see that `Monad m` isn't a sufficient constraint |
| 14:17:20 | <Guest41> | c_wraith: I don't see why Monda m isn't enough to be honest |
| 14:17:40 | <c_wraith> | Monad gives you (>>=) and return. |
| 14:17:44 | <Guest41> | well yes |
| 14:17:47 | → | mizlan joins (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) |
| 14:18:13 | <Guest41> | and mfilter needs <*> as well or what? |
| 14:18:15 | <c_wraith> | neither of those introduce a value of type `m a` without something else |
| 14:18:26 | <c_wraith> | MonadPlus, on the other hand, provides mzero |
| 14:18:38 | <c_wraith> | which actually gives you something to do if the predicate fails |
| 14:19:07 | <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) |
| 14:20:05 | <Guest41> | Ahh that makes sense and this mzero comes from "Alternative"? |
| 14:20:11 | <c_wraith> | it comes from MonadPlus |
| 14:20:23 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:2914:f025:7ef3:a77d) (Ping timeout: 260 seconds) |
| 14:20:34 | <c_wraith> | You seem to be mixing filterM and mfilter |
| 14:20:43 | <c_wraith> | or else you're talking about some third thing entirely |
| 14:21:28 | → | perrierjouet joins (~perrier-j@modemcable048.127-56-74.mc.videotron.ca) |
| 14:22:35 | <Guest41> | Well, by trial and Error I now have some code working for mfilter. And I am trying to understand it..: |
| 14:22:36 | <Guest41> | I am instanciating the MonadPlus simply by providing "instance Alternative" and "instance Monad" |
| 14:23:03 | <c_wraith> | Alternative and MonadPlus are almost the same |
| 14:23:32 | <lortabac> | I guess (Monad m, Alternative m) would make sense too |
| 14:23:50 | <c_wraith> | It would, but that's the default implementation of MonadPlus |
| 14:23:53 | <lortabac> | the (MonadPlus m) is probably for historical reasons (?) |
| 14:24:22 | <c_wraith> | I mean, I suppose it'd be nice to not have to basically-identical class with only a difference in superclass requirements |
| 14:24:29 | <c_wraith> | that predates the AMP changes |
| 14:24:59 | <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? |
| 14:25:19 | <lortabac> | IMHO the superclass requirement is kind of useless |
| 14:25:41 | <lortabac> | you can always add the (Monad m) constraint when needed |
| 14:25:56 | <Guest41> | My Problem now is that I instanciated the "Applicative" class, but with Rubbish, cause I don't even want it |
| 14:26:48 | <lortabac> | Guest41: why do you want to use mfilter then? if 'm' is not an Applicative it doesn't make sense |
| 14:27:05 | <Guest41> | I might missunderstand what applicative means? |
| 14:27:30 | <Guest41> | I thought it means you can apply the datastructure as function |
| 14:28:12 | <Guest41> | But I don't want to apply my data as a Function on another |
| 14:28:36 | <Guest41> | Atleast I think I don't want that |
| 14:28:57 | <lortabac> | can I ask why you need mfilter? |
| 14:29:00 | <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. |
| 14:29:28 | <c_wraith> | :t (<*>) -- this is a much more compact way of saying roughly the same thing, but much more precisely |
| 14:29:29 | <lambdabot> | Applicative f => f (a -> b) -> f a -> f b |
| 14:30:36 | <Guest41> | Like I have a Tree. |
| 14:30:36 | <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? |
| 14:30:38 | <ncf> | you might want to have a look at https://wiki.haskell.org/Typeclassopedia#Applicative |
| 14:33:00 | <lortabac> | Guest41: yes, technically that's what Applicative does |
| 14:34:32 | <Guest41> | How could that be sensefully implemented for a Tree? |
| 14:34:43 | → | CiaoSen joins (~Jura@p200300c9571bac002a3a4dfffe84dbd5.dip0.t-ipconnect.de) |
| 14:34:46 | <c_wraith> | Depends. There are a few ways. |
| 14:35:05 | <c_wraith> | But... Mostly they aren't what you'd expect. |
| 14:35:19 | <Guest41> | well, always returning Nil (empty Tree) did work for my use case, but that can't be right? |
| 14:35:26 | <c_wraith> | Which means... Let's back up to lortabac's question. Why are you trying to use mfilter? |
| 14:35:56 | <Guest41> | Well, it is a Tree... I want to filter it... so I thought about using mfilter |
| 14:36:30 | <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 |
| 14:36:38 | → | shriekingnoise joins (~shrieking@186.137.167.202) |
| 14:37:11 | <c_wraith> | The thing that actually is for that is https://hackage.haskell.org/package/witherable-0.4.2/docs/Witherable.html#t:Filterable |
| 14:37:18 | <c_wraith> | But it's no shortcut. |
| 14:37:34 | <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. |
| 14:38:01 | <c_wraith> | Tree deletes are just not free |
| 14:38:44 | <Guest41> | But my current filtering via mfilter does in a way work? But you say I am missuing stuff I shoudn't have? |
| 14:39:09 | <c_wraith> | the difference between "in a way" and "correct" |
| 14:40:04 | <c_wraith> | what should the result of `filter even (Node 3 (Node 2 Nil Nil) (Node 4 Nil Nil))` be? |
| 14:41:23 | × | cheater quits (~Username@user/cheater) (Ping timeout: 260 seconds) |
| 14:41:55 | <Guest41> | Node 3 [] |
| 14:41:56 | <Guest41> | (My subtrees are lists and if a Node doesn't fulfill the condition, the full sub-Tree may be deleted |
| 14:42:01 | → | cheater joins (~Username@user/cheater) |
| 14:42:47 | <c_wraith> | that's definitely the wrong answer. filter keeps the things that match the predicate. Nil? |
| 14:43:56 | <Guest41> | Oh yeah, then Nil is the answer |
| 14:45:26 | allbery_b | is now known as geekosaur |
| 14:46:08 | <jean-paul[m]> | using Hedgehog, why does Gen.text (Range.linear 0 999) (Gen.filterT (/= '\n') Gen.unicode) seem to loop forever |
| 14:49:52 | → | [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470) |
| 14:54:09 | <Guest41> | So, mFilter is only for applicative data, but obviously it is enough for mfilter to work, that the data Type provides: |
| 14:54:10 | <Guest41> | return |
| 14:54:10 | <Guest41> | >>= |
| 14:54:11 | <Guest41> | empty(=mzero) |
| 14:54:11 | <Guest41> | So why does it require so much more |
| 14:54:50 | × | CiaoSen quits (~Jura@p200300c9571bac002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 246 seconds) |
| 14:56:13 | <ncf> | every Monad is an Applicative and every MonadPlus is an Alternative, so the only thing it requires that it doesn't need is <|> |
| 14:56:22 | <jean-paul[m]> | Oh, it didn't loop forever, just a long long time :/ |
| 14:56:46 | → | motherfsck joins (~motherfsc@user/motherfsck) |
| 14:57:01 | <Guest41> | It doesn't requires <*> to filter? |
| 14:58:29 | <ncf> | did you read its implementation? it's not very long |
| 14:58:35 | <ncf> | @src mfilter |
| 14:58:35 | <lambdabot> | Source not found. BOB says: You seem to have forgotten your passwd, enter another! |
| 14:58:51 | <ncf> | mfilter p ma = do a <- ma; if p a then return a else mzero |
| 14:59:06 | <Guest41> | Yeah, I read it |
| 14:59:17 | <Guest41> | Not that I would understand it |
| 14:59:25 | <Guest41> | But i dont see <*> in there |
| 15:00:18 | <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 |
| 15:00:46 | <ncf> | :t ap |
| 15:00:47 | <lambdabot> | Monad m => m (a -> b) -> m a -> m b |
| 15:01:04 | → | cheater_ joins (~Username@user/cheater) |
| 15:01:09 | <Guest41> | How would it be defined using >>= and return? |
| 15:01:37 | <Guest41> | cause my Compiler requires me to define it anyway |
| 15:01:46 | <ncf> | mf <*> ma = do f <- mf; a <- ma; return (f a) |
| 15:02:13 | <ncf> | if you already have a Monad instance, you can just do instance Applicative YourThing where pure = return; (<*>) = ap |
| 15:03:23 | <Guest41> | How can the programm take f out of mf? |
| 15:03:25 | <ggVGc> | are we still discussing monads? |
| 15:03:49 | <Guest41> | Why? Are Monads to trivial? |
| 15:03:54 | × | cheater quits (~Username@user/cheater) (Ping timeout: 260 seconds) |
| 15:03:59 | × | tose quits (~tose@cst-prg-38-106.cust.vodafone.cz) (Ping timeout: 255 seconds) |
| 15:04:01 | cheater_ | is now known as cheater |
| 15:04:07 | <ggVGc> | no, but it's been the topic the last two times I checked this window too :) |
| 15:04:21 | <ggVGc> | with several hours spacing. Anyway, please continue |
| 15:04:34 | <Guest41> | Well it wasn't me the last times |
| 15:06:38 | <Guest41> | So, the apply function takes 2 instances of a Monad and could just use something like this?: |
| 15:06:38 | <Guest41> | mf <*> ma = ma >>= (mf >>= <*>) |
| 15:06:39 | <Guest41> | ?? |
| 15:07:08 | <Guest41> | I don't like that its infix, that confuses me :D |
| 15:07:42 | <ggVGc> | in cases where it gets confusing, it's sometimes better to write out the full lambda |
| 15:07:51 | <ggVGc> | I do this often with operators to make things clearer |
| 15:08:10 | <ncf> | the do-notation i used desugars to mf <*> ma = mf >>= \ f -> ma >>= \ a -> return (f a) |
| 15:09:28 | <Guest41> | with braces like this? mf <*> ma = mf >>= (\ f -> ma >>= (\ a -> return (f a))) |
| 15:09:40 | <ncf> | yes |
| 15:09:53 | <ncf> | you could also do it with a single use of (>>=): mf <*> ma = mf >>= \ f -> fmap f ma |
| 15:12:04 | <Guest41> | Hmm I am just trying to evaluate it step by step: Does a infix operator curry the left operand first? |
| 15:12:38 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 255 seconds) |
| 15:12:40 | <ncf> | a ? b is equivalent to (?) a b |
| 15:12:52 | <Guest41> | thanks |
| 15:13:41 | <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? |
| 15:14:49 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 15:15:10 | <ncf> | :t (>>=) |
| 15:15:11 | <lambdabot> | Monad m => m a -> (a -> m b) -> m b |
| 15:15:46 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 15:15:47 | × | azimut_ quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds) |
| 15:16:27 | × | wootehfoot quits (~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer) |
| 15:19:29 | <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) |
| 15:20:04 | <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 |
| 15:20:14 | <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 |
| 15:20:39 | <geekosaur> | (-) might have been a better example |
| 15:20:48 | <glguy> | Partial application |
| 15:21:03 | × | mizlan quits (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 260 seconds) |
| 15:21:06 | <ggVGc> | geekosaur: I was gonna use that, but then I realised there's also the confusion about -1 and - 1 :) |
| 15:21:10 | <ggVGc> | anyway, the point stands |
| 15:21:28 | <glguy> | Currying is to do with the relationship between (a,b)-> and a->b-> |
| 15:21:36 | × | lortabac quits (~lortabac@2a01:e0a:541:b8f0:1ac5:7c71:7184:d83) (Quit: WeeChat 2.8) |
| 15:21:54 | <ggVGc> | yeah, true, wrong wording |
| 15:22:08 | <ggVGc> | well, I guess that's me trying to be helpful for today |
| 15:22:18 | <ggVGc> | maybe ask me about quantum mechanics instead :( |
| 15:22:24 | <ggVGc> | (I also won't have the correct answer) |
| 15:23:31 | <Guest41> | ggVGc I didn't thought about this part of currying but it makes sense... |
| 15:23:32 | <Guest41> | InPlace operators get uglier and uglier |
| 15:25:00 | <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 |
| 15:29:25 | × | razetime quits (~Thunderbi@49.207.228.176) (Quit: razetime) |
| 15:31:28 | <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? |
| 15:32:56 | <witcher> | the definition of this might make it easier: https://paste.sr.ht/~witcher/abd932a57aec258d238bb0ec50d72d22425cb0c1 |
| 15:33:00 | <ggVGc> | witcher: it's easier to answer questions like this if you can show a paste of some code (using some pasting service) |
| 15:33:07 | <ggVGc> | haha, like that :) |
| 15:33:09 | <witcher> | beat you by a second :p |
| 15:34:06 | → | ddellacosta joins (~ddellacos@143.244.47.68) |
| 15:34:18 | <ggVGc> | witcher: it looks like you're doing a tagged union (in C-speak), right? |
| 15:35:25 | <witcher> | I guess so, yes |
| 15:36:36 | <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 |
| 15:37:21 | <bjourne> | the usual way of writing trees: data Node a = Tree a [Node a] | Leaf a |
| 15:38:11 | × | Tuplanolla quits (~Tuplanoll@91-159-68-152.elisa-laajakaista.fi) (Ping timeout: 246 seconds) |
| 15:38:17 | <ggVGc> | Yeah, this implementation of a "Tree" that I did (which is a copy of the original), is more like a line |
| 15:38:26 | <ggVGc> | since each node can only have either another node, or a leaf |
| 15:38:42 | <ggVGc> | ah, wait, I missed the second HTree param |
| 15:38:43 | <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 |
| 15:39:20 | <witcher> | my previous definition was this: `data HTree = Node HTree HTree Integer | Leaf Char Integer` |
| 15:40:08 | <ggVGc> | witcher: I would still do it this way then, https://gist.github.com/7e39e035278ee1e93bc42e60d8f7ce15 |
| 15:40:19 | <ggVGc> | e.g having a helper to access the data you want in an easier way |
| 15:40:31 | <glguy> | You can have a record field shared between constructors |
| 15:40:50 | <witcher> | I'm not sure how I didn't think of defining a helper function to extract the value :v) |
| 15:40:50 | × | Vajb quits (~Vajb@2001:999:250:c9:8588:6e93:7809:7816) (Read error: Connection reset by peer) |
| 15:40:56 | <witcher> | thank you! |
| 15:41:27 | <witcher> | looks like i was thinking of way too complicated solutions when an easy one does it |
| 15:43:19 | × | Kaiepi quits (~Kaiepi@nwcsnbsc03w-47-55-159-86.dhcp-dynamic.fibreop.nb.bellaliant.net) (Ping timeout: 268 seconds) |
| 15:43:36 | → | waleee joins (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) |
| 15:44:28 | → | dagit joins (~dagit@2001:558:6025:38:6476:a063:d05a:44da) |
| 15:45:10 | × | Guest9971 quits (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 268 seconds) |
| 15:46:46 | <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) |
| 15:46:47 | <Guest41> | A Tree doesn't really seem to be applicative, (because different Structure) |
| 15:46:47 | <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) |
| 15:46:48 | <Guest41> | A Tree Feels to be a Monad, cause that sounds just like mapping each Value (????Functor????) |
| 15:46:48 | <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). |
| 15:46:49 | <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 |
| 15:47:50 | → | mizlan joins (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) |
| 15:48:41 | → | ratapaca joins (~ratapaca@98.40.240.33) |
| 15:49:37 | → | Vajb joins (~Vajb@hag-jnsbng11-58c3a5-27.dhcp.inet.fi) |
| 15:52:25 | × | n0den1te quits (~aaaa@2401:4900:1cc8:ae75:8ca5:24cf:a3c6:3784) (Quit: Quitting...) |
| 15:52:47 | → | Tuplanolla joins (~Tuplanoll@91-159-68-152.elisa-laajakaista.fi) |
| 15:52:50 | × | mizlan quits (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 272 seconds) |
| 15:53:52 | <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 |
| 15:55:07 | → | Sgeo joins (~Sgeo@user/sgeo) |
| 15:57:00 | <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 |
| 15:58:47 | <Guest41> | Are these laws what functions need to be implemented? |
| 15:58:59 | <chreekat> | SIde note, https://hackage.haskell.org/package/selective is interesting |
| 16:00:03 | <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 |
| 16:00:04 | <ggVGc> | I like how the link to the referenced paper is dead :) |
| 16:00:04 | × | Dominik[m] quits (~dschrempf@2001:470:69fc:105::2:bbb6) (Quit: You have been kicked for being idle) |
| 16:00:18 | → | Dominik[m] joins (~dschrempf@2001:470:69fc:105::2:bbb6) |
| 16:00:40 | ← | Dominik[m] parts (~dschrempf@2001:470:69fc:105::2:bbb6) () |
| 16:00:47 | <Guest41> | the link to the paper downloads a pdf? |
| 16:01:19 | <chreekat> | it goes to a 404 :( |
| 16:01:26 | <ggVGc> | ah, the link in the readme works |
| 16:01:27 | <chreekat> | maybe google will find it |
| 16:01:32 | <chreekat> | ah cool |
| 16:02:41 | <chreekat> | afk |
| 16:04:25 | <ggVGc> | What I wonder in regards to Selective is, how many things are almost-monadic but does not have join |
| 16:05:10 | <Guest41> | Can someone explain me why there is a $ here:? |
| 16:05:11 | <Guest41> | u <*> pure y = pure ($ y) <*> u |
| 16:05:14 | → | Kaiepi joins (~Kaiepi@nwcsnbsc03w-47-55-159-86.dhcp-dynamic.fibreop.nb.bellaliant.net) |
| 16:05:39 | <geekosaur> | it reads better than `` `id` `` |
| 16:06:07 | <chreekat> | Someone couldn't find the energy to write (\f -> f y) |
| 16:06:20 | <geekosaur> | it's function application, with the thing to be applied supplied and the thing to apply as a parameter |
| 16:06:22 | <ggVGc> | $ is function application. ($ y) is the same as (\f -> f y) |
| 16:06:24 | <geekosaur> | like … that |
| 16:06:46 | <ggVGc> | geekosaur: hm, is it id? |
| 16:06:59 | <ggVGc> | oh, right |
| 16:07:01 | <ggVGc> | I get it now :) |
| 16:07:14 | → | mizlan joins (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) |
| 16:07:23 | <Guest41> | So it returns a Function which gets a function to apply this function :D |
| 16:07:53 | <Guest41> | So u is a Context of Functions? |
| 16:09:57 | <Guest41> | Shit, my Applicative Tree Fullfills these Laws so far |
| 16:10:03 | <Guest41> | (first 3) |
| 16:12:30 | × | ddellacosta quits (~ddellacos@143.244.47.68) (Ping timeout: 260 seconds) |
| 16:12:31 | × | ratapaca quits (~ratapaca@98.40.240.33) (Quit: Leaving) |
| 16:13:08 | ← | jakalx parts (~jakalx@base.jakalx.net) (Error from remote client) |
| 16:15:21 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 16:16:42 | → | briandaed joins (~briandaed@185.234.210.211.r.toneticgroup.pl) |
| 16:19:37 | → | ddellacosta joins (~ddellacos@143.244.47.68) |
| 16:20:12 | → | acidjnk joins (~acidjnk@p200300d6e7137a73b4a4bff990465aaa.dip0.t-ipconnect.de) |
| 16:21:06 | × | Guest41 quits (~Guest41@ip-084-118-041-183.um23.pools.vodafone-ip.de) (Quit: Ping timeout (120 seconds)) |
| 16:21:16 | → | Guest41 joins (~Guest41@ip-084-118-041-183.um23.pools.vodafone-ip.de) |
| 16:21:20 | → | tose joins (~tose@cst-prg-38-106.cust.vodafone.cz) |
| 16:21:45 | <Guest41> | I don't like the fact, that I am Fullfilling all 4 rules without having known them |
| 16:22:48 | <Guest41> | Its frightening |
| 16:22:52 | × | Vajb quits (~Vajb@hag-jnsbng11-58c3a5-27.dhcp.inet.fi) (Read error: Connection reset by peer) |
| 16:25:47 | × | ddellacosta quits (~ddellacos@143.244.47.68) (Ping timeout: 248 seconds) |
| 16:26:17 | → | mei joins (~mei@user/mei) |
| 16:26:32 | <Guest41> | I now have the follwing definition for applicative: |
| 16:26:32 | <Guest41> | ma >>= (\a -> mf >>= (\ f -> return (f a))) |
| 16:26:33 | <Guest41> | Somehow it is different to: |
| 16:26:33 | <Guest41> | mf >>= (\f -> ma >>= (\ a -> return (f a))) |
| 16:26:34 | <Guest41> | Is that bad? |
| 16:28:03 | → | Vajb joins (~Vajb@2001:999:405:5eb2:8d39:b832:a9ee:9bdf) |
| 16:28:52 | gnalzo | can't imagine a good definition for applicative Tree |
| 16:30:29 | → | morb joins (~morb@pool-72-80-94-112.nycmny.fios.verizon.net) |
| 16:31:49 | <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. |
| 16:31:49 | <Guest41> | If I apply a Node with a single Function to a tree, it applies this function to every value at its own... |
| 16:31:50 | <Guest41> | The other cases... well I don't know whats happening there either, but it is happening |
| 16:32:59 | <Guest41> | I am going to check whether the third monads rule holds true, but then it should be fine |
| 16:33:24 | → | danza joins (~francesco@151.35.209.134) |
| 16:33:36 | × | thongpv87 quits (~thongpv87@2402:9d80:3db:44f4:3a10:72cf:c3cd:6f03) (Read error: Connection reset by peer) |
| 16:34:37 | → | justsomeguy joins (~justsomeg@user/justsomeguy) |
| 16:34:56 | × | morb quits (~morb@pool-72-80-94-112.nycmny.fios.verizon.net) (Ping timeout: 252 seconds) |
| 16:35:40 | × | pavonia quits (~user@user/siracusa) (Quit: Bye!) |
| 16:36:40 | <mauke[m]> | one of those applies effects backwards |
| 16:36:47 | → | tjakway joins (~tjakway@cpe-107-184-74-161.socal.res.rr.com) |
| 16:36:57 | <mauke[m]> | in terms of trees it probably affects the nesting structure if I had to guess |
| 16:37:36 | <mauke[m]> | also, if you already have a Monad instance, (<*>) = ap |
| 16:37:38 | <mauke[m]> | :t ap |
| 16:37:39 | <lambdabot> | Monad m => m (a -> b) -> m a -> m b |
| 16:38:47 | <geekosaur> | (if you're wondering, `ap` exists because `Monad` predates the idea of `Applicative` by around a decade |
| 16:38:48 | <geekosaur> | ) |
| 16:39:20 | <Guest41> | Makes sense, though how is it defined? |
| 16:39:36 | <Guest41> | I cant get the third rule to calculate |
| 16:39:41 | <geekosaur> | @src ap |
| 16:39:41 | <lambdabot> | ap = liftM2 id |
| 16:39:48 | <geekosaur> | @src liftM2 |
| 16:39:48 | <lambdabot> | liftM2 f m1 m2 = do |
| 16:39:48 | <lambdabot> | x1 <- m1 |
| 16:39:48 | <lambdabot> | x2 <- m2 |
| 16:39:48 | <lambdabot> | return (f x1 x2) |
| 16:42:06 | → | econo joins (uid147250@user/econo) |
| 16:42:32 | <geekosaur> | this imposes an unnecessary relationship between `m1` and `m2` because it's `Monad`; a proper `Applicative` definition (`liftA2` and `<*>`) wouldn't |
| 16:43:17 | <Guest41> | Would this be equal to one of these? [17:26:32] <Guest41> ma >>= (\a -> mf >>= (\ f -> return (f a))) |
| 16:43:17 | <Guest41> | [17:26:32] <Guest41> mf >>= (\f -> ma >>= (\ a -> return (f a))) |
| 16:43:41 | <Guest41> | Cause I don't get this definition |
| 16:43:50 | <geekosaur> | @do mf >>= (\f -> ma >>= (\ a -> return (f a))) |
| 16:43:51 | <lambdabot> | do { b <- mf; (\ f -> do { b <- ma; (\ a -> return (f a)) b}) b} |
| 16:44:02 | <mauke[m]> | boo |
| 16:44:09 | <geekosaur> | yeh |
| 16:44:23 | <mauke[m]> | @do mf >>= \f -> ma >>= \a -> return (f a) |
| 16:44:23 | <lambdabot> | do { f <- mf; a <- ma; return (f a)} |
| 16:45:44 | <Guest41> | @do ma >>= \a -> mf >>= \f -> return (f a) |
| 16:45:44 | <lambdabot> | do { a <- ma; f <- mf; return (f a)} |
| 16:46:15 | <Guest41> | They seem to be equal, but I could swear the behave differently |
| 16:46:50 | × | justsomeguy quits (~justsomeg@user/justsomeguy) (Ping timeout: 246 seconds) |
| 16:47:25 | <mauke[m]> | they perform the actions/effects in a different order |
| 16:47:34 | <Guest41> | yeah |
| 16:47:52 | → | justsomeguy joins (~justsomeg@user/justsomeguy) |
| 16:48:02 | <Guest41> | :t m >>= (\x -> k x >>= h) = (m >>= k) >>= h |
| 16:48:03 | <lambdabot> | error: parse error on input ‘=’ |
| 16:48:11 | <Guest41> | :t m >>= (\x -> k x >>= h) |
| 16:48:12 | <lambdabot> | error: |
| 16:48:12 | <lambdabot> | • Couldn't match expected type ‘m t0’ with actual type ‘Expr’ |
| 16:48:12 | <lambdabot> | • In the first argument of ‘(>>=)’, namely ‘m’ |
| 16:48:28 | <Guest41> | :t f m k h = m >>= (\x -> k x >>= h) |
| 16:48:29 | <lambdabot> | error: parse error on input ‘=’ |
| 16:48:40 | <mauke[m]> | :t \m k h -> m >>= (\x -> k x >>= h) |
| 16:48:41 | <lambdabot> | Monad m => m t -> (t -> m a) -> (a -> m b) -> m b |
| 16:48:51 | <Guest41> | thanks |
| 16:49:04 | <mauke[m]> | alternatively ... |
| 16:49:18 | <mauke[m]> | :t ?m >>= (\x -> ?k x >>= ?h) |
| 16:49:19 | <lambdabot> | (Monad m, ?h::a -> m b, ?k::t -> m a, ?m::m t) => m b |
| 16:51:32 | × | danza quits (~francesco@151.35.209.134) (Quit: Leaving) |
| 16:52:15 | × | justsomeguy quits (~justsomeg@user/justsomeguy) (Ping timeout: 252 seconds) |
| 16:52:22 | ← | jakalx parts (~jakalx@base.jakalx.net) (Error from remote client) |
| 16:53:02 | → | justsomeguy joins (justsomegu@user/justsomeguy) |
| 16:56:38 | <Guest41> | Well my Monad Tree also fullfills the rules of Monads, well |
| 16:57:43 | <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 |
| 16:57:56 | <mauke[m]> | fmap is also known as liftM and liftA |
| 16:58:05 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 16:58:40 | <Guest41> | Huhh, fmap and join |
| 16:58:41 | <Guest41> | I can't join my trees can I? |
| 16:59:16 | <Guest41> | @src liftM |
| 16:59:16 | <lambdabot> | liftM f m1 = do |
| 16:59:16 | <lambdabot> | x1 <- m1 |
| 16:59:16 | <lambdabot> | return (f x1) |
| 17:00:39 | → | freeside joins (~mengwong@103.252.202.159) |
| 17:01:08 | <mauke[m]> | if they're monads, you can |
| 17:01:25 | × | justsomeguy quits (justsomegu@user/justsomeguy) (Ping timeout: 252 seconds) |
| 17:01:27 | <mauke[m]> | basically, you need to be able to turn Tree (Tree a) into Tree a |
| 17:02:14 | → | morb joins (~morb@pool-72-80-94-112.nycmny.fios.verizon.net) |
| 17:03:22 | → | justsomeguy joins (~justsomeg@user/justsomeguy) |
| 17:05:05 | × | freeside quits (~mengwong@103.252.202.159) (Ping timeout: 252 seconds) |
| 17:05:45 | <Guest41> | Ah, I see... I think I added that in <*> somehwere... |
| 17:05:46 | <Guest41> | I think i am folding it from the Leafs upwards and say |
| 17:05:46 | <Guest41> | tree a subTrees is joined together with ListOfTrees as tree a (subTrees ++ ListOfTrees) |
| 17:06:19 | <Guest41> | @src mfilter |
| 17:06:19 | <lambdabot> | Source not found. That's something I cannot allow to happen. |
| 17:06:42 | → | igghibu joins (~igghibu@37.120.201.86) |
| 17:06:51 | × | morb quits (~morb@pool-72-80-94-112.nycmny.fios.verizon.net) (Ping timeout: 260 seconds) |
| 17:07:49 | <Guest41> | @do p >>= f |
| 17:07:49 | <lambdabot> | do { a <- p�; f a} |
| 17:08:20 | × | yahb2 quits (~yahb2@2a01:4f8:c0c:5c7b::2) (Remote host closed the connection) |
| 17:08:23 | <mauke[m]> | @src join |
| 17:08:23 | <lambdabot> | join x = x >>= id |
| 17:08:42 | → | yahb2 joins (~yahb2@2a01:4f8:c0c:5c7b::2) |
| 17:08:44 | × | mizlan quits (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 260 seconds) |
| 17:09:34 | <Guest41> | join just puts x into the identity? :D |
| 17:09:35 | <Guest41> | But yes I think I understand |
| 17:10:37 | <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 |
| 17:11:59 | <Guest41> | I see I see |
| 17:12:06 | <mauke[m]> | another way to look at it: join mmx = do { mx <- mmx; x <- mx; return x } |
| 17:12:37 | <mauke[m]> | but the last part, x <- mx; return x, can be simplified to just mx |
| 17:12:41 | <mauke[m]> | due to laws or something |
| 17:13:10 | <Guest41> | In mfilter: |
| 17:13:10 | <Guest41> | mfilter p ma = do |
| 17:13:11 | <mauke[m]> | @undo do { mx <- mmx; mx } |
| 17:13:11 | <lambdabot> | mmx >>= \ mx -> mx |
| 17:13:11 | <Guest41> | a <- ma |
| 17:13:11 | <Guest41> | if p a then return a else mzero |
| 17:13:12 | <Guest41> | How does "p a" evaluate to a boolean? |
| 17:13:29 | <mauke[m]> | and \mx -> mx is the identity function |
| 17:13:46 | <mauke[m]> | presumably because 'p' is a function that returns Bool? |
| 17:14:52 | <Guest41> | I think I don't get how ma is "unpacked" |
| 17:15:02 | <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` |
| 17:15:36 | <Guest41> | @undo do {a <- ma; p a } |
| 17:15:36 | <lambdabot> | ma >>= \ a -> p a |
| 17:16:09 | <Guest41> | It all boils down to >>= doesnt it |
| 17:16:22 | × | igghibu quits (~igghibu@37.120.201.86) (Quit: igghibu) |
| 17:17:24 | <geekosaur> | that's why it's mfilter instead of filter |
| 17:18:20 | <Guest41> | But >>= returns a Monoid as result |
| 17:18:21 | <Guest41> | Thats unequal to bool isn't it? |
| 17:20:20 | → | mizlan joins (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) |
| 17:20:29 | <geekosaur> | but we're not using the result of >>= as a Bool, we are applying the function passed to mfilter to get a Bool |
| 17:20:51 | <geekosaur> | (a selection function which returns True if the value it's passed is one we want) |
| 17:21:50 | <Guest41> | mfilter: |
| 17:21:50 | <Guest41> | mfilter p ma = do |
| 17:21:51 | <Guest41> | a <- ma |
| 17:21:51 | <Guest41> | if p a then return a else mzero |
| 17:21:52 | <Guest41> | mfilter rewritten:? |
| 17:21:52 | <Guest41> | mfilter p ma = if ma >>= p then return ?????? else mzero |
| 17:22:13 | <geekosaur> | wrong rewrite |
| 17:22:21 | <monochrom> | No. ma >>= \a -> if p a then ... else ... |
| 17:22:30 | <Guest41> | Yeah, I guessed, but I don't see the mistake :D |
| 17:23:16 | <monochrom> | Or, you already know how to use @undo |
| 17:23:46 | <geekosaur> | with your version, p would need to have type `a -> m b`, not `a -> Bool` |
| 17:23:51 | <mauke[m]> | @undo do { a <- ma; if p a then return a else mzero } |
| 17:23:51 | <lambdabot> | ma >>= \ a -> if p a then return a else mzero |
| 17:24:35 | <Guest41> | I see I only "undid" the part up to the if |
| 17:24:53 | <mauke[m]> | you can't just >>= into p because p has the wrong type for that |
| 17:25:01 | <mauke[m]> | and you can't use >>= as the condition in 'if' because >>= has the wrong type for that |
| 17:25:20 | <mauke[m]> | if is normal expression syntax; it is unrelated to do notation |
| 17:25:49 | <Guest41> | Also confusing that "return" wraps the value back into the Monoid... I always just think it returns from the function |
| 17:26:05 | <mauke[m]> | wait, there was a Monoid? |
| 17:26:10 | <Guest41> | "Monad" |
| 17:26:23 | <monochrom> | This is why we use "pure" instead. |
| 17:26:36 | <Guest41> | yes, pure makes so much more sense lmao |
| 17:26:41 | <mauke[m]> | yeah, I was about to say. Monoids are much simpler :-) |
| 17:26:45 | <monochrom> | In your career later you will find that all names are meaningless. |
| 17:28:09 | <Guest41> | "In my career" |
| 17:30:20 | × | califax quits (~califax@user/califx) (Ping timeout: 255 seconds) |
| 17:31:02 | <Guest41> | However I think I now understand how I used "mfilter" on my Tree :D |
| 17:31:02 | <Guest41> | It all started yesterday when I thought: "Why not derive Foldable, instead of implementing my own to List". |
| 17:31:03 | <Guest41> | And where am I now? Implementing weird Monads to use predefined filter functions instead of just redefining them |
| 17:31:35 | × | tose quits (~tose@cst-prg-38-106.cust.vodafone.cz) (Ping timeout: 246 seconds) |
| 17:32:19 | → | califax joins (~califax@user/califx) |
| 17:34:15 | → | wroathe joins (~wroathe@207-153-38-140.fttp.usinternet.com) |
| 17:34:15 | × | wroathe quits (~wroathe@207-153-38-140.fttp.usinternet.com) (Changing host) |
| 17:34:15 | → | wroathe joins (~wroathe@user/wroathe) |
| 17:36:27 | → | Cybro joins (~Cybro@cpc83049-enfi23-2-0-cust89.20-2.cable.virginm.net) |
| 17:36:57 | × | sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.) |
| 17:38:45 | → | sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 17:40:46 | <Guest41> | Can someone explain me the "<" operator? |
| 17:40:46 | <Guest41> | As in <* is somehow defined and <*> is something different and such |
| 17:40:54 | <Guest41> | Or give me a link? |
| 17:41:27 | <mizlan> | there are conventions for what they mean but there is no perfect rule or explanation |
| 17:42:09 | <mizlan> | if you look at their type signatures in ghci that should give you a good clue |
| 17:42:11 | × | Cybro quits (~Cybro@cpc83049-enfi23-2-0-cust89.20-2.cable.virginm.net) (Changing host) |
| 17:42:11 | → | Cybro joins (~Cybro@user/Cybro) |
| 17:42:27 | <mauke[m]> | @src <* |
| 17:42:27 | <lambdabot> | (<*) = liftA2 const |
| 17:42:46 | <Guest41> | Again this wird lift operator |
| 17:42:49 | <mauke[m]> | @src liftA2 |
| 17:42:49 | <lambdabot> | liftA2 f a b = f <$> a <*> b |
| 17:43:16 | <Guest41> | @src <$> |
| 17:43:16 | <lambdabot> | f <$> a = fmap f a |
| 17:43:17 | <mauke[m]> | thus (<*) = \a b -> const <$> a <*> b |
| 17:44:02 | <mauke[m]> | thus `(<*) = \a b -> fmap const a <*> b` |
| 17:44:41 | × | Cybro quits (~Cybro@user/Cybro) (Quit: Leaving) |
| 17:45:00 | → | Cybro joins (~Cybro@cpc83049-enfi23-2-0-cust89.20-2.cable.virginm.net) |
| 17:45:20 | × | Cybro quits (~Cybro@cpc83049-enfi23-2-0-cust89.20-2.cable.virginm.net) (Changing host) |
| 17:45:20 | → | Cybro joins (~Cybro@user/Cybro) |
| 17:45:29 | <Guest41> | @src const |
| 17:45:29 | <lambdabot> | const x _ = x |
| 17:45:51 | ← | Cybro parts (~Cybro@user/Cybro) () |
| 17:45:55 | <mauke[m]> | in monadic terms, `do { a <- ma; _ <- mb; pure a }` |
| 17:46:58 | <EvanR> | the types for <* and <*> kind of explain it |
| 17:47:04 | <EvanR> | :t (<*>) |
| 17:47:05 | <lambdabot> | Applicative f => f (a -> b) -> f a -> f b |
| 17:47:06 | <EvanR> | :t (<*) |
| 17:47:06 | → | Cybro joins (~Cybro@user/Cybro) |
| 17:47:07 | <lambdabot> | Applicative f => f a -> f b -> f a |
| 17:47:13 | <EvanR> | the b is discarded |
| 17:47:44 | <EvanR> | :t liftA2 |
| 17:47:45 | <lambdabot> | Applicative f => (a -> b -> c) -> f a -> f b -> f c |
| 17:47:50 | <EvanR> | b is used |
| 17:48:48 | <Guest41> | Why would you ever use "<*"? |
| 17:49:51 | <Guest41> | @src liftA2 |
| 17:49:51 | <lambdabot> | liftA2 f a b = f <$> a <*> b |
| 17:49:54 | <geekosaur> | it's useful in parsers, when you want to parse something followed by an end marker but discard the marker |
| 17:50:16 | <geekosaur> | (Applicative is really nice for parsers) |
| 17:50:26 | <Guest41> | (and for trees) |
| 17:51:03 | <monochrom> | I use "x <* y" when I want "do { m <- x; y; pure m }" |
| 17:51:18 | <mauke[m]> | let's say you want to parse an expression in parentheses. that's basically just: `token '(' *> expr <* token ')'` |
| 17:51:57 | <mauke[m]> | if you wanted to do that by hand, you'd have to write `do { token '('; x <- expr; token ')'; return x }` |
| 17:52:12 | <mauke[m]> | i.e. manually saving/passing on the return value of expr |
| 17:52:21 | ← | Cybro parts (~Cybro@user/Cybro) (Leaving) |
| 17:52:23 | → | ham joins (~ham@user/ham) |
| 17:52:44 | → | Cybro joins (~Cybro@cpc83049-enfi23-2-0-cust89.20-2.cable.virginm.net) |
| 17:52:53 | <Guest41> | what is token? |
| 17:52:56 | <Guest41> | :t token |
| 17:52:57 | <lambdabot> | error: Variable not in scope: token |
| 17:53:19 | <monochrom> | putStrLn "please enter your password" *> getLine <* putStrLn "thank you" |
| 17:53:58 | <Guest41> | So the getLine isn't printed? |
| 17:54:12 | <mauke[m]> | a hypothetical parser function |
| 17:54:22 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 252 seconds) |
| 17:54:29 | <Guest41> | I didn't deal with IO in Haskell like at all |
| 17:54:41 | × | mizlan quits (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Quit: mizlan) |
| 17:54:54 | → | mizlan joins (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) |
| 17:54:55 | <mauke[m]> | to make this work in practice, you'd probably have to define something like: `token c = char c <* whitespace` |
| 17:54:57 | <geekosaur> | in parsec we'd write `char` instead of `token`, but each parser library has its own way of doing things |
| 17:55:35 | × | Cybro quits (~Cybro@cpc83049-enfi23-2-0-cust89.20-2.cable.virginm.net) (Client Quit) |
| 17:56:14 | <EvanR> | Guest41, <* is similar to >>. Effects yes but discard the result |
| 17:56:23 | × | mizlan quits (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Client Quit) |
| 17:56:24 | <mauke[m]> | I'm not sure what you mean by "getLine isn't printed"; getLine simply reads a line of input |
| 17:56:36 | → | mizlan joins (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) |
| 17:56:39 | → | CiaoSen joins (~Jura@p200300c9571bac002a3a4dfffe84dbd5.dip0.t-ipconnect.de) |
| 17:56:49 | → | Cybro joins (~Cybro@user/Cybro) |
| 17:56:52 | <EvanR> | :t (>>) |
| 17:56:54 | <lambdabot> | Monad m => m a -> m b -> m b |
| 17:56:55 | <monochrom> | This is what happens when you ask "when is it useful?" prematurely. |
| 17:57:33 | <EvanR> | I'm still waiting for 99.99% of math to become useful xD |
| 17:57:58 | <geekosaur> | may be a long wait 🙂 |
| 17:58:27 | <Guest41> | Well most of maths already is used, just no on notices |
| 17:58:46 | <Guest41> | @src >> |
| 17:58:46 | <lambdabot> | m >> k = m >>= \_ -> k |
| 17:58:47 | <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. |
| 17:59:17 | × | mizlan quits (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Client Quit) |
| 17:59:21 | <EvanR> | the a is discarded |
| 17:59:57 | <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. |
| 17:59:57 | → | mizlan joins (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) |
| 17:59:58 | <geekosaur> | this is most useful when the a is useless, for example putStrLn produces IO () because there's nothing useful to return |
| 18:00:04 | <geekosaur> | so we use >> with it |
| 18:00:10 | × | inversed quits (~inversed@bcdcac82.skybroadband.com) (Read error: Connection reset by peer) |
| 18:00:31 | <geekosaur> | or *> as shown earlier, which is the same thing (discards its left result) |
| 18:00:43 | <monochrom> | See also https://www.youtube.com/watch?v=M4f_D17zIBw |
| 18:00:46 | × | titibandit quits (~titibandi@xdsl-89-0-163-79.nc.de) (Ping timeout: 272 seconds) |
| 18:02:13 | ← | Cybro parts (~Cybro@user/Cybro) (Leaving) |
| 18:02:53 | → | titibandit joins (~titibandi@xdsl-89-0-163-79.nc.de) |
| 18:03:55 | → | inversed joins (~inversed@bcdcac82.skybroadband.com) |
| 18:04:05 | <Guest41> | @src >> |
| 18:04:05 | <lambdabot> | m >> k = m >>= \_ -> k |
| 18:04:09 | <Guest41> | @src *> |
| 18:04:09 | <lambdabot> | (*>) = liftA2 (const id) |
| 18:04:26 | <Guest41> | isn't *> and >> just the same? |
| 18:04:36 | <EvanR> | go back to the types |
| 18:04:38 | <geekosaur[m]> | one defined via Monad, the other defined via Applicative |
| 18:04:43 | <Guest41> | :t >> |
| 18:04:44 | <lambdabot> | error: parse error on input ‘>>’ |
| 18:04:45 | <EvanR> | :t (>>) |
| 18:04:46 | <lambdabot> | Monad m => m a -> m b -> m b |
| 18:04:48 | <EvanR> | :t (*>) |
| 18:04:49 | <lambdabot> | Applicative f => f a -> f b -> f b |
| 18:05:00 | <EvanR> | *> works even if f is not a Monad |
| 18:05:02 | <Guest41> | But It does the same? |
| 18:05:08 | <EvanR> | yeah |
| 18:05:49 | <Guest41> | But Monads are older, so the feature is duplicate? |
| 18:06:09 | <EvanR> | >> is redundant now, technically |
| 18:06:30 | <Guest41> | :thumbsup: |
| 18:07:48 | <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 |
| 18:09:05 | <Guest41> | Makes sense... |
| 18:09:06 | <Guest41> | The difference to "const is", that const doesn't even evaluete its second operand? |
| 18:09:11 | <Guest41> | :t const |
| 18:09:12 | <lambdabot> | a -> b -> a |
| 18:09:22 | <Guest41> | And doesn't need Monads |
| 18:09:28 | <Guest41> | appearantly |
| 18:09:32 | × | acidjnk quits (~acidjnk@p200300d6e7137a73b4a4bff990465aaa.dip0.t-ipconnect.de) (Ping timeout: 252 seconds) |
| 18:10:36 | <monochrom> | It is very easy to observe that x <* y is different from const x y. |
| 18:10:37 | <gnalzo> | const is a function not related to Monad, nor to Applicative, even. |
| 18:10:48 | × | mizlan quits (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 260 seconds) |
| 18:11:14 | <monochrom> | For example [4] <* [1,2] vs const [4] [1,2] |
| 18:11:39 | <monochrom> | For example Just 4 <* Nothing vs const (Just 4) Nothing |
| 18:11:42 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection) |
| 18:11:50 | → | mizlan joins (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) |
| 18:11:51 | <monochrom> | I'm sure you can also find examples in your Tree monad. |
| 18:12:12 | <monochrom> | tree1 <* tree2 vs const tree1 tree2 |
| 18:12:24 | <Guest41> | Wait, so <* does't really discard the second input? |
| 18:12:47 | <monochrom> | That can also be answered by trying those examples. |
| 18:13:02 | × | bjourne quits (~bjorn@94.191.136.87.mobile.tre.se) (Read error: Connection reset by peer) |
| 18:13:05 | <monochrom> | Observe concrete examples. Don't write words. |
| 18:13:06 | × | Neuromancer quits (~Neuromanc@user/neuromancer) (Remote host closed the connection) |
| 18:13:33 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 18:13:40 | <Guest41> | I did the examples and was suprised by the result |
| 18:14:13 | <monochrom> | This is why when I teach this I just write "x <* y = liftA2 (\a b -> a) x y". |
| 18:14:23 | <geekosaur[m]> | there is a difference between discarding a value, and performing the value as an action while discarding the result |
| 18:14:34 | <Guest41> | @src liftA2 |
| 18:14:34 | <lambdabot> | liftA2 f a b = f <$> a <*> b |
| 18:15:54 | <monochrom> | I don't explain it in words, I just give the formula. Students already know liftA2. |
| 18:16:15 | <Guest41> | Well we barely now map and filter |
| 18:16:33 | <Guest41> | But map and filter are kinda boring |
| 18:17:02 | <Guest41> | So I get myself headaches with Monads :D |
| 18:18:16 | <Guest41> | x <* y = fmap (\a b -> a) (x <*> y) |
| 18:18:16 | <Guest41> | ??? |
| 18:18:23 | <Guest41> | :t <*> |
| 18:18:24 | <lambdabot> | error: parse error on input ‘<*>’ |
| 18:18:29 | <Guest41> | :t (<*>) |
| 18:18:31 | <lambdabot> | Applicative f => f (a -> b) -> f a -> f b |
| 18:18:38 | ham | is now known as hamster |
| 18:18:57 | <monochrom> | You probably didn't know that "f <$> a <*> b" means "(f <$> a) <*> b" |
| 18:20:17 | <Guest41> | x <* y = (fmap (\a b -> a) x ) <*> y) |
| 18:20:18 | <Guest41> | = (fmap \b -> x) <*> y |
| 18:20:18 | <Guest41> | ??? |
| 18:21:16 | <mauke[m]> | that doesn't look right |
| 18:21:28 | <Guest41> | Ah stupid me |
| 18:21:37 | <mauke[m]> | `fmap (\a b -> a) x` means `(fmap (\a b -> a)) x` |
| 18:21:52 | <mauke[m]> | you can't just reduce the lambda with the x |
| 18:21:59 | <Guest41> | @src fmap |
| 18:21:59 | <lambdabot> | Source not found. You untyped fool! |
| 18:22:07 | <Guest41> | @src (fmap) |
| 18:22:07 | <lambdabot> | Source not found. My mind is going. I can feel it. |
| 18:22:10 | → | unit73e joins (~emanuel@2001:818:e8dd:7c00:656:e5ff:fe72:9d36) |
| 18:22:11 | <mauke[m]> | that's a method of Functor |
| 18:22:28 | <gnalzo> | @src (<<$>) |
| 18:22:28 | <lambdabot> | Source not found. My pet ferret can type better than you! |
| 18:22:41 | <unit73e> | working on a RGSS decrypt so for RPGMaker VX and friends: https://gitlab.com/unit73e/rgss-archive |
| 18:22:41 | × | shapr quits (~user@68.54.166.125) (Read error: Connection reset by peer) |
| 18:22:44 | <unit73e> | it's still monkey code |
| 18:22:54 | → | shapr joins (~user@68.54.166.125) |
| 18:22:54 | <unit73e> | but it does work |
| 18:23:18 | <mauke[m]> | `class Functor f where { fmap :: (a -> b) -> f a -> f b }` |
| 18:23:22 | <unit73e> | it's not for illegal activities mind you, it's for personal translations |
| 18:24:04 | <unit73e> | interestingly rpg maker just serializes everything to ruby objects |
| 18:24:35 | <Guest41> | Is there a way to derive some kind of "fold" for a Tree by instanciating the right typeclasses |
| 18:24:35 | <Guest41> | (In a way it doesn't fold it as a List, but folds from the bottom upwards)? |
| 18:26:26 | <unit73e> | Guest41, idk, how do you expect it to work? traverse every element in order? |
| 18:26:29 | × | mizlan quits (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 252 seconds) |
| 18:26:54 | <unit73e> | because Tree is Traversable |
| 18:27:05 | <unit73e> | and Foldable |
| 18:27:15 | → | tremon joins (~tremon@83-85-213-108.cable.dynamic.v4.ziggo.nl) |
| 18:27:20 | <Guest41> | Something like: |
| 18:27:21 | <Guest41> | foldTree _ nilVal Nil = nilVal |
| 18:27:21 | <Guest41> | foldTree f nilVal (Node val forest) = f val (map (foldTree f nilVal) forest) |
| 18:27:22 | <Guest41> | But by using the right typeclass |
| 18:28:00 | <unit73e> | you can just use fold since Tree is Foldable |
| 18:28:00 | <monochrom> | Just write it yourself. Enough over-generalizations for a day. |
| 18:28:35 | → | mizlan joins (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) |
| 18:29:28 | <unit73e> | to me that foldTree is just the regular fold |
| 18:29:34 | <unit73e> | no? |
| 18:30:01 | <monochrom> | And Data.Tree already has it as foldTree |
| 18:30:32 | <Guest41> | But Foldable destroys the structure before folding... |
| 18:30:33 | <Guest41> | You can't fold the tree in a string like " 3 -> [Subtrees Here]" |
| 18:31:22 | → | tose joins (~tose@cst-prg-38-106.cust.vodafone.cz) |
| 18:31:31 | <unit73e> | so you want a Tree to work as an actual tree? not a datastructure that is internally a tree? |
| 18:31:52 | <unit73e> | because trees are just fast lists, if you will |
| 18:32:06 | <Guest41> | But monochrom is probably right... that was enough for me today, just learned typeclasses this morning and I need to take some break.... |
| 18:32:07 | <Guest41> | Will look at Data.Tree tomorrow as well, looks interesting |
| 18:32:27 | <unit73e> | yeah but just to give you a tip |
| 18:32:35 | <unit73e> | don't think of a tree as a real tree |
| 18:32:42 | <Guest41> | But it is a real Tree |
| 18:32:45 | <unit73e> | because then you're going to get into problems with what kind of tree |
| 18:32:50 | <unit73e> | red black tree? |
| 18:32:56 | <unit73e> | balanced tree? |
| 18:32:57 | <unit73e> | b+? |
| 18:33:14 | <unit73e> | it's a list, but the insertion order is sorted |
| 18:33:15 | <unit73e> | that's all |
| 18:33:22 | <Guest41> | Atleat mine is a Tree as in "Directed Acyclic Graph" |
| 18:33:57 | <Guest41> | Something like representing a directory Tree in |
| 18:34:15 | <Guest41> | like not a List which internally is a Tree, but just a Tree |
| 18:34:30 | <unit73e> | I see |
| 18:34:39 | <Guest41> | However: thanks all you helped me a ton :) |
| 18:35:11 | <unit73e> | you're right, it's a rose tree. silly me. ok but still, it does have what you want |
| 18:36:14 | × | mizlan quits (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 272 seconds) |
| 18:41:04 | → | mizlan joins (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) |
| 18:45:34 | × | mizlan quits (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 260 seconds) |
| 18:48:54 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection) |
| 18:49:33 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 18:50:19 | × | Guest41 quits (~Guest41@ip-084-118-041-183.um23.pools.vodafone-ip.de) (Quit: Client closed) |
| 18:52:01 | × | tose quits (~tose@cst-prg-38-106.cust.vodafone.cz) (Ping timeout: 268 seconds) |
| 18:54:27 | → | mizlan joins (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) |
| 18:54:44 | × | dsrt^ quits (~dsrt@76.145.185.103) (Remote host closed the connection) |
| 18:57:46 | × | sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.) |
| 18:58:25 | <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 |
| 18:58:33 | × | titibandit quits (~titibandi@xdsl-89-0-163-79.nc.de) (Quit: Leaving.) |
| 18:59:38 | → | sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 19:03:39 | → | slime joins (~slime@2603-9001-670a-9ce3-0000-0902-bb5b-0cd7.inf6.spectrum.com) |
| 19:04:53 | → | cheater_ joins (~Username@user/cheater) |
| 19:05:04 | × | slime quits (~slime@2603-9001-670a-9ce3-0000-0902-bb5b-0cd7.inf6.spectrum.com) (Remote host closed the connection) |
| 19:07:43 | × | cheater quits (~Username@user/cheater) (Ping timeout: 260 seconds) |
| 19:07:50 | cheater_ | is now known as cheater |
| 19:08:03 | → | tzh joins (~tzh@c-24-21-73-154.hsd1.or.comcast.net) |
| 19:09:49 | → | cheater_ joins (~Username@user/cheater) |
| 19:13:19 | × | cheater quits (~Username@user/cheater) (Ping timeout: 260 seconds) |
| 19:13:26 | cheater_ | is now known as cheater |
| 19:13:40 | → | stef204 joins (~stef204@user/stef204) |
| 19:19:45 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:b011:11:9945:c47d) |
| 19:21:27 | <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. |
| 19:21:58 | <fizbin> | I also find this bug sort of hard to believe. It's *really* weird. |
| 19:22:37 | → | jmdaemon joins (~jmdaemon@user/jmdaemon) |
| 19:22:54 | <Rembane> | fizbin: How to reproduce the bug? |
| 19:24:05 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:b011:11:9945:c47d) (Ping timeout: 255 seconds) |
| 19:24:23 | → | acidjnk joins (~acidjnk@p200300d6e7137a73b4a4bff990465aaa.dip0.t-ipconnect.de) |
| 19:31:54 | × | stef204 quits (~stef204@user/stef204) (Quit: WeeChat 3.7.1) |
| 19:32:11 | <fizbin> | Rembrane: 1) You need windows. 2) you need windows terminal. Then, a .hs file that says this will do it: main = putStrLn "\8226" |
| 19:32:20 | <fizbin> | See https://imgur.com/a/oJdsM2s |
| 19:32:53 | × | tjakway quits (~tjakway@cpe-107-184-74-161.socal.res.rr.com) (Quit: WeeChat 3.5) |
| 19:38:32 | <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 ΓÇó |
| 19:38:32 | <fizbin> | (Greek capital gamma, Latin C cedilla, Latin o acute) |
| 19:38:33 | <geekosaur[m]> | fizbin, does anything change if you use --io-manager=native? (ghc 9.0+) |
| 19:38:39 | → | bjourne joins (~bjorn@94.191.136.145.mobile.tre.se) |
| 19:39:01 | <geekosaur[m]> | using the codepage causes various breakages and is disrecommended |
| 19:40:35 | <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" |
| 19:40:59 | <geekosaur[m]> | RTS flag, iirc |
| 19:41:16 | <geekosaur[m]> | +RTS --io-manager=native -RTS |
| 19:43:55 | <fizbin> | It was accepted as an RTS flag. It didn't change anything. |
| 19:45:33 | <geekosaur[m]> | hrm |
| 19:45:55 | <geekosaur[m]> | Phyx- doesn't seem to be around in here, sadly |
| 19:46:09 | <geekosaur[m]> | probably the best person to talk to about Windows I/O issues |
| 19:46:38 | <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. |
| 19:46:54 | <fizbin> | That's what makes me say this is a double-encoding issue. |
| 19:47:27 | <EvanR> | windows isn't unicode still? |
| 19:47:46 | <fizbin> | For extra fun, the behavior on a cmd.exe window is different. |
| 19:47:56 | <fizbin> | EvanR: well.... |
| 19:48:06 | <EvanR> | by windows terminal I thought you meant cmd.exe |
| 19:48:13 | <geekosaur[m]> | windows is unicode but requuires a completely different API for console unicode |
| 19:48:13 | <monochrom> | Windows is unicode, but windows console retains the codepage system. |
| 19:48:15 | <fizbin> | So, what part of windows? |
| 19:48:19 | <geekosaur[m]> | that's what the new io manager is about |
| 19:48:46 | <monochrom> | Hmm what if you're in powershell? |
| 19:49:15 | <fizbin> | monochrom: powershell invoked as itself, or from cmd? |
| 19:49:26 | <monochrom> | invoked as itself |
| 19:49:32 | → | cheater_ joins (~Username@user/cheater) |
| 19:49:48 | <fizbin> | Powershell invoked as itself (modern versions) gets you the windows terminal window I was talking about initially. |
| 19:49:58 | <monochrom> | Ah OK. |
| 19:50:01 | <geekosaur[m]> | actually now I wonder if runhaskell needs to be invoked in a way that passes the RTS options on |
| 19:50:14 | <geekosaur[m]> | or use $GHCRTS, however you do that on Windows |
| 19:51:57 | <fizbin> | geekosaur[m]: Ah! |
| 19:52:12 | <fizbin> | Yes, passing the options on gets me something that seems to work. |
| 19:52:47 | <monochrom> | Wait, passing on to whom? |
| 19:53:02 | × | cheater quits (~Username@user/cheater) (Ping timeout: 246 seconds) |
| 19:53:18 | cheater_ | is now known as cheater |
| 19:53:25 | <geekosaur[m]> | runhaskell is a wrapper for ghc |
| 19:53:59 | <geekosaur[m]> | the hint there is ghc complaining about the --io-manager=native option passed directly instead of as an RTS option |
| 19:54:23 | <geekosaur[m]> | instead of runhaskell complaining about it |
| 19:55:36 | <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. |
| 19:56:58 | <geekosaur[m]> | runhaskell --ghc-arg=+RTS --ghc-arg=--io-manager=native --ghc-arg=-RTS … |
| 19:57:01 | <geekosaur[m]> | …ick |
| 19:57:17 | <fizbin> | You'd think runhaskell-9.4.2.exe --ghc-arg=-with-rtsopts=--io-manager=native tmp.hs would work, but no. |
| 19:57:26 | <geekosaur[m]> | I think this is documented in the ghc manual somewhere |
| 19:58:35 | × | mizlan quits (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 246 seconds) |
| 19:59:17 | <fizbin> | Yeah, the three-ghc-arg thing worked. |
| 19:59:20 | <geekosaur[m]> | oh, apparently this should work too: runhaskell -- +RTS --io-manager=native -RTS … |
| 19:59:31 | <geekosaur[m]> | (note the --) |
| 20:00:11 | → | mizlan joins (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) |
| 20:00:32 | <fizbin> | Nope, that (runhaskell-9.4.2.exe tmp.hs -- +RTS --io-manager=native -RTS) doesn't work. |
| 20:01:04 | <geekosaur[m]> | the -- and RTS opts have to come before the program name, according to the runhaskell manual |
| 20:01:46 | <fizbin> | Also no, but the error message is fun and different. |
| 20:01:57 | <geekosaur[m]> | interesting |
| 20:02:27 | <fizbin> | https://paste.tomsmeding.com/fOLcJq6o |
| 20:03:12 | <monochrom> | You need a second -- -_- |
| 20:03:28 | <monochrom> | runhaskell -- +RTS ... -RTS -- tmp.hs |
| 20:03:54 | <monochrom> | But I haven't tested it. I'm just marvelling at the complexity implied by the user guide... |
| 20:04:12 | → | pavonia joins (~user@user/siracusa) |
| 20:05:07 | <geekosaur[m]> | yeh |
| 20:05:49 | <fizbin> | monochrom: also no. Same error as without the second -- |
| 20:08:26 | <fizbin> | https://paste.tomsmeding.com/1iuGVIih |
| 20:08:54 | <fizbin> | As you can see, the only thing that worked is the three-ghc-arg thing. |
| 20:10:27 | <geekosaur[m]> | oh, I see why that weirdness at the end, it's recommending `min' with ghc's usual fancy unicode quotes |
| 20:12:05 | <fizbin> | yeah. |
| 20:12:05 | × | bjourne quits (~bjorn@94.191.136.145.mobile.tre.se) (Read error: Connection reset by peer) |
| 20:12:46 | <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. |
| 20:13:29 | <geekosaur[m]> | there's an option somewhere that turns off the unicode stuff in errors/warnings |
| 20:13:38 | <geekosaur[m]> | piping through a command might also do so |
| 20:14:54 | <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? |
| 20:15:28 | <geekosaur[m]> | one does not simply learn category theory… |
| 20:16:18 | × | ChaiTRex quits (~ChaiTRex@user/chaitrex) (Remote host closed the connection) |
| 20:16:54 | → | ChaiTRex joins (~ChaiTRex@user/chaitrex) |
| 20:21:49 | × | jmdaemon quits (~jmdaemon@user/jmdaemon) (Quit: ZNC 1.8.2 - https://znc.in) |
| 20:23:30 | → | jmdaemon joins (~jmdaemon@user/jmdaemon) |
| 20:25:38 | → | cheater_ joins (~Username@user/cheater) |
| 20:26:32 | → | lortabac joins (~lortabac@2a01:e0a:541:b8f0:7b3b:ad71:81a3:47e4) |
| 20:26:53 | → | cheater__ joins (~Username@user/cheater) |
| 20:27:27 | <eldritchcookie[4> | cool do you recommend any books for begginers? |
| 20:27:51 | <Jadesheit[m]> | https://github.com/hmemcpy/milewski-ctfp-pdf |
| 20:27:58 | <Jadesheit[m]> | This was a good read imo |
| 20:27:59 | × | cheater quits (~Username@user/cheater) (Ping timeout: 255 seconds) |
| 20:28:09 | cheater__ | is now known as cheater |
| 20:28:13 | <Jadesheit[m]> | s/imo/for me/ |
| 20:29:58 | × | cheater_ quits (~Username@user/cheater) (Ping timeout: 252 seconds) |
| 20:35:28 | × | CiaoSen quits (~Jura@p200300c9571bac002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 260 seconds) |
| 20:35:48 | × | jrm quits (~jrm@user/jrm) (Quit: ciao) |
| 20:36:08 | → | jrm joins (~jrm@user/jrm) |
| 20:36:38 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 255 seconds) |
| 20:38:32 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 20:39:41 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 20:41:32 | → | titibandit joins (~titibandi@xdsl-89-0-163-79.nc.de) |
| 20:47:50 | × | trev quits (~trev@user/trev) (Remote host closed the connection) |
| 20:48:43 | → | bjourne joins (~bjorn@94.191.136.96.mobile.tre.se) |
| 20:53:03 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:b011:11:9945:c47d) |
| 20:57:52 | → | freeside joins (~mengwong@103.252.202.159) |
| 20:58:01 | × | sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.) |
| 20:59:18 | <dmj`> | eldritchcookie[4: there's #categorytheory as well |
| 20:59:18 | → | sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 21:01:40 | × | mei quits (~mei@user/mei) (Quit: mei) |
| 21:01:56 | × | freeside quits (~mengwong@103.252.202.159) (Ping timeout: 246 seconds) |
| 21:08:15 | × | mizlan quits (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 260 seconds) |
| 21:08:17 | → | emmanuelux joins (~emmanuelu@user/emmanuelux) |
| 21:08:59 | → | mizlan joins (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) |
| 21:10:00 | → | freeside joins (~mengwong@103.252.202.159) |
| 21:11:35 | <unit73e> | eldritchcookie[4, to me there was only one way to learn, just doing it |
| 21:12:13 | × | cods quits (~fred@82-65-232-44.subs.proxad.net) (Ping timeout: 260 seconds) |
| 21:12:26 | → | cods joins (~fred@82-65-232-44.subs.proxad.net) |
| 21:12:40 | <unit73e> | the biggest problem you will probably have is how to structure code with do blocks, monads, and applicatives |
| 21:12:59 | <unit73e> | at least that was the biggest one for me |
| 21:13:00 | → | beefbambi joins (~beefbambi@183.82.31.45) |
| 21:13:44 | <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 |
| 21:13:57 | <unit73e> | other than that haskell is very simple |
| 21:14:19 | × | freeside quits (~mengwong@103.252.202.159) (Ping timeout: 260 seconds) |
| 21:15:25 | <unit73e> | I should probably switch to NixOS one of these days but I'm too lazy |
| 21:15:51 | × | sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.) |
| 21:16:58 | → | sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 21:18:34 | <jean-paul[m]> | nixos is a good investment in future laziness |
| 21:18:44 | <jean-paul[m]> | not as good an investment as a hammock, but still |
| 21:23:25 | × | lortabac quits (~lortabac@2a01:e0a:541:b8f0:7b3b:ad71:81a3:47e4) (Quit: WeeChat 2.8) |
| 21:27:05 | → | wroathe joins (~wroathe@207-153-38-140.fttp.usinternet.com) |
| 21:27:05 | × | wroathe quits (~wroathe@207-153-38-140.fttp.usinternet.com) (Changing host) |
| 21:27:05 | → | wroathe joins (~wroathe@user/wroathe) |
| 21:32:26 | × | hgolden_ quits (~hgolden@cpe-172-251-233-141.socal.res.rr.com) (Remote host closed the connection) |
| 21:35:21 | × | sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.) |
| 21:36:37 | → | sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 21:37:38 | × | iqubic quits (~avi@2601:602:9502:c70:7d73:32ff:58fe:6d27) (Remote host closed the connection) |
| 21:41:48 | × | bjourne quits (~bjorn@94.191.136.96.mobile.tre.se) (Read error: Connection reset by peer) |
| 21:44:48 | × | briandaed quits (~briandaed@185.234.210.211.r.toneticgroup.pl) (Quit: leaving) |
| 21:46:24 | → | hgolden joins (~hgolden@cpe-172-251-233-141.socal.res.rr.com) |
| 21:48:50 | <ggVGc> | good investment for future need of storage space |
| 21:48:50 | × | Vajb quits (~Vajb@2001:999:405:5eb2:8d39:b832:a9ee:9bdf) (Read error: Connection reset by peer) |
| 21:49:35 | → | Vajb joins (~Vajb@hag-jnsbng11-58c3a5-27.dhcp.inet.fi) |
| 21:49:41 | <Hecate> | don't forget to use btrf + fs compression with zstd for your nix partition |
| 21:50:43 | <geekosaur[m]> | not that loading a bunch of stuff via flatpak is much better |
| 21:50:45 | <ggVGc> | unit73e: Haskell might be somewhat "simple", but I'd argue GHC with its extensions definitely are not |
| 21:51:09 | <geekosaur[m]> | I will note that that discussion started with things like parameterized monads |
| 21:51:23 | <geekosaur[m]> | (indexed monads, I assume) |
| 21:51:28 | <ggVGc> | especially since some of them even overlap in functionality? |
| 21:51:28 | <geekosaur[m]> | so we're already kinda not talking Haskell |
| 21:52:39 | <geekosaur[m]> | and for some of them the interactions aren't even known much less documented or standardized |
| 21:53:14 | <geekosaur[m]> | which is one reason this stuff hasn't been presented for standardization |
| 21:56:44 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 255 seconds) |
| 21:57:21 | <geekosaur[m]> | hm, which also makes me think those symbols eldritch cookie was talking about might be type theory instead of category theory |
| 21:58:39 | × | beefbambi quits (~beefbambi@183.82.31.45) (Read error: Connection reset by peer) |
| 21:58:40 | <eldritchcookie[4> | they might be |
| 21:59:16 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 22:05:17 | × | ChaiTRex quits (~ChaiTRex@user/chaitrex) (Ping timeout: 255 seconds) |
| 22:05:54 | → | ChaiTRex joins (~ChaiTRex@user/chaitrex) |
| 22:06:28 | <eldritchcookie[4> | i noticed a thing about indexed monads they are even harder to compose than normal monads |
| 22:07:48 | <Rembane> | eldritchcookie[4: How? |
| 22:09:56 | <eldritchcookie[4> | well it isn't as straightforward to define transformers for them |
| 22:10:16 | <geekosaur[m]> | (okay, looking at your paper, that's definitely CT) |
| 22:10:42 | <eldritchcookie[4> | cool i at least know what i don't know nice |
| 22:12:37 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 22:12:43 | × | mizlan quits (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) (Ping timeout: 252 seconds) |
| 22:17:05 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 260 seconds) |
| 22:17:17 | <unit73e> | ggVGc, so nixos makes a lot of copies of different versions of the same package? that's the issue? |
| 22:17:41 | <unit73e> | also yes, with extensions haskell gets somewhat more complex, but I'd say scala is way more complex |
| 22:17:48 | <unit73e> | or even java |
| 22:18:04 | <geekosaur[m]> | yes, because you may need to use an older version. otoh you can gc older versions if you don't need them |
| 22:18:12 | <unit73e> | well, that's not that bad |
| 22:18:18 | <unit73e> | I think |
| 22:18:57 | <unit73e> | so it's the same approach as cabal, so results are predictable |
| 22:19:04 | <geekosaur[m]> | but you also end up duplicating your installed system because nix goes out of its way to avoid using system packages |
| 22:19:34 | <unit73e> | I see, that does suck somewhat |
| 22:19:54 | <unit73e> | I'm still on arch but at least I could experiment |
| 22:20:38 | <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. |
| 22:21:28 | <geekosaur[m]> | with respect to haskell libs they're all standalone. system libs are another question |
| 22:21:57 | <geekosaur[m]> | (unless you use -dynamic for some reason. which you might, since you're on arch) |
| 22:22:20 | <unit73e> | I'm not, I'm using ghcup to avoid all of those problems |
| 22:22:31 | <unit73e> | arch is crap with haskell... sadly |
| 22:26:25 | → | mizlan joins (~mizlan@c-67-169-7-31.hsd1.ca.comcast.net) |
| 22:27:29 | <unit73e> | but anyway, what I mean is if cabal can create an executable with the libraries included |
| 22:27:43 | <unit73e> | or maybe it does that already? |
| 22:27:49 | <ggVGc> | unit73e: in my personal experience, if using nix seriously, one should count on 50-100gb of nix-store |
| 22:30:43 | <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 |
| 22:30:57 | <unit73e> | should be enough for my needs |
| 22:32:38 | <eldritchcookie[4> | nix is not docker it won't waste too much space |
| 22:34:08 | → | beefbambi joins (~beefbambi@183.82.31.45) |
| 22:34:50 | <unit73e> | modern games take a lot of space but other than that |
| 22:34:59 | <unit73e> | and I'm not a fan of modern games |
| 22:35:24 | <unit73e> | if I want to play a walk simulator I will just go outside do real walking |
| 22:38:18 | <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. |
| 22:39:03 | <unit73e> | sm, alright, I have to check that. it would be weird for stack to be able to do that but not cabal. |
| 22:39:23 | <unit73e> | thanks |
| 22:39:50 | × | gnalzo quits (~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c) (Quit: WeeChat 3.7.1) |
| 22:40:20 | <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 |
| 22:45:44 | × | justsomeguy quits (~justsomeg@user/justsomeguy) (Ping timeout: 268 seconds) |
| 22:46:27 | → | justsomeguy joins (~justsomeg@user/justsomeguy) |
| 22:51:08 | <sm> | maybe using upx or similar packer is a way |
| 22:51:40 | <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." |
| 22:52:14 | × | titibandit quits (~titibandi@xdsl-89-0-163-79.nc.de) (Quit: Leaving.) |
| 22:52:25 | <sm> | "UPX will typically reduce the file size of programs and DLLs by around 50%-70%" |
| 22:52:50 | <sm> | nice, looks like it had a major release recently |
| 22:54:12 | × | mc47 quits (~mc47@xmonad/TheMC47) (Remote host closed the connection) |
| 22:56:02 | <DigitalKiwi> | https://github.com/nh2/static-haskell-nix |
| 22:57:19 | <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/ |
| 22:58:22 | <DigitalKiwi> | ggVGc: i have nixos on production servers with 25GB of storage lol |
| 22:58:43 | <DigitalKiwi> | you only need a lot for nix-store if you don't nix collect garbage |
| 22:59:36 | <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 |
| 23:00:23 | geekosaur[m] | feels old |
| 23:00:43 | <DigitalKiwi> | and having remote builders with more storage would be helpful if you were into that sort of thing lol |
| 23:01:37 | <DigitalKiwi> | geekosaur[m]: i have computers with 20GB spinning rust hard drives lol |
| 23:01:55 | <DigitalKiwi> | booted one up a while ago it still had i686 arch on it heh |
| 23:02:29 | <geekosaur[m]> | I still remember getting our first 1GB drive |
| 23:02:37 | × | coot quits (~coot@213.134.171.3) (Quit: coot) |
| 23:02:38 | <davean> | http://www.toms.net/rb/ |
| 23:02:45 | <DigitalKiwi> | have a PII or PIII laptop but it's got some problems :( |
| 23:03:00 | <geekosaur[m]> | and getting a ridic large 80MB HD for my home machine |
| 23:03:03 | <DigitalKiwi> | i still have my first 2GB usb drive |
| 23:03:38 | <DigitalKiwi> | i have a 2GB CF(II?) drive hahaha |
| 23:05:14 | <DigitalKiwi> | https://periodictable.com/Samples/CompactFlashHardDrive/s13.JPG lol |
| 23:05:23 | → | torro_64 joins (~torben@146.70.117.187) |
| 23:06:50 | × | emmanuelux quits (~emmanuelu@user/emmanuelux) (Read error: Connection reset by peer) |
| 23:06:53 | <DigitalKiwi> | i used to have a 4GB hitachi like that but it got stolen with my canon 300D i think :( |
| 23:07:05 | → | emmanuelux joins (~emmanuelu@user/emmanuelux) |
| 23:08:07 | <ggVGc> | DigitalKiwi: running a server with specialised needs and running an everyday computer system is fairly different though? |
| 23:08:19 | ← | torro_64 parts (~torben@146.70.117.187) () |
| 23:08:43 | <davean> | ggVGc: I mean the every day computer generally has more software, but its just a difference of scale not type generally. |
| 23:09:09 | <ggVGc> | not sure how that relates to nix taking a lot of system space? |
| 23:09:35 | <davean> | nix will take up more on most everyday computers, but he's saying about how it uses disk space in general. |
| 23:09:37 | <DigitalKiwi> | most every day computers probably have more storage available than a $6 droplet though |
| 23:09:51 | <davean> | Basicly, nix doesn't cause disk space issues. |
| 23:09:55 | <davean> | no more than any distro does |
| 23:10:09 | <davean> | (as long as you run gc) |
| 23:10:24 | → | random-jellyfish joins (~random-je@user/random-jellyfish) |
| 23:10:43 | <DigitalKiwi> | if you never nix-collect-garbage nix would easily use all of the space eventually but if you didn't it'd use not much more than any os |
| 23:11:26 | <DigitalKiwi> | s/didn't/did/ |
| 23:11:30 | <davean> | if you use gc every time you change packages, it would use very close to the same as most distros. less than some, more than others. |
| 23:11:52 | <ggVGc> | how large are your /nix dirs right now? |
| 23:12:04 | <davean> | 65.4G for my desktop |
| 23:12:08 | × | albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection) |
| 23:12:11 | <DigitalKiwi> | https://twitter.com/ArchKiwi/ recovering arch user lol |
| 23:12:12 | <davean> | I ahven't gced in a while though |
| 23:12:29 | <ggVGc> | so that falls in the range of 50-100gb like I said |
| 23:12:47 | <geekosaur[m]> | that's not necessarily a good comparison, unless you also compare to the same thing installed from (non-nixos) distro packages |
| 23:13:30 | <davean> | well, again, I haven't GCed in a while |
| 23:13:41 | <davean> | I've got like ... everything installed. |
| 23:13:43 | <DigitalKiwi> | [nixos@MSI-16Q4:~]$ du -sh /nix/ |
| 23:13:43 | <DigitalKiwi> | 26G /nix/ |
| 23:14:03 | <DigitalKiwi> | i've never nix-collect-garbage in this vm though |
| 23:14:05 | <davean> | I've got 4 or 5 ghc versions, ghcjs, several full machine learning envs ... |
| 23:15:58 | <davean> | 30.1G after a gc it looks like, though I'm sure I have a lot of trash roots laying around. |
| 23:18:16 | → | albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8) |
| 23:18:43 | <davean> | though yah, for a desktop machine I think 50GiB lets you think about it less. |
| 23:20:25 | × | __monty__ quits (~toonn@user/toonn) (Quit: leaving) |
| 23:21:56 | × | hgolden quits (~hgolden@cpe-172-251-233-141.socal.res.rr.com) (Remote host closed the connection) |
| 23:22:17 | <DigitalKiwi> | https://www.dropbox.com/s/3bmiz61sptuk2ys/2022-12-30%2017.08.47.jpg?dl=0 geekosaur[m] feel older or younger yet |
| 23:23:36 | <unit73e> | is ExceptT the decent way to handle errors nowadays? |
| 23:23:41 | <unit73e> | or there's yet another? |
| 23:23:42 | <geekosaur[m]> | doesn't change the fact that I still remember tiny HDDs for PC-class (not even AT!) machines |
| 23:24:14 | <geekosaur[m]> | unit73e, `ExceptT` should be it |
| 23:24:26 | <unit73e> | geekosaur[m], thanks |
| 23:24:34 | <unit73e> | Speaking of HDD |
| 23:24:37 | <DigitalKiwi> | oh i do too lol i might even have the platters for a maybe 10-36MB drive that are as big as vinyl records |
| 23:25:08 | <unit73e> | my first computer was an am386 dx4 with 40MHz and I believe a chunky 40MB HDD |
| 23:25:15 | <DigitalKiwi> | from a system/36 iirc |
| 23:25:35 | <geekosaur[m]> | like at my first real job 😀 |
| 23:25:37 | <unit73e> | much later I found out it was one the first AMD CPUs, that was not intel |
| 23:25:44 | <DigitalKiwi> | or maybe a system/32 |
| 23:25:49 | <DigitalKiwi> | i'm not sure anymore |
| 23:26:08 | <unit73e> | it had a turbo button |
| 23:26:25 | <DigitalKiwi> | the first computer i build was a pII 266 iirc |
| 23:26:36 | <DigitalKiwi> | 233? |
| 23:26:40 | <DigitalKiwi> | MHz |
| 23:26:40 | → | hgolden joins (~hgolden@cpe-172-251-233-141.socal.res.rr.com) |
| 23:27:07 | <DigitalKiwi> | hahaha turbo button |
| 23:27:16 | <geekosaur[m]> | 486, 20MHz, 2nd CPU socket that I didn't populate until 1997ish |
| 23:27:32 | <geekosaur[m]> | wait, was it 20MHz? don't recall any more |
| 23:28:28 | <DigitalKiwi> | https://en.wikipedia.org/wiki/TRS-80_Model_100 |
| 23:28:29 | <unit73e> | could be 20MHz, the first i486 did have 20MHz |
| 23:28:32 | <DigitalKiwi> | first computer i wrote a program for |
| 23:29:01 | <DigitalKiwi> | still have it in the basement |
| 23:29:25 | <DigitalKiwi> | CPU 2.4 MHz Intel 80C85 |
| 23:29:26 | <geekosaur[m]> | had one of those too BITD |
| 23:29:53 | <geekosaur[m]> | did my time logging for my second employer on it |
| 23:30:14 | <DigitalKiwi> | my dad worked for radio shack like 30-40(+) years ago lol |
| 23:30:25 | <unit73e> | I also had a zx spectrum 48k and later 128k but are those even computers? I guess they did have basic |
| 23:30:38 | <unit73e> | funny 5min loading machines |
| 23:30:42 | <geekosaur[m]> | very small computers, but computers |
| 23:30:43 | <unit73e> | only to fail with a red screen |
| 23:30:51 | <juri_> | is there a sane way to test whether two passed in types of the same typeclass are the same type, and use Eq against them if they are? |
| 23:30:59 | <geekosaur[m]> | anyone else remember the pocket computer? |
| 23:31:13 | <geekosaur[m]> | juri_, no |
| 23:31:28 | <DigitalKiwi> | i have a lot of pocket computers but they're called phones these days |
| 23:31:31 | <geekosaur[m]> | unless the typeclass itself permits it |
| 23:31:56 | <geekosaur[m]> | 1 32-character line display |
| 23:32:16 | <geekosaur[m]> | Sharp sold it, eventually Radio Shack started selling a rebranded one |
| 23:32:23 | <DigitalKiwi> | https://en.wikipedia.org/wiki/Pocket_computer |
| 23:32:48 | <DigitalKiwi> | i have seen those never had one |
| 23:32:58 | <geekosaur[m]> | juri_, this may include adding `Typeable` to constraints and using `TypeRep` |
| 23:33:14 | <juri_> | DigitalKiwi: i had one of those. |
| 23:33:49 | <unit73e> | I bet it's more of an american thing, those pocket computers |
| 23:33:54 | <unit73e> | radioshack |
| 23:34:14 | <unit73e> | because I never heard of those |
| 23:34:50 | <DigitalKiwi> | i still have my old TI-83 Plus the other day it didn't turn on i about had a heart attack |
| 23:35:13 | <unit73e> | but tbf I never heard of all the magical japanese computers either that sometimes showed up in game magazines with amazing graphics until much later |
| 23:36:04 | <juri_> | geekosaur[m]: thanks, that looks useful. |
| 23:36:36 | <geekosaur[m]> | I list my HP48 during my last move ☹️ |
| 23:36:43 | <geekosaur[m]> | *lost |
| 23:37:06 | <geekosaur[m]> | otoh I have an HP41 emulator as the calculator on my phone |
| 23:37:27 | <juri_> | I've lost everything twice. i don't think i really appreciated what i haad. |
| 23:37:36 | → | finsternis joins (~X@23.226.237.192) |
| 23:37:38 | <DigitalKiwi> | i have ghci in nix-on-droid on my phone lol |
| 23:39:26 | <geekosaur[m]> | my boss in my 2nd job had a cellphone. it was the size of a small briefcase |
| 23:40:02 | <DigitalKiwi> | my dad used to have one of those bag phones |
| 23:40:18 | <unit73e> | did those launch nuclear bombs? because it sure looked like it |
| 23:40:55 | <unit73e> | nix-on-droid would have been useful when I was learning haskell |
| 23:41:06 | <DigitalKiwi> | couldn't tell you if i knew ;) |
| 23:41:49 | <DigitalKiwi> | it's probably more useful if you know haskell even ;D |
| 23:41:53 | <geekosaur[m]> | some to think of it, even "small briefcase" was misleading because it was something like half heatsink |
| 23:42:27 | <DigitalKiwi> | yeah that were a big block of metal and battery lol |
| 23:42:37 | <geekosaur[m]> | s/some/come/ |
| 23:45:16 | <unit73e> | I remember seeing one of those in a car and I being a stupid kid when everyone was amazed "just a phone bruh, what's so amazing?" |
| 23:45:34 | <unit73e> | but I guess I was right, it really was just a phone |
| 23:46:09 | <unit73e> | with a huge battery and antenna |
| 23:50:22 | <darkling> | I've still got my dad's HP41CV, with all the trimmings. |
| 23:50:31 | <darkling> | Keyboard needs a new membrane, though. :( |
| 23:51:00 | <DigitalKiwi> | https://youtu.be/694TX2lQ7Uo LMAO |
| 23:53:43 | <DigitalKiwi> | https://radioshackcatalogs.com/flipbook/1989_radioshack_catalog.html page 4 |
| 23:56:41 | → | lottaquestions joins (~nick@2607:fa49:503e:7100:a37:6c2e:5bc7:b05c) |
All times are in UTC on 2022-12-30.