Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→
Page 1 .. 788 789 790 791 792 793 794 795 796 797 798 .. 5022
502,152 events total
2020-10-21 22:57:13 <davean> which is *just* sugar and really only has one rule.
2020-10-21 22:57:25 <crestfallen> excellent thanks.. looking now
2020-10-21 22:57:46 <monochrom> Nah, the whole Haskell Report is pretty long. But don't worry, the section on do-notation is short, as promised.
2020-10-21 22:58:40 ahmr88 joins (~ahmr88@cpc85006-haye22-2-0-cust131.17-4.cable.virginm.net)
2020-10-21 22:58:44 <davean> Ok, right
2020-10-21 22:58:58 <crestfallen> cool
2020-10-21 22:59:29 <MarcelineVQ> monochrom: I saw a tutorial once by some unknown author that covered the sugar quite well, also covered IO at the same time amazingly
2020-10-21 22:59:34 <davean> It has a lot of (mostly irrelivent) code also, for the basic libraries for example - ignore all that of course
2020-10-21 22:59:44 <monochrom> haha
2020-10-21 23:00:43 <davean> "do" is less than a page
2020-10-21 23:00:54 <davean> (and most of it is the grammar for it)
2020-10-21 23:01:30 <monochrom> Oh, right, the Haskell Report includes treating "general_pattern <- foo" using "fail", that's going to be distracting.
2020-10-21 23:01:42 × borne quits (~fritjof@200116b864c00d0000dd0a7f6ac41015.dip.versatel-1u1.de) (Ping timeout: 260 seconds)
2020-10-21 23:01:51 <davean> Oh damn it is out of date on that
2020-10-21 23:02:23 <MarcelineVQ> fret not
2020-10-21 23:02:30 bitmagie joins (~Thunderbi@200116b806c15c0034a3f18e66d83a15.dip.versatel-1u1.de)
2020-10-21 23:02:36 <crestfallen> yeah I get that pretty much
2020-10-21 23:02:45 <davean> Its MonadFail instead of Monad, but thats kinda minor
2020-10-21 23:02:48 <davean> still, annoying.
2020-10-21 23:02:52 × ukari quits (~ukari@unaffiliated/ukari) (Remote host closed the connection)
2020-10-21 23:02:55 × ahmr88 quits (~ahmr88@cpc85006-haye22-2-0-cust131.17-4.cable.virginm.net) (Ping timeout: 246 seconds)
2020-10-21 23:03:29 ukari joins (~ukari@unaffiliated/ukari)
2020-10-21 23:03:46 × dcoutts_ quits (~duncan@33.14.75.194.dyn.plus.net) (Ping timeout: 272 seconds)
2020-10-21 23:04:48 <crestfallen> but id changes things in far more interesting ways than I would have expected
2020-10-21 23:04:59 × AceNovo quits (~chris@67-42-33-191.phnx.qwest.net) (Quit: Konversation terminated!)
2020-10-21 23:05:03 <davean> id changes things? What do you mean?
2020-10-21 23:05:18 <crestfallen> one moment
2020-10-21 23:05:24 AceNovo joins (~chris@67-42-33-191.phnx.qwest.net)
2020-10-21 23:05:30 × AceNovo quits (~chris@67-42-33-191.phnx.qwest.net) (Client Quit)
2020-10-21 23:05:54 AceNovo joins (~chris@67-42-33-191.phnx.qwest.net)
2020-10-21 23:08:12 × conal quits (~conal@ip-66-115-176-174.creativelink.net) (Quit: Computer has gone to sleep.)
2020-10-21 23:09:20 <crestfallen> davean, I'm still looking for a study I did, but i.e. when it's determined the g :: id here https://termbin.com/m3z6
2020-10-21 23:10:27 <crestfallen> finding the type of f
2020-10-21 23:10:30 <crestfallen> f g h x y = g (g x) (h y)
2020-10-21 23:11:57 <davean> What do you tihnk 'id' is "changing" there?
2020-10-21 23:12:04 × Tuplanolla quits (~Tuplanoll@91-159-68-239.elisa-laajakaista.fi) (Quit: Leaving.)
2020-10-21 23:12:13 × dxld quits (~dxld@80-109-136-248.cable.dynamic.surfer.at) (Ping timeout: 264 seconds)
2020-10-21 23:12:14 <davean> If g can only *be* 'id' in what sense has anything changed?
2020-10-21 23:13:19 DirefulSalt joins (DirefulSal@gateway/vpn/privateinternetaccess/direfulsalt)
2020-10-21 23:14:00 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
2020-10-21 23:14:02 × Ferdiran1 quits (~max@2001:4c78:2012:5000::2) (Ping timeout: 244 seconds)
2020-10-21 23:14:10 Ferdirand joins (~max@2001:4c78:2012:5000::2)
2020-10-21 23:14:44 <crestfallen> in that case I meant that seeing how g resolves to id was quite surprising. davean
2020-10-21 23:15:23 <davean> Ah, sure. Not sure the relation to 'do' notation, but ow I understand what you meant at least.
2020-10-21 23:15:38 <davean> f is a very weird function
2020-10-21 23:15:58 × AceNovo quits (~chris@67-42-33-191.phnx.qwest.net) (Quit: Konversation terminated!)
2020-10-21 23:16:23 oisdk_ joins (~oisdk@2001:bb6:3329:d100:110c:4b45:443f:14f0)
2020-10-21 23:16:24 AceNovo joins (~chris@67-42-33-191.phnx.qwest.net)
2020-10-21 23:16:32 dxld joins (~dxld@2a01:4f8:201:89ff:7479:df6a:7ab8:8305)
2020-10-21 23:17:20 conal joins (~conal@ip-66-115-176-174.creativelink.net)
2020-10-21 23:17:27 × oisdk quits (~oisdk@2001:bb6:3329:d100:110c:4b45:443f:14f0) (Ping timeout: 260 seconds)
2020-10-21 23:18:35 <ski> crestfallen : "does each line of a do block (after the first line) end up initially with essentially m(m a) .. thus requiring join" -- yes, essentially. that is, each implicit use of `(>>=)' (connecting lines, more or less) could be thought of as `fmap' and `join'
2020-10-21 23:19:18 <davean> Specificly we can implikent join and (>>=) via each other basicly.
2020-10-21 23:19:25 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 264 seconds)
2020-10-21 23:19:37 <crestfallen> ski thanks! you have an uncanny ability to decipher my rambling!
2020-10-21 23:20:30 <ski> (you could think of the collapsing of `m (m (m (..(m (m a))..)))' (as many `m's, as there's commands in the `do', minus one) into `m a', as effecting the (dynamic) sequencing of effects)
2020-10-21 23:20:33 ahmr88 joins (~ahmr88@cpc85006-haye22-2-0-cust131.17-4.cable.virginm.net)
2020-10-21 23:21:00 <crestfallen> I thought so ski , because of this little ditty from kleisli composition: https://termbin.com/xnxfu
2020-10-21 23:21:12 <ski> yes
2020-10-21 23:21:54 <crestfallen> yeah that's what I thought. each action would produce a nested layer
2020-10-21 23:22:59 <ski> (for an idiom `i' (that is `i' an instance of `Applicative'), you instead collapse `(i a,i b,i c,...,i y,i z)' to `i (a,b,c,...,y,z)', the combination of the multiple `i's here into a single one is what i sometimes refer to as "static sequencing")
2020-10-21 23:24:25 × dhil quits (~dhil@195.213.192.122) (Ping timeout: 240 seconds)
2020-10-21 23:25:03 klixto joins (~klixto@130.220.8.131)
2020-10-21 23:25:19 <crestfallen> is that why the monad keeps the nested function 'pure' ? because the structure of the 'outer' monad is immutable? ski
2020-10-21 23:25:23 <ski> for a monad `m', you can decide what to do next, depending on the results of the effect interaction you do first. so, to read a line in `IO', and then to output that line, you can do `fmap putStrLn getLine', which has type `IO (IO ())'. but to get this into a single `IO ()' that will first input a line, then output it, you use `join'
2020-10-21 23:25:41 <ski> (the "first .., then .." is the (dynamic) sequencing here)
2020-10-21 23:26:00 <ski> i don't understand the question
2020-10-21 23:26:04 hekkaidekapus} is now known as hekkaidekapus
2020-10-21 23:26:44 <sshine> crestfallen, "the monad keeps the nested function 'pure'" does not parse here, either.
2020-10-21 23:26:52 <ski> `join' can be thought of as combining the effects described by two `m'-layers, one nested inside the other. combining them into a single `m'-layer, that does the effects of both the original layers
2020-10-21 23:26:57 <sshine> crestfallen, maybe you could simplify
2020-10-21 23:27:21 <ski> `pure'/`return', on the other hand, introduces a "dummy" layer, which doesn't actually do any effect
2020-10-21 23:27:50 <crestfallen> ski yeah the single 'm' layer gains complexity as you go through each action
2020-10-21 23:28:07 <ski> (hm .. but on second reading, possibly you weren't talking about the operation `pure', belonging to the type class `Applicative' ..)
2020-10-21 23:28:41 <crestfallen> ski is my last post correct?
2020-10-21 23:29:10 <ski> i don't know what you mean by ".. layer gains complexity"
2020-10-21 23:29:20 <ski> (also "each action" -- each of which actions ?)
2020-10-21 23:29:32 <davean> waht is complexity?
2020-10-21 23:29:47 <crestfallen> there are more effects in the single m (a) layer ultimately I guess?
2020-10-21 23:30:03 <ski> after you've used `join', yes
2020-10-21 23:30:11 <davean> I'm weirded out here crestfallen because you seem to be taking a rigorous approach with some things, yet your thinking seems entirely fuzzy so I feel like I'm missing something large in this convesation
2020-10-21 23:30:17 <crestfallen> that's what I meant by complexity
2020-10-21 23:30:40 <crestfallen> davean, I have a screw loose :)
2020-10-21 23:30:50 × ahmr88 quits (~ahmr88@cpc85006-haye22-2-0-cust131.17-4.cable.virginm.net) (Remote host closed the connection)
2020-10-21 23:31:31 wroathe_ joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2020-10-21 23:31:33 <sshine> > join [[1,2,3],[4,5,6],[7,8,9]]
2020-10-21 23:31:34 <lambdabot> [1,2,3,4,5,6,7,8,9]
2020-10-21 23:31:40 <sshine> > join (Just (Just 5))
2020-10-21 23:31:42 <lambdabot> Just 5
2020-10-21 23:32:08 <crestfallen> a monad gains complexity because structure is added every time >>= is applied.
2020-10-21 23:32:16 × wroathe quits (~wroathe@c-73-24-27-54.hsd1.mn.comcast.net) (Ping timeout: 272 seconds)
2020-10-21 23:32:36 <davean> Uh, "cocks head for a different view of that statement"
2020-10-21 23:32:37 <ski> > [join actionYieldingAction | actionYieldingAction <- [Nothing,Just Nothing,Just (Just 5)]]
2020-10-21 23:32:39 <lambdabot> [Nothing,Nothing,Just 5]
2020-10-21 23:32:56 <ski> crestfallen : "a monad" -- no, a monadic action. not a monad
2020-10-21 23:33:52 <sshine> > Just 42 >>= pure >>= pure >>= pure -- more complex?
2020-10-21 23:33:55 <lambdabot> Just 42
2020-10-21 23:33:58 <crestfallen> so at the math level, the object is gaining complexity from each morphism that is applied
2020-10-21 23:34:14 <ski> yes, "more" in the lax sense, as `>=', not as `>'
2020-10-21 23:35:01 <crestfallen> isn't that what it is in the math?

All times are in UTC.