Newest at the top
2024-10-07 22:33:51 +0200 | <dolio> | Agda has an analogous annoyance. Sometimes I'd like to define something in a `where` that I use in a `with`. But I can't do that, because the `with` introduces clauses that each have their own `where`, not vice versa. |
2024-10-07 22:33:47 +0200 | <monochrom> | in fact, also available to the guard conditions. "case x:xt | z > 0 -> ... where z=x+2" is OK. |
2024-10-07 22:33:34 +0200 | ljdarj | (~Thunderbi@user/ljdarj) (Ping timeout: 260 seconds) |
2024-10-07 22:32:58 +0200 | <monochrom> | "case x:xt | x > 0 -> y | otherwise -> - y where y = x*x" y is available to both branches. |
2024-10-07 22:31:37 +0200 | <monochrom> | Yes that one is right. |
2024-10-07 22:31:36 +0200 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2024-10-07 22:30:54 +0200 | <dolio> | E.G. definitions in a `where` are in scope in guards, I think, which would not be possible if the `where` were part of the expression after the guards. |
2024-10-07 22:30:49 +0200 | <monochrom> | This is why "let x = 0:y in x where y = 1:x" is the best of both worlds. >:) |
2024-10-07 22:30:45 +0200 | CiaoSen | (~Jura@2a05:5800:2e4:9e00:ca4b:d6ff:fec1:99da) CiaoSen |
2024-10-07 22:30:40 +0200 | euphores | (~SASL_euph@user/euphores) (Quit: Leaving.) |
2024-10-07 22:30:22 +0200 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2024-10-07 22:30:15 +0200 | bliminse | (~bliminse@user/bliminse) (Quit: leaving) |
2024-10-07 22:29:57 +0200 | <monochrom> | The dilemma between "defining stuff out of the blue before getting to the point" and "the point using terms out of the blue before being defined" >:) |
2024-10-07 22:29:47 +0200 | ljdarj1 | (~Thunderbi@user/ljdarj) ljdarj |
2024-10-07 22:29:43 +0200 | <dolio> | Also, making where an expression like Landin has its disadvantages w/r/t how Haskell's syntax currently works. |
2024-10-07 22:27:51 +0200 | <dolio> | I think having `where` reference things in other scopes based on the occurrence of the bound names sounds pretty confusing and difficult to figure out. |
2024-10-07 22:23:48 +0200 | <EvanR> | like a damn math book, they define stuff seemingly out of blue before getting to the point |
2024-10-07 22:23:28 +0200 | <EvanR> | where the definitions are in order |
2024-10-07 22:23:08 +0200 | <EvanR> | I'm finding where clause to be awkward sometimes. Unless it's a wild mess of definitions that must be necessarily out of order, or there's no logical order of presentation, I've been liking block of let bindings ending with an in |
2024-10-07 22:21:32 +0200 | euleritian | (~euleritia@dynamic-176-006-132-124.176.6.pool.telefonica.de) |
2024-10-07 22:21:08 +0200 | euleritian | (~euleritia@dynamic-176-006-132-124.176.6.pool.telefonica.de) (Read error: Connection reset by peer) |
2024-10-07 22:21:04 +0200 | euleritian | (~euleritia@dynamic-176-006-132-124.176.6.pool.telefonica.de) |
2024-10-07 22:20:49 +0200 | euleritian | (~euleritia@dynamic-176-006-132-124.176.6.pool.telefonica.de) (Remote host closed the connection) |
2024-10-07 22:18:18 +0200 | athan | (~athan@syn-098-153-145-140.biz.spectrum.com) athan |
2024-10-07 22:17:56 +0200 | wootehfoot | (~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer) |
2024-10-07 22:12:51 +0200 | <yin> | c_wraith: just syntactical convenience |
2024-10-07 22:11:22 +0200 | <yin> | ty |
2024-10-07 22:10:28 +0200 | euleritian | (~euleritia@dynamic-176-006-132-124.176.6.pool.telefonica.de) |
2024-10-07 22:09:56 +0200 | euleritian | (~euleritia@ip5f5ad3f6.dynamic.kabel-deutschland.de) (Ping timeout: 272 seconds) |
2024-10-07 22:09:34 +0200 | <monochrom> | Look for the paper "the next 700 languages" |
2024-10-07 22:09:21 +0200 | <yin> | i don't know who Landin is |
2024-10-07 22:08:52 +0200 | <monochrom> | err, I don't even think you can't! |
2024-10-07 22:08:39 +0200 | <monochrom> | I don't even think you can design your language to accept "let x = 0:y in x where y = 1:x" haha |
2024-10-07 22:07:48 +0200 | <monochrom> | Haskell's "let x=e in b" certainly becomes Landin's "b where x=e". |
2024-10-07 22:07:43 +0200 | <c_wraith> | if you're going to just specify the behavior as "perform all these bindings, make these names in scope", how is it any different from just putting them in the do block? |
2024-10-07 22:07:19 +0200 | <monochrom> | I think you could do it in your language. |
2024-10-07 22:07:04 +0200 | <EvanR> | it attaches to definitions and case alternatives |
2024-10-07 22:06:50 +0200 | <EvanR> | thing |
2024-10-07 22:06:45 +0200 | <EvanR> | where clause isn't an expression by itself, is another |
2024-10-07 22:06:30 +0200 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2024-10-07 22:06:18 +0200 | ljdarj1 | ljdarj |
2024-10-07 22:05:58 +0200 | <yin> | i understand the current constraints. i guess what i'm asking is if there would be something stopping us from doing it if we wanted to? c_wraith asks a good question, but i think we could get around that if we just considered sugar for implicitly passing the bound variable as an argument |
2024-10-07 22:05:41 +0200 | ljdarj | (~Thunderbi@user/ljdarj) (Ping timeout: 255 seconds) |
2024-10-07 22:04:56 +0200 | <monochrom> | haha |
2024-10-07 22:04:51 +0200 | <EvanR> | </clippy> |
2024-10-07 22:04:40 +0200 | <EvanR> | maybe you want to use a recursive do |
2024-10-07 22:04:39 +0200 | <monochrom> | To be sure, Landin would have (actually did) "where" belonging to an expression, so meh, it's a personal taste, you can design a language to look whatever you like. |
2024-10-07 22:04:01 +0200 | ljdarj1 | (~Thunderbi@user/ljdarj) ljdarj |
2024-10-07 22:02:25 +0200 | <monochrom> | "f x = y+1 where y = x" the "where" belongs to "f x =", not to "y+1". "case xs of x:xt -> y+1 where y = x" the "where" belongs to "x:xt ->", not to "y+1". |
2024-10-07 22:02:16 +0200 | <int-e> | (after desugaring, the x is not in scope outside of that lambda) |