Logs: liberachat/#haskell
| 2021-07-27 18:52:24 | <Cale> | Yeah, it's just an arbitrary variable, it doesn't really mean anything, but you can think of it as referring to the runZMQ session. |
| 2021-07-27 18:53:18 | <Cale> | There's some context that runZMQ sets up, and we don't want sockets and such that are created with one context being used by another |
| 2021-07-27 18:53:35 | <Cale> | and we're using a type system trick to prevent this |
| 2021-07-27 18:54:04 | → | tzh joins (~tzh@c-24-21-73-154.hsd1.or.comcast.net) |
| 2021-07-27 18:54:10 | <lechner> | does haskell know any other |
| 2021-07-27 18:54:55 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-07-27 18:54:59 | × | falafel quits (~falafel@pool-96-255-70-50.washdc.fios.verizon.net) (Ping timeout: 258 seconds) |
| 2021-07-27 18:55:11 | × | burnsidesLlama quits (~burnsides@dhcp168-022.wadham.ox.ac.uk) (Remote host closed the connection) |
| 2021-07-27 18:56:24 | × | LukeHoersten quits (~LukeHoers@user/lukehoersten) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 2021-07-27 18:58:11 | × | fef quits (~thedawn@user/thedawn) (Ping timeout: 244 seconds) |
| 2021-07-27 18:59:47 | → | potato_dev joins (~potato_to@elara.whatbox.ca) |
| 2021-07-27 19:00:22 | <monochrom> | Haskell doesn't want to be anthropomophized. |
| 2021-07-27 19:01:06 | <lechner> | you are right; it is our trick |
| 2021-07-27 19:02:56 | <c_wraith> | I don't think the joke works quite right with that wording. |
| 2021-07-27 19:04:22 | <lechner> | sorry, bad joke. trying to cope with a learning curve |
| 2021-07-27 19:04:22 | <c_wraith> | I meant monochrom's joke |
| 2021-07-27 19:04:48 | → | burnsidesLlama joins (~burnsides@dhcp168-022.wadham.ox.ac.uk) |
| 2021-07-27 19:05:01 | <c_wraith> | It can be vacuously true, as opposed to wording like "Haskell hates being anthropomorphized" |
| 2021-07-27 19:05:44 | <monochrom> | Oh, that. |
| 2021-07-27 19:06:26 | <c_wraith> | English and logic have a very weird intersection :) |
| 2021-07-27 19:06:46 | <lechner> | they have one? |
| 2021-07-27 19:07:38 | × | jolly quits (~jolly@208.180.97.158) (Ping timeout: 258 seconds) |
| 2021-07-27 19:07:57 | <monochrom> | That would be a Church vs Curry thing. "X doesn't want Y" can be "type error, not even wrong". |
| 2021-07-27 19:08:34 | × | curiousgay quits (~curiousga@77-120-186-48.kha.volia.net) (Ping timeout: 256 seconds) |
| 2021-07-27 19:08:48 | <c_wraith> | that is an option too. |
| 2021-07-27 19:09:46 | <DigitalKiwi> | I heard that parallel lines actually do meet, but they are very discrete. |
| 2021-07-27 19:10:00 | <monochrom> | :) |
| 2021-07-27 19:10:30 | → | Erutuon joins (~Erutuon@user/erutuon) |
| 2021-07-27 19:20:59 | → | pgib joins (~textual@173.38.117.81) |
| 2021-07-27 19:22:06 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 2021-07-27 19:22:27 | × | justsomeguy quits (~justsomeg@user/justsomeguy) (Quit: WeeChat 3.2) |
| 2021-07-27 19:27:07 | <lechner> | Hi, a question about $ vs () please. Why does this work liftIO $ putStrLn $ "Response from collector: " <> Lazy.unpack (Lazy.fromStrict acknowledgement) but this doesn't liftIO $ putStrLn $ "Response from collector: " <> Lazy.unpack $ Lazy.fromStrict acknowledgement |
| 2021-07-27 19:27:58 | <monochrom> | Do you know the precedence level and associativity of $ ? Can you compare that with the precendence level of <> ? |
| 2021-07-27 19:28:10 | <monochrom> | I think it's high time you find out. |
| 2021-07-27 19:29:00 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds) |
| 2021-07-27 19:29:13 | <monochrom> | It doesn't scale if every time you have $ and the nth operator you cannot be independent for the nth time. |
| 2021-07-27 19:29:49 | → | jolly joins (~jolly@208.180.97.158) |
| 2021-07-27 19:29:56 | <Cale> | lechner: $ is just a function defined as f $ x = f x, but it's defined to bind as weakly as possible to its arguments, while normal function application binds more tightly than any infix operator could |
| 2021-07-27 19:30:33 | <Cale> | (and also, it's specified to be right-associating, which I think is kind of a mistake, but it allows for that particular style of chaining) |
| 2021-07-27 19:30:44 | <lechner> | okay i thought about it the wrong way. it seemed like "the buck stops here from the right" |
| 2021-07-27 19:31:29 | <lechner> | actually, maybe that is still true |
| 2021-07-27 19:31:52 | <lechner> | it's really right vs left like monochrom said |
| 2021-07-27 19:31:53 | <Cale> | So, your second expression brackets like liftIO $ (putStrLn $ (("Response from collector: " <> Lazy.unpack) $ Lazy.fromStrict acknowledgement)) |
| 2021-07-27 19:32:05 | <Cale> | and you can see the problem there with the Lazy.unpack not getting an argument |
| 2021-07-27 19:32:57 | → | mr-red joins (~drd@93-39-151-19.ip76.fastwebnet.it) |
| 2021-07-27 19:33:27 | <Cale> | Plain function application (whitespace) binds more tightly to its arguments than any infix operator possibly can. If you remember nothing else about how infix operators get parsed, that's probably the most important thing. |
| 2021-07-27 19:34:19 | <lechner> | that's the exact opposite of $ then |
| 2021-07-27 19:34:24 | <Cale> | right |
| 2021-07-27 19:34:35 | <lechner> | no pun intended |
| 2021-07-27 19:34:39 | <Cale> | Also, it's left-associating, so f x y z means ((f x) y) z |
| 2021-07-27 19:34:57 | <lechner> | yeah i get that. wow. TIL thanks! |
| 2021-07-27 19:35:07 | <Cale> | I do kind of wish that ($) associated to the left as well, since whenever you have f $ g $ h $ x you could always rewrite that as f . g . h $ x |
| 2021-07-27 19:35:17 | × | drd quits (~drd@2001:b07:a70:9f1f:1562:34de:f50f:77d4) (Ping timeout: 255 seconds) |
| 2021-07-27 19:35:35 | <lechner> | i wondered about that |
| 2021-07-27 19:36:02 | <lechner> | i think i use too too mank $$'s and not enough point free |
| 2021-07-27 19:36:06 | <Cale> | But if it associated to the left instead, we could remove some more parens sometimes |
| 2021-07-27 19:36:16 | <monochrom> | I wouldn't say whitespace. map(+)[ 1 , 2 , 3 ] these whitespaces and these function applications are mutually exclusive. |
| 2021-07-27 19:36:35 | <Cale> | Yeah, that's fair, it doesn't have to be whitespace proper :) |
| 2021-07-27 19:36:41 | <Cale> | juxtaposition :) |
| 2021-07-27 19:36:44 | <lechner> | i got the point though |
| 2021-07-27 19:36:45 | <monochrom> | The correct model is juxtaposition of two expressions. |
| 2021-07-27 19:36:54 | → | curiousgay joins (~curiousga@77-120-186-48.kha.volia.net) |
| 2021-07-27 19:37:10 | <lechner> | that's where logic and plain english drift apart |
| 2021-07-27 19:37:31 | <lechner> | why juxtaposition? |
| 2021-07-27 19:37:45 | <monochrom> | Because it is juxtaposition? |
| 2021-07-27 19:37:46 | <Cale> | If you start out by replacing all but the last $ with . where you can, it's a good syntactic trick for starting to think about composing functions instead |
| 2021-07-27 19:38:05 | × | berberman quits (~berberman@user/berberman) (Ping timeout: 252 seconds) |
| 2021-07-27 19:38:15 | → | Guest4 joins (~Guest4@210.18.130.156) |
| 2021-07-27 19:38:34 | <lechner> | for some reason that never works, at least not with lazy and strict ByteStrings |
| 2021-07-27 19:38:42 | <Cale> | hmm |
| 2021-07-27 19:38:49 | <lechner> | maybe with lazy alone |
| 2021-07-27 19:38:56 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 2021-07-27 19:39:01 | <Cale> | The types shouldn't affect anything |
| 2021-07-27 19:39:06 | × | Guest4 quits (~Guest4@210.18.130.156) (Client Quit) |
| 2021-07-27 19:39:24 | <Cale> | You do need to leave spaces around the composition dots though, and not put spaces around the ones which are module qualifiers |
| 2021-07-27 19:39:46 | <Cale> | I'm still a little bit salty that we went with "." for module qualification, given how important composition is. |
| 2021-07-27 19:40:05 | <Cale> | I get that it matches all the other languages in the world but still :) |
| 2021-07-27 19:40:08 | <lechner> | you would have preferred? |
| 2021-07-27 19:40:30 | × | fossdd quits (~fossdd@sourcehut/user/fossdd) (Ping timeout: 250 seconds) |
| 2021-07-27 19:40:35 | <Cale> | I'm not sure, maybe | would have worked out. |
| 2021-07-27 19:40:41 | × | alx741 quits (~alx741@186.178.108.3) (Ping timeout: 255 seconds) |
| 2021-07-27 19:40:44 | <lechner> | isn't the dot usally for records, like in PureScript? |
| 2021-07-27 19:40:55 | <Cale> | Well, that too |
| 2021-07-27 19:41:06 | <geekosaur> | ' might have worked if not for the stuff that took it later |
| 2021-07-27 19:41:13 | <Cale> | Yeah |
| 2021-07-27 19:41:15 | <lechner> | i would have liked | it's like a pipe |
| 2021-07-27 19:41:17 | <monochrom> | Would you prefer Control∘Monad∘State haha |
| 2021-07-27 19:41:17 | → | fossdd joins (~fossdd@sourcehut/user/fossdd) |
| 2021-07-27 19:41:32 | <Cale> | I prefer things that I can easily type, to be sure |
| 2021-07-27 19:41:49 | <yushyin> | Control-Monad-State |
| 2021-07-27 19:41:57 | <Cale> | Otherwise, I probably would prefer using ∘ for composition |
| 2021-07-27 19:43:07 | <lechner> | Can I do anything about the $'s here? send catcher [] $ Lazy.toStrict $ Lzma.compress $ JSON.encode task |
| 2021-07-27 19:43:27 | × | epolanski quits (uid312403@id-312403.brockwell.irccloud.com) (Quit: Connection closed for inactivity) |
| 2021-07-27 19:43:27 | <lechner> | does that operator have a name? |
| 2021-07-27 19:43:27 | <Cale> | You could rewrite that as send catcher [] . Lazy.toStrict . Lzma.compress $ JSON.encode task |
| 2021-07-27 19:43:42 | <Cale> | Which one? |
| 2021-07-27 19:43:46 | <lechner> | $ |
| 2021-07-27 19:44:16 | <Cale> | I think most people just say "dollar sign", but you could say "function application" |
| 2021-07-27 19:44:20 | <monochrom> | You know what, in Chinese, or at least Chinese writings in the early 20th century, we write Western people names by: (after transliterating to Chinese characters of similar sounds) FirstName·LastName |
| 2021-07-27 19:44:41 | <monochrom> | Perhaps that would also be the perfect scheme for hierarchical module names. |
All times are in UTC.