Logs: freenode/#haskell
| 2020-11-21 03:43:46 | → | lagothrix joins (~lagothrix@unaffiliated/lagothrix) |
| 2020-11-21 03:44:10 | → | n0042 joins (d055ed89@208.85.237.137) |
| 2020-11-21 03:47:55 | × | n0042 quits (d055ed89@208.85.237.137) (Remote host closed the connection) |
| 2020-11-21 03:49:00 | × | fresheyeball quits (~isaac@c-71-237-105-37.hsd1.co.comcast.net) (Quit: WeeChat 2.7.1) |
| 2020-11-21 03:50:45 | × | theDon quits (~td@94.134.91.165) (Ping timeout: 260 seconds) |
| 2020-11-21 03:52:27 | → | theDon joins (~td@94.134.91.87) |
| 2020-11-21 03:55:08 | → | wei2912 joins (~wei2912@unaffiliated/wei2912) |
| 2020-11-21 03:56:14 | × | maroloccio quits (~marolocci@2a02:8084:221:ce00:164f:8aff:fed8:411d) (Quit: WeeChat 2.3) |
| 2020-11-21 03:56:56 | × | christo quits (~chris@81.96.113.213) (Remote host closed the connection) |
| 2020-11-21 03:57:13 | × | ddellacosta quits (dd@gateway/vpn/mullvad/ddellacosta) (Ping timeout: 264 seconds) |
| 2020-11-21 03:58:24 | → | Jonkimi727406120 joins (~Jonkimi@115.44.7.41) |
| 2020-11-21 04:00:00 | → | sand_dull joins (~theuser@c-73-149-95-105.hsd1.ct.comcast.net) |
| 2020-11-21 04:02:18 | → | siloxid joins (~user@unaffiliated/siloxid) |
| 2020-11-21 04:02:53 | × | Jonkimi727406120 quits (~Jonkimi@115.44.7.41) (Ping timeout: 260 seconds) |
| 2020-11-21 04:04:08 | × | nbloomf quits (~nbloomf@2600:1700:ad14:3020:a4db:c497:ce73:79ee) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 2020-11-21 04:06:00 | → | hoker joins (2fe3e53b@047-227-229-059.res.spectrum.com) |
| 2020-11-21 04:06:18 | <hoker> | hi, so I was going through CIS194 and got stuck on this last part, "supply monad": https://www.seas.upenn.edu/~cis194/fall16/hw/07-laziness.html |
| 2020-11-21 04:06:39 | <hoker> | i was able to write the monad functions, but didn't understand how to label the leaves of a tree with natural numbers |
| 2020-11-21 04:07:37 | × | siloxid quits (~user@unaffiliated/siloxid) (Ping timeout: 260 seconds) |
| 2020-11-21 04:08:01 | → | nbloomf joins (~nbloomf@2600:1700:ad14:3020:a4db:c497:ce73:79ee) |
| 2020-11-21 04:08:35 | × | crdrost quits (~crdrost@2601:646:8280:85f0:90f7:1b03:f01f:afae) (Quit: This computer has gone to sleep) |
| 2020-11-21 04:13:19 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2020-11-21 04:14:39 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 2020-11-21 04:17:49 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 260 seconds) |
| 2020-11-21 04:21:37 | → | nineonine joins (~nineonine@50.216.62.2) |
| 2020-11-21 04:23:02 | × | nineonine quits (~nineonine@50.216.62.2) (Client Quit) |
| 2020-11-21 04:26:08 | × | howdoi quits (uid224@gateway/web/irccloud.com/x-mmsjxvzuqvfjlnly) (Quit: Connection closed for inactivity) |
| 2020-11-21 04:27:20 | → | christo joins (~chris@81.96.113.213) |
| 2020-11-21 04:28:13 | × | rprije quits (~rprije@124.148.131.132) (Remote host closed the connection) |
| 2020-11-21 04:28:34 | → | rprije joins (~rprije@124.148.131.132) |
| 2020-11-21 04:30:14 | × | christo quits (~chris@81.96.113.213) (Remote host closed the connection) |
| 2020-11-21 04:30:37 | → | Jonkimi727406120 joins (~Jonkimi@115.44.7.41) |
| 2020-11-21 04:31:30 | <c_wraith> | hoker: the idea is to use the supply to generate a list of natural numbers. Then recurse through the tree, replacing the node value with the next value from the supply when you hit a leaf. |
| 2020-11-21 04:31:52 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Quit: leaving) |
| 2020-11-21 04:32:00 | <hoker> | yeah, so I didn't actually understand the point of mapSupply, mapSupply2, and bindSupply |
| 2020-11-21 04:32:31 | <c_wraith> | those are the implementation for the Functor/Applicative/Monad instances |
| 2020-11-21 04:32:43 | <c_wraith> | Since you have those, you can just use do notation. |
| 2020-11-21 04:34:36 | <c_wraith> | The next section shows using do notation in a similar way. With a different type, but it shows the same ideas. |
| 2020-11-21 04:34:45 | × | Jonkimi727406120 quits (~Jonkimi@115.44.7.41) (Ping timeout: 240 seconds) |
| 2020-11-21 04:35:00 | <hoker> | yeah, can you explain intuitively what the functor/applicative/monad instances mean? |
| 2020-11-21 04:35:29 | → | christo joins (~chris@81.96.113.213) |
| 2020-11-21 04:35:39 | <hoker> | like i guess mapSupply is like taking some stream labeler and returning a new stream labeler |
| 2020-11-21 04:35:46 | <hoker> | where the transformation comes from the function |
| 2020-11-21 04:35:47 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 2020-11-21 04:35:51 | <c_wraith> | not quickly. They're... more abstract than most people are ready to grasp the first time they run into them. |
| 2020-11-21 04:36:41 | × | mozzarella quits (~sam@unaffiliated/sam113101) (Ping timeout: 256 seconds) |
| 2020-11-21 04:37:01 | → | jedai42 joins (~jedai@lfbn-dij-1-708-251.w90-100.abo.wanadoo.fr) |
| 2020-11-21 04:37:07 | <c_wraith> | at an extremely vague level - Functor lets you modify inside a type. Applicative lets you combine values in a fixed way. Monad lets you combine them in a context-sensitive way. |
| 2020-11-21 04:37:16 | <c_wraith> | But that's really too vague to mean much. |
| 2020-11-21 04:37:32 | <hoker> | oh i've seen them a few times, i just meant in the context of supply specifically |
| 2020-11-21 04:37:38 | <hoker> | i'm not too comfortable |
| 2020-11-21 04:37:42 | <hoker> | but i'm familiar |
| 2020-11-21 04:38:25 | × | elliott__ quits (~elliott@pool-108-51-141-12.washdc.fios.verizon.net) (Ping timeout: 240 seconds) |
| 2020-11-21 04:39:41 | <c_wraith> | the only interesting part from the perspective of using it is the value named get. (It's not a function, at least from the outside) |
| 2020-11-21 04:39:49 | × | christo quits (~chris@81.96.113.213) (Ping timeout: 265 seconds) |
| 2020-11-21 04:39:55 | <c_wraith> | You can bind the result of get to fetch the next value from the supply |
| 2020-11-21 04:40:17 | × | polyphem quits (~p0lyph3m@2a02:810d:640:776c:76d7:55f6:f85b:c889) (Ping timeout: 260 seconds) |
| 2020-11-21 04:41:14 | <c_wraith> | The various instances you have take care of chaining the new value forward afterwards. The nice thing there is that you don't have to handle parameters carefully to make sure you don't mess up the handling of the stream. They're just taken care of for you. |
| 2020-11-21 04:43:00 | <c_wraith> | Given the starting point in the last exercise, you should be able to do something like runSupply nats (do x <- get ; y <- get ; return (x, y)) and get a result of (0,1) |
| 2020-11-21 04:44:30 | <c_wraith> | Does that make it any clearer what's going on there? |
| 2020-11-21 04:45:29 | × | Sheilong quits (uid293653@gateway/web/irccloud.com/x-fgwigxpmxrbdsiil) () |
| 2020-11-21 04:45:36 | × | Gurkenglas quits (~Gurkengla@unaffiliated/gurkenglas) (Ping timeout: 240 seconds) |
| 2020-11-21 04:47:45 | → | jedws joins (~jedws@101.184.150.93) |
| 2020-11-21 04:48:24 | × | hoker quits (2fe3e53b@047-227-229-059.res.spectrum.com) (Ping timeout: 245 seconds) |
| 2020-11-21 04:48:29 | × | borne quits (~fritjof@200116b86455d000f1dc39039d201adf.dip.versatel-1u1.de) (Ping timeout: 272 seconds) |
| 2020-11-21 04:53:10 | → | mozzarella joins (~sam@unaffiliated/sam113101) |
| 2020-11-21 05:01:53 | → | siloxid joins (~user@unaffiliated/siloxid) |
| 2020-11-21 05:05:45 | → | SanchayanMaity joins (~Sanchayan@122.167.90.144) |
| 2020-11-21 05:07:23 | × | Tario quits (~Tario@201.192.165.173) (Ping timeout: 260 seconds) |
| 2020-11-21 05:07:29 | × | siloxid quits (~user@unaffiliated/siloxid) (Ping timeout: 272 seconds) |
| 2020-11-21 05:09:41 | → | conal joins (~conal@64.71.133.70) |
| 2020-11-21 05:09:56 | × | texasmynsted quits (~texasmyns@212.102.45.109) (Remote host closed the connection) |
| 2020-11-21 05:10:33 | → | texasmynsted joins (~texasmyns@212.102.45.109) |
| 2020-11-21 05:11:30 | × | gxt quits (~gxt@gateway/tor-sasl/gxt) (Remote host closed the connection) |
| 2020-11-21 05:12:02 | × | berberman_ quits (~berberman@unaffiliated/berberman) (Ping timeout: 264 seconds) |
| 2020-11-21 05:12:10 | → | gxt joins (~gxt@gateway/tor-sasl/gxt) |
| 2020-11-21 05:12:30 | → | berberman joins (~berberman@unaffiliated/berberman) |
| 2020-11-21 05:13:05 | × | conal quits (~conal@64.71.133.70) (Client Quit) |
| 2020-11-21 05:13:44 | → | siloxid joins (~user@unaffiliated/siloxid) |
| 2020-11-21 05:15:00 | × | texasmynsted quits (~texasmyns@212.102.45.109) (Ping timeout: 256 seconds) |
| 2020-11-21 05:15:20 | → | elliott__ joins (~elliott@pool-108-51-141-12.washdc.fios.verizon.net) |
| 2020-11-21 05:17:27 | × | xnt14 quits (~xnt14@185.204.1.185) (Remote host closed the connection) |
| 2020-11-21 05:19:02 | × | siloxid quits (~user@unaffiliated/siloxid) (Ping timeout: 260 seconds) |
| 2020-11-21 05:20:22 | × | elliott__ quits (~elliott@pool-108-51-141-12.washdc.fios.verizon.net) (Ping timeout: 246 seconds) |
| 2020-11-21 05:21:09 | → | gproto023 joins (~gproto23@unaffiliated/gproto23) |
| 2020-11-21 05:23:43 | × | gproto23 quits (~gproto23@unaffiliated/gproto23) (Ping timeout: 256 seconds) |
| 2020-11-21 05:36:13 | × | cads quits (~cads@ip-64-72-99-232.lasvegas.net) (Ping timeout: 260 seconds) |
| 2020-11-21 05:36:44 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 272 seconds) |
| 2020-11-21 05:37:22 | × | drbean quits (~drbean@TC210-63-209-164.static.apol.com.tw) (Quit: ZNC 1.8.2+cygwin1 - https://znc.in) |
| 2020-11-21 05:39:16 | → | mbomba joins (~mbomba@bras-base-toroon2719w-grc-49-142-114-9-241.dsl.bell.ca) |
| 2020-11-21 05:39:34 | × | gproto023 quits (~gproto23@unaffiliated/gproto23) (Remote host closed the connection) |
| 2020-11-21 05:40:01 | → | gproto023 joins (~gproto23@unaffiliated/gproto23) |
| 2020-11-21 05:41:33 | → | cads joins (~cads@ip-64-72-99-232.lasvegas.net) |
| 2020-11-21 05:42:31 | hackage | optparse-applicative 0.16.1.0 - Utilities and combinators for parsing command line options https://hackage.haskell.org/package/optparse-applicative-0.16.1.0 (huw) |
| 2020-11-21 05:43:26 | × | toorevitimirp quits (~tooreviti@117.182.180.118) (Remote host closed the connection) |
| 2020-11-21 05:43:54 | → | texasmynsted joins (~texasmyns@212.102.45.109) |
| 2020-11-21 05:45:29 | → | nados joins (~dan@107-190-41-58.cpe.teksavvy.com) |
| 2020-11-21 05:46:42 | → | jonatanb joins (jonatanb@gateway/vpn/protonvpn/jonatanb) |
| 2020-11-21 05:46:47 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 2020-11-21 05:47:32 | → | perry69420 joins (6ee39737@110.227.151.55) |
All times are in UTC.