Home liberachat/#haskell: Logs Calendar

Logs: liberachat/#haskell

←Prev  Next→ 1,802,041 events total
2025-12-01 20:02:53 <EvanR> I can never remember what is being replaced with what
2025-12-01 20:03:12 <chromoblob> me too
2025-12-01 20:03:18 ljdarj joins (~Thunderbi@user/ljdarj)
2025-12-01 20:03:29 <[exa]> and then you read a paper and they do [x\y] to disambiguate for good
2025-12-01 20:03:45 <monochrom> Last time I was very inspired by Python "<expr1> if <exprBool> else <expr0>". (I was primed; I was first inspired by Hoare's "<expr1> ◁ <exprBool> ▷ <expr0>".)
2025-12-01 20:03:55 × trickard quits (~trickard@cpe-85-98-47-163.wireline.com.au) (Read error: Connection reset by peer)
2025-12-01 20:04:08 trickard_ joins (~trickard@cpe-85-98-47-163.wireline.com.au)
2025-12-01 20:04:27 × iqubic quits (~sophia@2601:602:9203:1660:c137:59bd:3f5b:b4a7) (Remote host closed the connection)
2025-12-01 20:04:51 <mauke> monochrom: have you already done here-docs?
2025-12-01 20:05:07 <monochrom> Python does not allow <exprBool> to be its own "if-else" but it is easy to see there would be no ambiguity, so I allow it in my homework!
2025-12-01 20:05:20 <monochrom> No.
2025-12-01 20:07:26 <mauke> that's one of the more interesting wrinkles I know of that are in real use
2025-12-01 20:07:50 <[exa]> oh I wish editors had proper support for hiding these (and popping them out)
2025-12-01 20:08:21 <tomsmeding> EvanR [exa]: the way I remember the meaning of [x/y] is "multiply by x, then divide by y"; if you have 2*3*4*5 and you do *17/5 you replace the 5 with 17, so E[x/y] means replace y with x
2025-12-01 20:08:37 <tomsmeding> it doesn't quite work because it replaces _all_ occurrences, not just one
2025-12-01 20:09:06 × kuribas quits (~user@2a02-1810-2825-6000-91ce-6f5d-5219-16e3.ip6.access.telenet.be) (Remote host closed the connection)
2025-12-01 20:09:22 <mauke> tomsmeding: yeah, that's just (morally) wrong
2025-12-01 20:09:32 <EvanR> lol
2025-12-01 20:09:45 <chromoblob> i made that mnemonic too, but then i saw [x/y] defined to mean the opposite, replace x with y
2025-12-01 20:09:59 <EvanR> maybe if you insist that it's a string of multiplied primes
2025-12-01 20:10:00 <[exa]> I'm grateful for the mnemonic
2025-12-01 20:10:02 <[exa]> but aaaaaaaaaaaaaa
2025-12-01 20:10:06 <EvanR> at most one each
2025-12-01 20:10:11 <mauke> the correct syntax should be ${foo/x/y}
2025-12-01 20:10:18 <tomsmeding> > The header of the syntax file lists the Haskell-Cafe ML as the maintainer. This is so unusual for a distributed syntax file that it might be the only example.
2025-12-01 20:10:20 <tomsmeding> lol!
2025-12-01 20:10:28 <[exa]> EvanR: [goedel voice:] ofcourse it's a string of multiplied primes!
2025-12-01 20:10:55 <EvanR> well 4 is not prime
2025-12-01 20:11:01 <tomsmeding> yes I'm not saying it's good notation or that the mnemonic is perfect, but it works for me :p
2025-12-01 20:11:20 <monochrom> [x/y/g] >:)
2025-12-01 20:11:29 <tomsmeding> and authors that use it the other way round should just be shooed back to their writing desk and replace / with :=
2025-12-01 20:11:51 × spew quits (~spew@user/spew) (Quit: spew)
2025-12-01 20:12:18 <tomsmeding> I read it as "E with x for y"
2025-12-01 20:12:26 <[exa]> tomsmeding: isn't that quite inconvenient to read if your replacement is a long term
2025-12-01 20:12:43 <[exa]> (probably not a concern for symbolic logic papers tho)
2025-12-01 20:12:46 <tomsmeding> if the term to replace is long, you mean?
2025-12-01 20:13:14 <[exa]> yes, [blab-las+dweur*yiwuerywer/y] looks unhappy
2025-12-01 20:13:32 <tomsmeding> oh right
2025-12-01 20:13:33 <EvanR> that they never actually write concrete examples is why it's hard to remember
2025-12-01 20:13:40 <EvanR> it's like... x and y
2025-12-01 20:13:45 <tomsmeding> EvanR: no it's because the notation is bad
2025-12-01 20:13:49 <EvanR> also that
2025-12-01 20:14:08 <[exa]> tomsmeding: anyway yeah that PR was full of surprise
2025-12-01 20:14:37 <tomsmeding> like, yes I use vim heavily and I write lots of haskell, but no I would not particularly like to be listed as maintainer of the haskell syntax file lol
2025-12-01 20:14:45 <tomsmeding> if I was, I'm not sure I would have passed that change
2025-12-01 20:14:56 <tomsmeding> people who write fmap ` fmap ` fmap can just do that in some other editor
2025-12-01 20:15:24 <tomsmeding> also, if I'd be listed, I would feel the responsibility to make sure that the syntax file is actually correct
2025-12-01 20:15:30 <tomsmeding> which I do _not_ want to do because that's a hell of a job
2025-12-01 20:15:36 <tomsmeding> and probably impossible
2025-12-01 20:15:46 <tomsmeding> it's best-effort anyway
2025-12-01 20:17:14 <chromoblob> >:(
2025-12-01 20:17:47 <ski> EvanR : the idea with `[x/y]' is that `y' is "divided away" and `x' is "multiplied in", in its place(s)
2025-12-01 20:18:10 <EvanR> yes I saw that just now
2025-12-01 20:18:24 <ski> ah, tomsmeding said
2025-12-01 20:18:30 <EvanR> "interesting"
2025-12-01 20:18:35 <mauke> then they should have written [/y*x]
2025-12-01 20:18:49 <tomsmeding> no, clearly that's dividing by _both_ y and x
2025-12-01 20:18:53 <EvanR> lol
2025-12-01 20:19:00 <tomsmeding> (/s)
2025-12-01 20:19:10 <EvanR> use reverse polish obv
2025-12-01 20:19:24 <tomsmeding> [x*y/]?
2025-12-01 20:19:25 <EvanR> [y / x *]
2025-12-01 20:19:32 <tomsmeding> ah right
2025-12-01 20:19:56 <EvanR> now we have the other notation almost
2025-12-01 20:20:19 <ski> [y x * /]
2025-12-01 20:22:23 <ski> the phrase "substitute `x' for `y' in `...'" always sounded a bit awkward, to me
2025-12-01 20:23:39 <[exa]> [x/y] ~~flip~~> ]y/x[ ...intuitive!
2025-12-01 20:24:47 skum joins (~skum@user/skum)
2025-12-01 20:27:19 × dhil quits (~dhil@5.151.29.137) (Ping timeout: 240 seconds)
2025-12-01 20:29:42 <tomsmeding> makes me think of the notation for (half)-open intervals [x,y[, as opposed to the (to me) more usual [x,y)
2025-12-01 20:29:58 <EvanR> [x,y[ looks insane
2025-12-01 20:29:58 <ski> both look quite ugly, to me
2025-12-01 20:29:59 <RMSBach> That phrase sounds pretty normal to me. It is at least more immediately obvious than the notation under discussion.
2025-12-01 20:30:38 <tomsmeding> EvanR: actually a graphing library gave me that at some point, and I spent multiple minutes thinking that there must be a bug in the legend creation before I figured out what they were trying to tell me
2025-12-01 20:31:21 <[exa]> if someone's syntax looks like a stupid joke in #haskell, you know there's an issue
2025-12-01 20:31:29 × peterbecich quits (~Thunderbi@172.222.148.214) (Ping timeout: 260 seconds)
2025-12-01 20:31:40 <ski> for a long time i had to second-think, reminding myself that `y' was being replaced by `x', rather than the other way around, in that "substitute .. for .. in .." phrase
2025-12-01 20:32:27 <[exa]> what's the better way to write [x,y) interval btw? (I thought that one is pretty much standard)
2025-12-01 20:32:47 <ski> (my immediate reading, when first encountering it, was the opposite reading of the intended one)
2025-12-01 20:33:04 <EvanR> substitute x, does this phrase mean x is going in, or being replaced
2025-12-01 20:33:14 <EvanR> maybe the issue is with english
2025-12-01 20:33:28 <ski> mm
2025-12-01 20:33:42 <RMSBach> <ski> I won't fault anyone for needing a moment to think about it, but it follows standard English, ex "substitute cornstarch for AP flower if necessary"
2025-12-01 20:35:09 <ski> [exa] : mayhaps ⌜{x ≤ < y}⌝, or something along those lines ..
2025-12-01 20:35:42 <RMSBach> I will admit that if we change the preposition to "with" then the order of the nominal phrases can be switched at least colloquially.
2025-12-01 20:36:22 <[exa]> ski: yeah I sometimes use that too if I've got the middle value to write
2025-12-01 20:37:08 <[exa]> RMSBach: tbh for non-english people the meaning of `for` is completely inexplicable in the phrase
2025-12-01 20:39:49 <RMSBach> exa: Prepositions are often confusing without full command of a foreign language. `por` and `para` present problems for English speakers learning English. But point taken.
2025-12-01 20:40:00 <ski> RMSBach : yea, i'm not really much familiar with the phrase, in a colloquial sense, either
2025-12-01 20:40:27 <ski> (also, if you respond like that, it looks like you're quoting me, which looks confusing)
2025-12-01 20:41:08 <ski> [exa] : which middle value ?
2025-12-01 20:41:43 <RMSBach> I vote for `[y:=x]` fwiw]
2025-12-01 20:43:48 <RMSBach> I think the majority of lambda calculus materials I have read used that notation for beta reduction
2025-12-01 20:44:02 <ski> there's also `[y |-> x]'
2025-12-01 20:44:54 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
2025-12-01 20:45:17 <EvanR> x gets replaced with y, got it
2025-12-01 20:45:33 <ski> (the idea being that you have a mapping from variables to terms, and then you (monadically) extend that to also apply to arbitrary term inputs)
2025-12-01 20:45:35 <EvanR> or is it y transforms to x
2025-12-01 20:45:54 <ski> the latter (is what i would say)
2025-12-01 20:46:02 <RMSBach> That's how I read it too

All times are in UTC.