Newest at the top
2025-02-01 03:41:32 +0100 | <geekosaur> | by the time you apply it to the tuple, it's too late to go back and do sharing. if you specify it in the let, it can share |
2025-02-01 03:41:31 +0100 | <euouae> | I haven't heard of dictionary before |
2025-02-01 03:41:18 +0100 | nitrix | (~nitrix@user/meow/nitrix) (Quit: ZNC 1.8.2 - https://znc.in) |
2025-02-01 03:41:16 +0100 | <int-e> | Concretely at runtime, the argument is a Num dictionary for p. |
2025-02-01 03:41:07 +0100 | <geekosaur> | as long as it has a constraint, it's like a partially applied function. (=> looks like -> for a reason) the thing that needs to be applied is an instance dictionary |
2025-02-01 03:40:50 +0100 | <EvanR> | no the => in Num p => p |
2025-02-01 03:40:41 +0100 | <euouae> | the `p` argument in Num p => p? |
2025-02-01 03:40:37 +0100 | <EvanR> | no |
2025-02-01 03:40:30 +0100 | <euouae> | when you say function do you mean type function |
2025-02-01 03:39:40 +0100 | <euouae> | it's something more than that |
2025-02-01 03:39:38 +0100 | <EvanR> | pair of numbers vs "like a function waiting for two different Num instances, that may or may not happen to be the same instance" |
2025-02-01 03:39:25 +0100 | <euouae> | Yeah, `let x = trace "foo" 1 in (x :: Int, x :: Int)` will still print two foos |
2025-02-01 03:39:03 +0100 | <int-e> | so it's not *just* type inference |
2025-02-01 03:38:54 +0100 | <int-e> | well sharing and lack thereof is firmly a runtime phenomenon |
2025-02-01 03:38:53 +0100 | <EvanR> | now it's a pair of numbers |
2025-02-01 03:38:48 +0100 | <lambdabot> | (Int, Double) |
2025-02-01 03:38:47 +0100 | <EvanR> | :t let y = 1 in (y,y) :: (Int, Double) |
2025-02-01 03:38:18 +0100 | <euouae> | because I can do :: (Int, Double) |
2025-02-01 03:38:12 +0100 | <euouae> | well, so it is type inference right |
2025-02-01 03:37:57 +0100 | <geekosaur> | think about that one for a bit |
2025-02-01 03:37:34 +0100 | <lambdabot> | (Num a, Num b) => (a, b) |
2025-02-01 03:37:33 +0100 | <geekosaur> | :t let y = 1 in (y,y) |
2025-02-01 03:37:24 +0100 | <EvanR> | rather than a number |
2025-02-01 03:37:13 +0100 | <EvanR> | 1 is like a function waiting to be given a Num instance |
2025-02-01 03:37:09 +0100 | <euouae> | it being Num doesn't tell me much I don't know what to make of it |
2025-02-01 03:36:56 +0100 | <lambdabot> | Num p => p |
2025-02-01 03:36:55 +0100 | <int-e> | :t 1 |
2025-02-01 03:36:50 +0100 | <geekosaur> | well, it did but it didn't reach a final result |
2025-02-01 03:36:38 +0100 | <geekosaur> | there's a piece missing |
2025-02-01 03:36:34 +0100 | <geekosaur> | type inference didn't happen |
2025-02-01 03:36:23 +0100 | <euouae> | because the type inference prevents it from being shared? |
2025-02-01 03:36:07 +0100 | <EvanR> | that's so tricky |
2025-02-01 03:35:29 +0100 | <int-e> | the remark about optimizations is valid too of course |
2025-02-01 03:34:45 +0100 | <geekosaur> | oh, right |
2025-02-01 03:34:38 +0100 | <int-e> | then figure out why adding a type signature makes a difference |
2025-02-01 03:34:24 +0100 | <int-e> | compare let y = trace "y-demanded" 1 :: Integer in (y, y) |
2025-02-01 03:34:19 +0100 | <geekosaur> | (if you were doing it in ghci, you weren't) |
2025-02-01 03:34:10 +0100 | <geekosaur> | did you use optimization? |
2025-02-01 03:33:48 +0100 | <euouae> | Is it just because sharing (for some reason) didn't happen there? |
2025-02-01 03:33:42 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds) |
2025-02-01 03:33:34 +0100 | <euouae> | but e.g. `let y = trace "y-demanded" 1 in (y, y)` will print two y-demanded messages. Why? I thought 'y' would be shared in the pair expression |
2025-02-01 03:33:17 +0100 | <euouae> | Hello I was using Debug.Trace to check up on sharing |
2025-02-01 03:33:02 +0100 | euouae | (~euouae@user/euouae) euouae |
2025-02-01 03:32:51 +0100 | euleritian | (~euleritia@77.23.250.232) |
2025-02-01 03:32:33 +0100 | euleritian | (~euleritia@77.23.250.232) (Remote host closed the connection) |
2025-02-01 03:31:19 +0100 | vanishingideal | (~vanishing@user/vanishingideal) vanishingideal |
2025-02-01 03:30:09 +0100 | tavare | (~tavare@user/tavare) tavare |
2025-02-01 03:29:18 +0100 | vanishingideal | (~vanishing@user/vanishingideal) (Ping timeout: 252 seconds) |
2025-02-01 03:28:58 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-02-01 03:17:56 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds) |