Logs: freenode/#haskell
| 2020-11-17 00:31:57 | <dsal> | lucard: I think you're supposed to write those yourself. |
| 2020-11-17 00:32:31 | <dsal> | Fun Haskell fact: once your code compiles, it does exactly whatever you thought it should do. |
| 2020-11-17 00:33:02 | → | hekkaidekapus_ joins (~tchouri@gateway/tor-sasl/hekkaidekapus) |
| 2020-11-17 00:33:14 | × | royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Quit: Connection closed) |
| 2020-11-17 00:33:44 | × | lucard quits (c8dd9d33@200.221.157.51) (Remote host closed the connection) |
| 2020-11-17 00:33:51 | → | royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) |
| 2020-11-17 00:34:23 | × | hekkaidekapus quits (~tchouri@gateway/tor-sasl/hekkaidekapus) (Ping timeout: 240 seconds) |
| 2020-11-17 00:36:02 | × | solonarv quits (~solonarv@astrasbourg-653-1-156-155.w90-6.abo.wanadoo.fr) (Ping timeout: 260 seconds) |
| 2020-11-17 00:37:58 | × | avn quits (~avn@78-56-108-78.static.zebra.lt) (Ping timeout: 246 seconds) |
| 2020-11-17 00:38:31 | × | royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Ping timeout: 256 seconds) |
| 2020-11-17 00:40:03 | × | justanotheruser quits (~justanoth@unaffiliated/justanotheruser) (Ping timeout: 272 seconds) |
| 2020-11-17 00:42:33 | → | nineonine joins (~textual@50.216.62.2) |
| 2020-11-17 00:43:50 | → | shatriff_ joins (~vitaliish@176.52.219.10) |
| 2020-11-17 00:43:50 | × | shatriff quits (~vitaliish@176.52.219.10) (Read error: Connection reset by peer) |
| 2020-11-17 00:43:59 | → | avn joins (~avn@78-56-108-78.static.zebra.lt) |
| 2020-11-17 00:44:35 | → | conal joins (~conal@66.115.176.210) |
| 2020-11-17 00:46:59 | × | heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 2020-11-17 00:48:49 | × | Chi1thangoo quits (~Chi1thang@87.112.60.168) (Ping timeout: 264 seconds) |
| 2020-11-17 00:50:38 | × | nbloomf quits (~nbloomf@2600:1700:ad14:3020:8491:5fed:8d7f:daad) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 2020-11-17 00:57:00 | hackage | flashblast 0.0.7.0 - Generate language learning flashcards from video. https://hackage.haskell.org/package/flashblast-0.0.7.0 (locallycompact) |
| 2020-11-17 00:59:00 | hackage | flashblast 0.0.8.0 - Generate language learning flashcards from video. https://hackage.haskell.org/package/flashblast-0.0.8.0 (locallycompact) |
| 2020-11-17 00:59:07 | → | nbloomf joins (~nbloomf@2600:1700:ad14:3020:8491:5fed:8d7f:daad) |
| 2020-11-17 01:04:14 | × | mananamenos quits (~mananamen@84.122.202.215.dyn.user.ono.com) (Remote host closed the connection) |
| 2020-11-17 01:06:02 | × | borne quits (~fritjof@200116b864b5430099e934deb93b1409.dip.versatel-1u1.de) (Ping timeout: 260 seconds) |
| 2020-11-17 01:06:13 | × | xsperry quits (~as@unaffiliated/xsperry) (Ping timeout: 264 seconds) |
| 2020-11-17 01:06:18 | × | fryguybob quits (~fryguybob@cpe-74-65-31-113.rochester.res.rr.com) (Ping timeout: 265 seconds) |
| 2020-11-17 01:06:38 | × | Martinsos quits (~user@cpe-188-129-116-164.dynamic.amis.hr) (Ping timeout: 260 seconds) |
| 2020-11-17 01:07:20 | → | shadow__ joins (~shadow@192.12.149.141) |
| 2020-11-17 01:07:30 | × | shadow__ quits (~shadow@192.12.149.141) (Client Quit) |
| 2020-11-17 01:08:10 | → | da39a3ee5e6b4b0d joins (~da39a3ee5@cm-171-98-79-192.revip7.asianet.co.th) |
| 2020-11-17 01:08:18 | × | vacm quits (~vacwm@70.23.92.191) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 2020-11-17 01:08:33 | × | renzhi quits (~renzhi@2607:fa49:655f:e600::28da) (Ping timeout: 272 seconds) |
| 2020-11-17 01:09:13 | × | wildtrees quits (wildtrees@gateway/vpn/protonvpn/wildtrees) (Quit: Leaving) |
| 2020-11-17 01:11:20 | × | LKoen quits (~LKoen@9.253.88.92.rev.sfr.net) (Quit: “It’s only logical. First you learn to talk, then you learn to think. Too bad it’s not the other way round.”) |
| 2020-11-17 01:11:20 | → | wroathe_ joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 2020-11-17 01:12:26 | × | wroathe quits (~wroathe@c-73-24-27-54.hsd1.mn.comcast.net) (Ping timeout: 260 seconds) |
| 2020-11-17 01:12:49 | × | conal quits (~conal@66.115.176.210) (Quit: Computer has gone to sleep.) |
| 2020-11-17 01:13:58 | → | conal joins (~conal@66.115.176.210) |
| 2020-11-17 01:13:58 | × | conal quits (~conal@66.115.176.210) (Client Quit) |
| 2020-11-17 01:14:32 | → | heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) |
| 2020-11-17 01:14:53 | wroathe_ | is now known as wroathe |
| 2020-11-17 01:16:38 | → | conal joins (~conal@66.115.176.210) |
| 2020-11-17 01:18:22 | × | conal quits (~conal@66.115.176.210) (Client Quit) |
| 2020-11-17 01:22:05 | × | cr3 quits (~cr3@192-222-143-195.qc.cable.ebox.net) (Ping timeout: 240 seconds) |
| 2020-11-17 01:23:45 | → | vacm joins (~vacwm@70.23.92.191) |
| 2020-11-17 01:26:31 | → | fryguybob joins (~fryguybob@cpe-74-65-31-113.rochester.res.rr.com) |
| 2020-11-17 01:27:36 | × | tomboy64 quits (~tomboy64@gateway/tor-sasl/tomboy64) (Remote host closed the connection) |
| 2020-11-17 01:28:20 | → | tomboy64 joins (~tomboy64@gateway/tor-sasl/tomboy64) |
| 2020-11-17 01:28:42 | × | vacm quits (~vacwm@70.23.92.191) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 2020-11-17 01:29:31 | → | ironmarx joins (~ironmarx@139.28.218.148) |
| 2020-11-17 01:31:49 | → | Lord_of_Life_ joins (~Lord@46.217.219.70) |
| 2020-11-17 01:32:18 | × | Lord_of_Life quits (~Lord@unaffiliated/lord-of-life/x-0885362) (Ping timeout: 260 seconds) |
| 2020-11-17 01:36:57 | → | justsomeguy joins (~justsomeg@216.186.218.241) |
| 2020-11-17 01:36:57 | × | justsomeguy quits (~justsomeg@216.186.218.241) (Changing host) |
| 2020-11-17 01:36:57 | → | justsomeguy joins (~justsomeg@unaffiliated/--/x-3805311) |
| 2020-11-17 01:42:13 | × | mputz quits (~Thunderbi@dslb-084-058-211-084.084.058.pools.vodafone-ip.de) (Ping timeout: 264 seconds) |
| 2020-11-17 01:42:15 | <justsomeguy> | So I just found out that you can use let bindings in list comprehensions, like “[x^2 | let n = 3, x <- [1..n]]”. Is there anything special about them? Why the dedicated syntax? |
| 2020-11-17 01:43:33 | → | Jeanne-Kamikaze joins (~Jeanne-Ka@66.115.189.204) |
| 2020-11-17 01:43:51 | <davean> | justsomeguy: what dedicated syntax? |
| 2020-11-17 01:44:32 | <dolio> | Same reason as let inside do. |
| 2020-11-17 01:44:33 | <sshine> | justsomeguy, let-expressions in list comprehensions are much like let-expressions in do-notation |
| 2020-11-17 01:45:14 | <sshine> | justsomeguy, considering list comprehensions are monadic, it's not very special. but I guess you could ask why remove the "in" inside do notation? |
| 2020-11-17 01:45:59 | → | mputz joins (~Thunderbi@dslb-084-058-211-084.084.058.pools.vodafone-ip.de) |
| 2020-11-17 01:46:07 | <justsomeguy> | Yes, the absence of “in” kind of threw me off. |
| 2020-11-17 01:46:33 | <davean> | justsomeguy: its not removed specificly there |
| 2020-11-17 01:46:39 | <davean> | justsomeguy: theres no 'in' in do notation. |
| 2020-11-17 01:46:48 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2020-11-17 01:48:12 | <sshine> | justsomeguy, you can think of list comprehensions as being syntax sugar for list monads. and you can extend list comprehension syntax to other monads than list using -XMonadComprehensions: https://gitlab.haskell.org/ghc/ghc/-/wikis/monad-comprehensions |
| 2020-11-17 01:48:51 | justsomeguy | does a web search for do notation |
| 2020-11-17 01:49:13 | <dsal> | @undo do { results <- web } |
| 2020-11-17 01:49:13 | <lambdabot> | <unknown>.hs:1:22:Parse error: Last statement in a do-block must be an expression |
| 2020-11-17 01:49:39 | <dsal> | damn. Have to do something with those results. |
| 2020-11-17 01:49:43 | × | tmciver quits (~tmciver@cpe-172-101-40-226.maine.res.rr.com) (Ping timeout: 272 seconds) |
| 2020-11-17 01:50:19 | → | ddellacosta joins (dd@gateway/vpn/mullvad/ddellacosta) |
| 2020-11-17 01:50:21 | → | vacm joins (~vacwm@70.23.92.191) |
| 2020-11-17 01:51:03 | → | tmciver joins (~tmciver@cpe-172-101-40-226.maine.res.rr.com) |
| 2020-11-17 01:51:04 | <sshine> | ah |
| 2020-11-17 01:51:11 | <sshine> | I learned something. |
| 2020-11-17 01:51:14 | <sshine> | > do { x <- [1..10]; let {y = 3}; return (x * y) } |
| 2020-11-17 01:51:16 | <lambdabot> | [3,6,9,12,15,18,21,24,27,30] |
| 2020-11-17 01:51:33 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 260 seconds) |
| 2020-11-17 01:51:47 | <sshine> | so those inner curly braces aren't necessary if I use do-notation without the curly braces (those are only necessary because I want to one-line it on IRC.) |
| 2020-11-17 01:52:36 | <sshine> | but because let-expressions allow for separate ;-separated bindings (let foo = 2; bar = 3 in ...), I have to disambiguate the ; as a do-separating ; and not a let-binding-separating ;. |
| 2020-11-17 01:52:39 | <sshine> | sheesh. :) |
| 2020-11-17 01:52:57 | <sshine> | do x <- [1..10] |
| 2020-11-17 01:53:00 | <sshine> | let y = 3 |
| 2020-11-17 01:53:04 | <sshine> | return (x * y) |
| 2020-11-17 01:53:49 | <sshine> | > [ x * y | x <- [1..10], let y = 3 ] -- vs. this |
| 2020-11-17 01:53:51 | <lambdabot> | [3,6,9,12,15,18,21,24,27,30] |
| 2020-11-17 01:54:12 | <dsal> | @undo [ x * y | x <- [1..10], let y = 3 ] |
| 2020-11-17 01:54:12 | <lambdabot> | concatMap (\ x -> let { y = 3} in [x * y]) [1 .. 10] |
| 2020-11-17 01:54:21 | <dolio> | Well, also, the scoping is more suited to the situation. You don't need to nest another do block inside the let. |
| 2020-11-17 01:54:31 | <dolio> | And for comprehensions it'd be even more annoying. |
| 2020-11-17 01:55:03 | × | mputz quits (~Thunderbi@dslb-084-058-211-084.084.058.pools.vodafone-ip.de) (Ping timeout: 260 seconds) |
| 2020-11-17 01:58:50 | <sshine> | justsomeguy, I think the missing "in" comes from do-notation fitting one action per line with implicit monad bind operator in-between each line. so since do-notation has special syntax wrt. interpreting linebreaks, removing the "in" that would otherwise make a let-expression float onto the next line removes an ambiguity that would otherwise occur when the next line is indented the same: is it another |
| 2020-11-17 01:58:56 | <sshine> | stand-alone action, or is it the continuation of the let-in-binding on the line before? |
| 2020-11-17 02:02:25 | <sshine> | justsomeguy, https://gist.github.com/sshine/0dac23b35e19b1ea0aed7a9e6d215c30 |
| 2020-11-17 02:03:31 | <sshine> | justsomeguy, removing the "in" in do-blocks is not so nice because now you have two syntaxes and that's confusing, but not removing the "in" in do-blocks is kinda less nice. |
| 2020-11-17 02:04:43 | <justsomeguy> | Very interesting. Thanks for the explanation, sshine :) |
| 2020-11-17 02:04:54 | <sshine> | yw. |
All times are in UTC.