Logs: liberachat/#haskell
| 2021-07-19 10:33:52 | <dibblego> | I think sequence is more obvious in the way you are trying to explain it, like this: |
| 2021-07-19 10:33:53 | <dminuoso> | % mySequence [Just 10, Just 20, Just 30] |
| 2021-07-19 10:33:53 | <yahb> | dminuoso: Just [10,20,30] |
| 2021-07-19 10:34:20 | <dibblego> | (::.) = liftA2 (:); lift0 = pure; sequence (x:xs) = x ::. sequence xs; sequence [] = lift0 [] |
| 2021-07-19 10:35:56 | <dibblego> | once liftA2 is understood conceptually, then (*>) is quite simply: const id with some liftA2-ness |
| 2021-07-19 10:36:49 | → | yauhsien joins (~yauhsien@61-231-35-149.dynamic-ip.hinet.net) |
| 2021-07-19 10:40:21 | → | wallymathieu joins (~wallymath@81-234-151-21-no94.tbcn.telia.com) |
| 2021-07-19 10:41:48 | × | wallymathieu quits (~wallymath@81-234-151-21-no94.tbcn.telia.com) (Remote host closed the connection) |
| 2021-07-19 10:42:51 | → | Lycurgus joins (~juan@cpe-45-46-140-49.buffalo.res.rr.com) |
| 2021-07-19 10:44:49 | × | caubert quits (~caubert@136.244.111.235) (Quit: WeeChat 3.2) |
| 2021-07-19 10:45:07 | → | caubert joins (~caubert@136.244.111.235) |
| 2021-07-19 10:45:09 | × | Ariakenom quits (~Ariakenom@c83-255-154-140.bredband.tele2.se) (Ping timeout: 258 seconds) |
| 2021-07-19 10:46:02 | → | Ariakenom joins (~Ariakenom@c83-255-154-140.bredband.tele2.se) |
| 2021-07-19 10:46:27 | × | anandprabhu quits (anandprabh@gateway/vpn/airvpn/anandprabhu) (Quit: Leaving) |
| 2021-07-19 10:49:28 | → | berberman_ joins (~berberman@user/berberman) |
| 2021-07-19 10:50:04 | × | berberman quits (~berberman@user/berberman) (Ping timeout: 246 seconds) |
| 2021-07-19 10:54:05 | → | Topsi joins (~Tobias@dyndsl-095-033-024-196.ewe-ip-backbone.de) |
| 2021-07-19 10:56:36 | → | burnsidesLlama joins (~burnsides@dhcp168-011.wadham.ox.ac.uk) |
| 2021-07-19 11:01:58 | × | burnsidesLlama quits (~burnsides@dhcp168-011.wadham.ox.ac.uk) (Ping timeout: 252 seconds) |
| 2021-07-19 11:03:26 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds) |
| 2021-07-19 11:06:28 | × | lars8 quits (~bc817c21@217.29.117.252) (Quit: quit) |
| 2021-07-19 11:07:38 | → | AlexNoo_ joins (~AlexNoo@178.34.161.231) |
| 2021-07-19 11:08:00 | → | cfricke joins (~cfricke@user/cfricke) |
| 2021-07-19 11:08:01 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Quit: = "") |
| 2021-07-19 11:08:31 | × | cfricke quits (~cfricke@user/cfricke) (Client Quit) |
| 2021-07-19 11:09:18 | × | Alex_test quits (~al_test@178.34.162.246) (Ping timeout: 258 seconds) |
| 2021-07-19 11:09:18 | × | AlexZenon quits (~alzenon@178.34.162.246) (Ping timeout: 258 seconds) |
| 2021-07-19 11:11:06 | × | AlexNoo quits (~AlexNoo@178.34.162.246) (Ping timeout: 256 seconds) |
| 2021-07-19 11:12:55 | × | Vajb quits (~Vajb@2001:999:62:1d53:26b1:6c9b:c1ed:9c01) (Read error: Connection reset by peer) |
| 2021-07-19 11:13:12 | → | Vajb joins (~Vajb@hag-jnsbng11-58c3a1-224.dhcp.inet.fi) |
| 2021-07-19 11:15:17 | → | Alex_test joins (~al_test@178.34.161.231) |
| 2021-07-19 11:16:34 | → | jmorris joins (uid433911@id-433911.stonehaven.irccloud.com) |
| 2021-07-19 11:16:36 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 2021-07-19 11:16:40 | → | AlexZenon joins (~alzenon@178.34.161.231) |
| 2021-07-19 11:16:53 | × | moondog quits (~root@185.234.208.208.r.toneticgroup.pl) (Quit: leaving) |
| 2021-07-19 11:18:35 | × | lambdap quits (~lambdap@static.167.190.119.168.clients.your-server.de) (Quit: lambdap) |
| 2021-07-19 11:18:46 | <albet70> | so could we say traverse another version of fmap which it can do earlier exit? |
| 2021-07-19 11:21:01 | <[exa]> | "another" may be a weak label for the myriad of extra stuff it can do :] |
| 2021-07-19 11:21:11 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 255 seconds) |
| 2021-07-19 11:22:28 | → | elf_fortrez joins (~elf_fortr@adsl-72-50-4-55.prtc.net) |
| 2021-07-19 11:27:07 | × | wei2912 quits (~wei2912@112.199.250.21) (Quit: Lost terminal) |
| 2021-07-19 11:27:44 | × | Lycurgus quits (~juan@cpe-45-46-140-49.buffalo.res.rr.com) (Quit: Exeunt) |
| 2021-07-19 11:28:04 | <dminuoso> | albet70: Mmm, not just that. |
| 2021-07-19 11:28:37 | → | burnsidesLlama joins (~burnsides@dhcp168-011.wadham.ox.ac.uk) |
| 2021-07-19 11:28:38 | <dminuoso> | albet70: Say you have a Tree of values, say of type String. For each string you want to query some database, and replace the string with some value you read from the database, say something of type User. |
| 2021-07-19 11:29:00 | <dminuoso> | then you can do: do { userTree <- traverse fetchUserFromString stringTree; ... } |
| 2021-07-19 11:29:46 | <dminuoso> | albet70: The key thing to realize is that Applicative/Monad encode certain.. "effects". For `Maybe/Either e` the effect is that of an exception, for IO it's outside world interaction, for list it's non-determinism, etc.. |
| 2021-07-19 11:30:00 | <dminuoso> | So we map each element to an effectful computation, and then sequence them |
| 2021-07-19 11:30:38 | <dminuoso> | Important bit to notice, is that traverse fundamentally does not change the "shape" of that structure. So if you traverse over a tree, the shape of it remains (so you cant drop or create nodes) |
| 2021-07-19 11:31:44 | <dminuoso> | traverse on a list for example gives us a more generalized version of effectful loops. So a Python loop in which you do say database queries can be written with `traverse` |
| 2021-07-19 11:31:57 | <dminuoso> | But `traverse` allows us to do even more, not just database queries |
| 2021-07-19 11:32:03 | <dminuoso> | And it works on not just lists, but also trees. |
| 2021-07-19 11:32:42 | × | aplainzetakind quits (~johndoe@captainludd.powered.by.lunarbnc.net) (Ping timeout: 255 seconds) |
| 2021-07-19 11:33:47 | → | norias joins (~jaredm@c-98-219-195-163.hsd1.pa.comcast.net) |
| 2021-07-19 11:34:14 | × | burnsidesLlama quits (~burnsides@dhcp168-011.wadham.ox.ac.uk) (Ping timeout: 255 seconds) |
| 2021-07-19 11:39:18 | → | lambdap joins (~lambdap@static.167.190.119.168.clients.your-server.de) |
| 2021-07-19 11:39:46 | → | turlando joins (~turlando@93-42-250-112.ip89.fastwebnet.it) |
| 2021-07-19 11:39:46 | × | turlando quits (~turlando@93-42-250-112.ip89.fastwebnet.it) (Changing host) |
| 2021-07-19 11:39:46 | → | turlando joins (~turlando@user/turlando) |
| 2021-07-19 11:42:20 | × | turlando_ quits (~turlando@93-42-250-112.ip89.fastwebnet.it) (Ping timeout: 265 seconds) |
| 2021-07-19 11:42:26 | × | lambdap quits (~lambdap@static.167.190.119.168.clients.your-server.de) (Client Quit) |
| 2021-07-19 11:43:01 | AlexNoo_ | is now known as AlexNoo |
| 2021-07-19 11:43:12 | × | elf_fortrez quits (~elf_fortr@adsl-72-50-4-55.prtc.net) (Quit: Client closed) |
| 2021-07-19 11:44:34 | × | Obo quits (~roberto@70.pool90-171-81.dynamic.orange.es) (Ping timeout: 258 seconds) |
| 2021-07-19 11:45:34 | → | lambdap joins (~lambdap@static.167.190.119.168.clients.your-server.de) |
| 2021-07-19 11:50:10 | × | Vajb quits (~Vajb@hag-jnsbng11-58c3a1-224.dhcp.inet.fi) (Read error: Connection reset by peer) |
| 2021-07-19 11:51:26 | × | siraben quits (~siraben@user/siraben) (Quit: Bridge terminating on SIGTERM) |
| 2021-07-19 11:51:27 | × | MatrixTravelerbo quits (~voyagert2@2001:470:69fc:105::22) (Quit: Bridge terminating on SIGTERM) |
| 2021-07-19 11:51:27 | × | Aleci[m] quits (~alecilibr@2001:470:69fc:105::32e7) (Quit: Bridge terminating on SIGTERM) |
| 2021-07-19 11:51:27 | × | ServerStatsDisco quits (~serversta@2001:470:69fc:105::1a) (Quit: Bridge terminating on SIGTERM) |
| 2021-07-19 11:51:27 | × | ac quits (~aloiscoch@2001:470:69fc:105::65) (Quit: Bridge terminating on SIGTERM) |
| 2021-07-19 11:51:27 | × | carmysilna quits (~brightly-@2001:470:69fc:105::2190) (Quit: Bridge terminating on SIGTERM) |
| 2021-07-19 11:51:27 | × | kadoban quits (~kadoban@user/kadoban) (Quit: Bridge terminating on SIGTERM) |
| 2021-07-19 11:51:27 | × | cdsmith quits (~cdsmithma@2001:470:69fc:105::284) (Quit: Bridge terminating on SIGTERM) |
| 2021-07-19 11:51:27 | × | Tisoxin quits (~ikosit@user/ikosit) (Quit: Bridge terminating on SIGTERM) |
| 2021-07-19 11:51:27 | × | rednaZ[m] quits (~r3dnazmat@2001:470:69fc:105::ba70) (Quit: Bridge terminating on SIGTERM) |
| 2021-07-19 11:51:27 | × | fgaz quits (~fgaz@2001:470:69fc:105::842) (Quit: Bridge terminating on SIGTERM) |
| 2021-07-19 11:51:27 | × | ericson2314 quits (~ericson23@2001:470:69fc:105::70c) (Quit: Bridge terminating on SIGTERM) |
| 2021-07-19 11:51:27 | × | inkbottle[m] quits (~inkbottle@2001:470:69fc:105::2ff5) (Quit: Bridge terminating on SIGTERM) |
| 2021-07-19 11:51:27 | × | the-coot[m] quits (~the-cootm@2001:470:69fc:105::95f) (Quit: Bridge terminating on SIGTERM) |
| 2021-07-19 11:51:27 | × | boxscape quits (~boxscape@user/boxscape) (Quit: Bridge terminating on SIGTERM) |
| 2021-07-19 11:51:27 | × | hsiktas[m] quits (~hsiktasma@2001:470:69fc:105::30d4) (Quit: Bridge terminating on SIGTERM) |
| 2021-07-19 11:51:27 | × | marinelli[m] quits (~marinelli@2001:470:69fc:105::2d8) (Quit: Bridge terminating on SIGTERM) |
| 2021-07-19 11:51:28 | × | lwe[m] quits (~dendrumat@2001:470:69fc:105::2f9b) (Quit: Bridge terminating on SIGTERM) |
| 2021-07-19 11:51:28 | × | peddie quits (~peddie@2001:470:69fc:105::25d) (Quit: Bridge terminating on SIGTERM) |
| 2021-07-19 11:51:28 | × | gxt quits (~gxt@2001:470:69fc:105::3513) (Quit: Bridge terminating on SIGTERM) |
| 2021-07-19 11:51:28 | × | cdepillabout[m] quits (~cdepillab@2001:470:69fc:105::3d3) (Quit: Bridge terminating on SIGTERM) |
| 2021-07-19 11:51:28 | × | ormaaj quits (~ormaaj@user/ormaaj) (Quit: Bridge terminating on SIGTERM) |
| 2021-07-19 11:51:28 | × | Las[m] quits (~lasmatrix@2001:470:69fc:105::74e) (Quit: Bridge terminating on SIGTERM) |
| 2021-07-19 11:51:28 | × | maralorn quits (~maralorn@2001:470:69fc:105::251) (Quit: Bridge terminating on SIGTERM) |
| 2021-07-19 11:51:28 | × | vaibhavsagar[m] quits (~vaibhavsa@2001:470:69fc:105::ffe) (Quit: Bridge terminating on SIGTERM) |
| 2021-07-19 11:51:28 | × | thedward[m] quits (~thedwardm@2001:470:69fc:105::f79) (Quit: Bridge terminating on SIGTERM) |
| 2021-07-19 11:51:28 | × | polykernel quits (~polykerne@user/polykernel) (Quit: Bridge terminating on SIGTERM) |
| 2021-07-19 11:51:28 | × | unclechu quits (~unclechu@2001:470:69fc:105::354) (Quit: Bridge terminating on SIGTERM) |
| 2021-07-19 11:51:28 | × | Deewiant quits (~deewiant@2001:470:69fc:105::2fd3) (Quit: Bridge terminating on SIGTERM) |
| 2021-07-19 11:51:28 | × | ru0mad[m] quits (~ru0madmat@2001:470:69fc:105::9b2) (Quit: Bridge terminating on SIGTERM) |
| 2021-07-19 11:51:28 | × | jophish quits (~jophish@2001:470:69fc:105::670) (Quit: Bridge terminating on SIGTERM) |
| 2021-07-19 11:51:28 | × | bitonic quits (~bitonic@2001:470:69fc:105::1812) (Quit: Bridge terminating on SIGTERM) |
| 2021-07-19 11:51:28 | × | bryan[m] quits (~bchreekat@2001:470:69fc:105::16b5) (Quit: Bridge terminating on SIGTERM) |
| 2021-07-19 11:51:28 | × | Artem[m] quits (~artemtype@2001:470:69fc:105::75b) (Quit: Bridge terminating on SIGTERM) |
All times are in UTC.