Logs: freenode/#haskell
| 2020-10-16 00:46:22 | × | unlink2 quits (~unlink2@p200300ebcf17c500f1cd4c5efbdddd1e.dip0.t-ipconnect.de) (Ping timeout: 260 seconds) |
| 2020-10-16 00:48:29 | → | thir joins (~thir@p200300f27f025800e5e58f362e8b888e.dip0.t-ipconnect.de) |
| 2020-10-16 00:49:51 | × | carlomagno quits (~cararell@inet-hqmc01-o.oracle.com) (Remote host closed the connection) |
| 2020-10-16 00:50:47 | → | carlomagno joins (~cararell@inet-hqmc02-o.oracle.com) |
| 2020-10-16 00:52:27 | × | Deide quits (~Deide@217.155.19.23) (Quit: Seeee yaaaa) |
| 2020-10-16 00:53:22 | × | thir quits (~thir@p200300f27f025800e5e58f362e8b888e.dip0.t-ipconnect.de) (Ping timeout: 260 seconds) |
| 2020-10-16 00:55:40 | × | OmegaDoug quits (8e750cd2@lnsm3-torontoxn-142-117-12-210.internet.virginmobile.ca) (Remote host closed the connection) |
| 2020-10-16 00:57:46 | × | mozzarella quits (~sam@unaffiliated/sam113101) (Quit: WeeChat 2.8) |
| 2020-10-16 00:58:34 | → | nbloomf joins (~nbloomf@2600:1700:83e0:1f40:55b2:236:b746:75d5) |
| 2020-10-16 00:58:45 | × | da39a3ee5e6b4b0d quits (~textual@n11211935170.netvigator.com) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 2020-10-16 01:00:53 | × | nbloomf quits (~nbloomf@2600:1700:83e0:1f40:55b2:236:b746:75d5) (Client Quit) |
| 2020-10-16 01:01:24 | × | acarrico quits (~acarrico@dhcp-68-142-39-249.greenmountainaccess.net) (Ping timeout: 256 seconds) |
| 2020-10-16 01:02:50 | → | nbloomf joins (~nbloomf@2600:1700:83e0:1f40:55b2:236:b746:75d5) |
| 2020-10-16 01:03:27 | × | heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 2020-10-16 01:03:45 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2020-10-16 01:04:53 | × | xff0x quits (~fox@2001:1a81:5350:d900:f127:8532:42d4:579b) (Ping timeout: 246 seconds) |
| 2020-10-16 01:05:48 | → | plutoniix joins (~q@175.176.222.7) |
| 2020-10-16 01:06:49 | → | xff0x joins (~fox@2001:1a81:538a:0:f127:8532:42d4:579b) |
| 2020-10-16 01:08:07 | × | raehik quits (~raehik@cpc96984-rdng25-2-0-cust109.15-3.cable.virginm.net) (Ping timeout: 260 seconds) |
| 2020-10-16 01:08:21 | → | GyroW joins (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be) |
| 2020-10-16 01:08:22 | × | GyroW quits (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be) (Changing host) |
| 2020-10-16 01:08:22 | → | GyroW joins (~GyroW@unaffiliated/gyrow) |
| 2020-10-16 01:09:03 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 260 seconds) |
| 2020-10-16 01:09:31 | × | GyroW_ quits (~GyroW@unaffiliated/gyrow) (Ping timeout: 260 seconds) |
| 2020-10-16 01:09:43 | × | Rudd0 quits (~Rudd0@185.189.115.103) (Ping timeout: 260 seconds) |
| 2020-10-16 01:11:05 | × | Tario quits (~Tario@201.192.165.173) (Read error: Connection reset by peer) |
| 2020-10-16 01:16:22 | → | acarrico joins (~acarrico@dhcp-68-142-39-249.greenmountainaccess.net) |
| 2020-10-16 01:23:10 | → | crestfallen joins (~jvw@135.180.15.188) |
| 2020-10-16 01:23:15 | → | thir joins (~thir@p200300f27f02580070028f68706a1e08.dip0.t-ipconnect.de) |
| 2020-10-16 01:24:10 | → | Tario joins (~Tario@201.192.165.173) |
| 2020-10-16 01:27:23 | × | nineonine quits (~nineonine@50.216.62.2) (Remote host closed the connection) |
| 2020-10-16 01:27:25 | × | thir quits (~thir@p200300f27f02580070028f68706a1e08.dip0.t-ipconnect.de) (Ping timeout: 240 seconds) |
| 2020-10-16 01:28:16 | → | heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) |
| 2020-10-16 01:28:19 | → | mozzarella joins (~sam@unaffiliated/sam113101) |
| 2020-10-16 01:29:54 | <crestfallen> | hi in line 29 we have do {ma <- mma; ma} so this behaves like bind, but there is no indication of (>>= id) . Does that work solely on how mma and ma are named in " mma <- ma " ? https://github.com/varreli/haskell/blob/master/monads/joinBind.txt |
| 2020-10-16 01:30:54 | × | heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 2020-10-16 01:31:10 | → | heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) |
| 2020-10-16 01:32:32 | → | irc_user joins (uid423822@gateway/web/irccloud.com/x-tarrfebyaowlqxvj) |
| 2020-10-16 01:33:49 | <crestfallen> | correction {ma <- mma} |
| 2020-10-16 01:34:11 | <koz_> | crestfallen: If you look right above, it explains how bind relates to join. Then, you can read about do-notation to see how it desugars into bind. |
| 2020-10-16 01:34:19 | <Axman6> | I don't understand the quetion, but the names don't matter at all |
| 2020-10-16 01:34:32 | <koz_> | Literally look up the desugaring of do-notation, and rewrite that example with explicit use of return and bind. |
| 2020-10-16 01:34:37 | <koz_> | It'll be quite enlightening. |
| 2020-10-16 01:34:56 | <Axman6> | m do {ma <- mma; ma} becomes mma >>= \ma -> ma, aka mma >>= id |
| 2020-10-16 01:35:18 | <koz_> | Axman6: So much mixed martial arts. :P |
| 2020-10-16 01:35:43 | × | Kaiepi quits (~Kaiepi@nwcsnbsc03w-47-55-225-82.dhcp-dynamic.fibreop.nb.bellaliant.net) (Remote host closed the connection) |
| 2020-10-16 01:36:07 | → | Kaiepi joins (~Kaiepi@nwcsnbsc03w-47-55-225-82.dhcp-dynamic.fibreop.nb.bellaliant.net) |
| 2020-10-16 01:38:57 | × | cr3 quits (~cr3@192-222-143-195.qc.cable.ebox.net) (Ping timeout: 256 seconds) |
| 2020-10-16 01:39:01 | <crestfallen> | koz_: Axman6: all do notation desugars into bind? |
| 2020-10-16 01:39:08 | <koz_> | crestfallen: Yes, and return. |
| 2020-10-16 01:39:28 | <crestfallen> | hold on please, not what I believed.. |
| 2020-10-16 01:40:28 | <crestfallen> | I understand well the unification above you pointed out koz_ . |
| 2020-10-16 01:41:03 | × | m0rphism quits (~m0rphism@HSI-KBW-046-005-177-122.hsi8.kabel-badenwuerttemberg.de) (Ping timeout: 258 seconds) |
| 2020-10-16 01:41:19 | <crestfallen> | ... |
| 2020-10-16 01:43:30 | <crestfallen> | so if you have it looking like this: |
| 2020-10-16 01:43:56 | <crestfallen> | (>>=) (Just (Just 5)) id |
| 2020-10-16 01:44:16 | → | nineonine joins (~nineonine@50.216.62.2) |
| 2020-10-16 01:44:19 | × | justsomeguy quits (~justsomeg@unaffiliated/--/x-3805311) () |
| 2020-10-16 01:44:33 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2020-10-16 01:44:46 | <koz_> | > Just (Just 5) >>= id |
| 2020-10-16 01:44:48 | <lambdabot> | Just 5 |
| 2020-10-16 01:45:22 | <Axman6> | > Just (Just 5) >>= \just5 -> just5 |
| 2020-10-16 01:45:24 | <lambdabot> | Just 5 |
| 2020-10-16 01:45:55 | <koz_> | Axman6: Are you Just-ice? :P |
| 2020-10-16 01:46:17 | <crestfallen> | so does id apply to the first Just in (Just (Just 5)) ? |
| 2020-10-16 01:46:28 | <crestfallen> | and take it away? |
| 2020-10-16 01:46:56 | <koz_> | crestfallen: Let's look at the type of bind. |
| 2020-10-16 01:47:02 | <koz_> | :t (>>=) |
| 2020-10-16 01:47:03 | <crestfallen> | Axman6: that is very interesting: \just5 -> just5 *IS* id , right? |
| 2020-10-16 01:47:04 | <lambdabot> | Monad m => m a -> (a -> m b) -> m b |
| 2020-10-16 01:47:22 | <koz_> | Now, consider the case we were just looking at - what is 'm' here? |
| 2020-10-16 01:47:22 | <Axman6> | Just a >>= f = f a; Nothing >>= _ = Nothing |
| 2020-10-16 01:47:37 | <koz_> | (namely, 'Just (Just 5) >>= id') |
| 2020-10-16 01:48:20 | <crestfallen> | 'm' here is Just |
| 2020-10-16 01:48:47 | <koz_> | crestfallen: Incorrect. |
| 2020-10-16 01:48:54 | → | Gurkenglas_ joins (~Gurkengla@unaffiliated/gurkenglas) |
| 2020-10-16 01:49:08 | <koz_> | You're mixing type and value level. |
| 2020-10-16 01:49:17 | <koz_> | Try again, and think about it carefully. |
| 2020-10-16 01:50:49 | <koz_> | base-4.10 is GHC-8.what? |
| 2020-10-16 01:50:57 | <crestfallen> | oh yeah ok so... |
| 2020-10-16 01:52:10 | × | Gurkenglas quits (~Gurkengla@unaffiliated/gurkenglas) (Ping timeout: 258 seconds) |
| 2020-10-16 01:52:33 | <crestfallen> | so in Axman6 's example, 'a' is (Just a) ; it |
| 2020-10-16 01:52:46 | <Axman6> | yep |
| 2020-10-16 01:52:48 | <crestfallen> | it's the inner Just |
| 2020-10-16 01:52:56 | <Axman6> | uh, which example |
| 2020-10-16 01:53:13 | <crestfallen> | Just a >>= f = f a |
| 2020-10-16 01:53:20 | <Axman6> | Just a >>= f = f a; Nothing >>= _ = Nothing is the definition of (>>=) for Maybe |
| 2020-10-16 01:53:41 | <crestfallen> | so id is applied to the inner (Just a) |
| 2020-10-16 01:53:50 | <Axman6> | yep |
| 2020-10-16 01:54:18 | → | ashbreeze joins (~mark@72-161-253-104.dyn.centurytel.net) |
| 2020-10-16 01:55:20 | <crestfallen> | so Axman6 koz_ when you used this lambda notation Just (Just 5) >>= \just5 -> just5 ... |
| 2020-10-16 01:55:38 | <koz_> | \just5 -> just5 is alpha-equivalent to id. |
| 2020-10-16 01:55:54 | <koz_> | As is \foo -> foo, \bar -> bar, \koz -> koz, etc etc etc. |
| 2020-10-16 01:56:07 | <crestfallen> | that is very interesting. I mean, I know that, but seeing that is awesome. |
| 2020-10-16 01:56:39 | × | _ashbreeze_ quits (~mark@72-161-255-212.dyn.centurytel.net) (Ping timeout: 260 seconds) |
| 2020-10-16 01:57:13 | <crestfallen> | so id is not applied to the outer 'container', only Just a, the inner container. |
| 2020-10-16 01:57:52 | <crestfallen> | thanks kindly, today is a success koz_ Axman6 |
| 2020-10-16 01:58:15 | <koz_> | crestfallen: I was leading you there, but yeah. It's _very_ key that you follow the types. |
| 2020-10-16 01:58:25 | <koz_> | This can sometimes mean by-hand substitutions to get what's going on. |
| 2020-10-16 01:58:33 | <koz_> | I do it all the time, and it's actually quite enlightening. |
All times are in UTC.