Newest at the top
2025-04-01 17:36:32 +0200 | mari-estel | (~mari-este@user/mari-estel) mari-estel |
2025-04-01 17:36:27 +0200 | <int-e> | those top-level ! override an implicit outermost ~ |
2025-04-01 17:36:11 +0200 | <int-e> | tomsmeding: yes, and they are different too |
2025-04-01 17:35:57 +0200 | <tomsmeding> | int-e: should they? |
2025-04-01 17:35:32 +0200 | <tomsmeding> | top-level bang patterns have the additional effect of making the whole binding strict |
2025-04-01 17:35:07 +0200 | <tomsmeding> | in a let, that is |
2025-04-01 17:35:00 +0200 | <tomsmeding> | non-top-level bang patterns only have an effect if the pattern as a whole is used |
2025-04-01 17:34:51 +0200 | <int-e> | but for a newtype T, !(T x) and T (!x) should be different |
2025-04-01 17:34:47 +0200 | <lambdabot> | "hi" |
2025-04-01 17:34:45 +0200 | <tomsmeding> | > let (x,!y) = ("x", undefined) in "hi" |
2025-04-01 17:34:41 +0200 | <lambdabot> | "hi *Exception: Prelude.undefined |
2025-04-01 17:34:39 +0200 | <tomsmeding> | > let (x,!y) = ("x", undefined) in "hi " ++ x |
2025-04-01 17:34:15 +0200 | <int-e> | (empirically) |
2025-04-01 17:34:15 +0200 | <EvanR> | ok so we're not lisp yet |
2025-04-01 17:34:06 +0200 | <tomsmeding> | yes, that's how ghc interprets it |
2025-04-01 17:34:04 +0200 | <EvanR> | lol |
2025-04-01 17:34:00 +0200 | <int-e> | EvanR: it's equivalent to let !x = ... |
2025-04-01 17:34:00 +0200 | <tomsmeding> | ambiguous |
2025-04-01 17:33:55 +0200 | rvalue | (~rvalue@user/rvalue) rvalue |
2025-04-01 17:33:49 +0200 | <EvanR> | so wtf is let (!x) = ... |
2025-04-01 17:33:44 +0200 | Googulator18 | (~Googulato@2a01-036d-0106-211a-ac5d-24c1-ad5e-7f2b.pool6.digikabel.hu) |
2025-04-01 17:33:24 +0200 | <tomsmeding> | where `let !(x,y)` would be a "top-level" bang pattern, and `let (!x,y)` would not be |
2025-04-01 17:33:24 +0200 | rvalue | (~rvalue@user/rvalue) (Read error: Connection reset by peer) |
2025-04-01 17:33:20 +0200 | <EvanR> | what's top level in a pattern |
2025-04-01 17:33:18 +0200 | Googulator18 | (~Googulato@2a01-036d-0106-211a-ac5d-24c1-ad5e-7f2b.pool6.digikabel.hu) (Quit: Client closed) |
2025-04-01 17:33:06 +0200 | <lambdabot> | | |
2025-04-01 17:33:06 +0200 | <lambdabot> | Top-level strict bindings aren't allowed: !L.x = () |
2025-04-01 17:33:06 +0200 | <lambdabot> | /sandbox/tmp/.L.hs:168:1: error: |
2025-04-01 17:33:05 +0200 | <tomsmeding> | I mean top-level in a pattern |
2025-04-01 17:33:05 +0200 | <int-e> | @let !x = () |
2025-04-01 17:33:01 +0200 | <tomsmeding> | ah, that's top-level in a module |
2025-04-01 17:33:00 +0200 | <EvanR> | https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/strict.html |
2025-04-01 17:32:53 +0200 | <EvanR> | >Strict bindings are not allowed at the top level of a module. |
2025-04-01 17:32:21 +0200 | tromp | (~textual@2001:1c00:3487:1b00:29bc:7fae:9d9f:d545) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2025-04-01 17:32:11 +0200 | <tomsmeding> | what are you reading? |
2025-04-01 17:31:56 +0200 | <EvanR> | the one I was reading said strict bindings are not allowed at top level but I guess that's old now? |
2025-04-01 17:31:42 +0200 | <int-e> | as you said (failed to delete) |
2025-04-01 17:31:34 +0200 | <tomsmeding> | I'm half-sure this changed at some point |
2025-04-01 17:31:34 +0200 | <int-e> | but (!x) is still top-level, |
2025-04-01 17:31:26 +0200 | <tomsmeding> | but "top-level" may be under parentheses |
2025-04-01 17:31:16 +0200 | <EvanR> | that would be an interesting thing to optimize out |
2025-04-01 17:31:12 +0200 | <tomsmeding> | ah no, there is a semantical difference between a top-level bang pattern in a let binding, and a bang somewhere nested |
2025-04-01 17:31:02 +0200 | <lambdabot> | *Exception: <<loop>> |
2025-04-01 17:31:00 +0200 | <int-e> | > let a = let (!(x,y)) = a in (0,x) in a |
2025-04-01 17:30:38 +0200 | <lambdabot> | (0,0) |
2025-04-01 17:30:36 +0200 | <int-e> | > let a = let (x,y) = a in (0,x) in a |
2025-04-01 17:30:32 +0200 | <lambdabot> | *Exception: <<loop>> |
2025-04-01 17:30:30 +0200 | <tomsmeding> | or wait |
2025-04-01 17:30:29 +0200 | <int-e> | > let a = let !(x,y) = a in (0,x) in a |
2025-04-01 17:30:17 +0200 | <EvanR> | o_O |