2024/11/19

Newest at the top

2024-11-20 00:05:43 +0100 <Leary> I mean, GHC could just do the inlining for you. Not like it doesn't already do plenty of that.
2024-11-20 00:04:52 +0100 <geekosaur> "Magic" would be quite literal
2024-11-20 00:03:17 +0100 <geekosaur> think about it
2024-11-20 00:03:12 +0100 <geekosaur> I still don't know how you think that would work
2024-11-19 23:56:48 +0100L29Ah(~L29Ah@wikipedia/L29Ah) (Error from remote client)
2024-11-19 23:55:14 +0100 <hellwolf> you can do a lot with this trick... this needn't to be a amazement if GHC didn't have that "stage restriction". But for now, it's wonderful.
2024-11-19 23:52:28 +0100 <hellwolf> I understood that I could skip the $() at top-level.
2024-11-19 23:52:17 +0100 <hellwolf> but then... it seems all very reasonable that I didn't have to name it.
2024-11-19 23:51:55 +0100 <hellwolf> I took your example and named it, and it didn't work.
2024-11-19 23:51:38 +0100 <hellwolf> I didn't know the trick of not naming it.
2024-11-19 23:50:59 +0100 <Leary> hellwolf: It is a `Q [Dec]`, implicitly wrapped in $(). The key to avoiding the stage restriction is to inline it into the top-level instead of naming it or its components.
2024-11-19 23:50:25 +0100Tuplanolla(~Tuplanoll@91-159-69-59.elisa-laajakaista.fi) Tuplanolla
2024-11-19 23:48:18 +0100 <hellwolf> https://play-haskell.tomsmeding.com/saved/BnEqXAOh
2024-11-19 23:47:54 +0100 <hellwolf> Thank you!
2024-11-19 23:47:50 +0100 <hellwolf> https://play-haskell.tomsmeding.com/saved/fFgkdYeB <-- I saved the excerpt.
2024-11-19 23:47:37 +0100haritz(~hrtz@user/haritz) haritz
2024-11-19 23:47:37 +0100haritz(~hrtz@82-69-11-11.dsl.in-addr.zen.co.uk) (Changing host)
2024-11-19 23:47:34 +0100haritz(~hrtz@82-69-11-11.dsl.in-addr.zen.co.uk)
2024-11-19 23:47:34 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2024-11-19 23:47:18 +0100Alleria_(~Alleria@user/alleria) (Ping timeout: 276 seconds)
2024-11-19 23:44:40 +0100 <hellwolf> this is magic
2024-11-19 23:44:34 +0100 <hellwolf> hallelujah
2024-11-19 23:44:14 +0100 <hellwolf> and it did work!
2024-11-19 23:44:12 +0100 <hellwolf> oh wait, so you didn't wrap it in a Q Dec
2024-11-19 23:44:01 +0100Alleria(~Alleria@user/alleria) Alleria
2024-11-19 23:43:30 +0100haritz(~hrtz@user/haritz) (Ping timeout: 252 seconds)
2024-11-19 23:43:10 +0100 <Leary> hellwolf: https://play-haskell.tomsmeding.com/saved/T1DSbH8S
2024-11-19 23:42:12 +0100 <hellwolf> (without full understanding of why)
2024-11-19 23:41:58 +0100 <hellwolf> my dogmatic belief was that I should always use TH Qs imported.
2024-11-19 23:41:34 +0100ljdarj1ljdarj
2024-11-19 23:41:34 +0100ljdarj(~Thunderbi@user/ljdarj) (Ping timeout: 260 seconds)
2024-11-19 23:41:12 +0100 <hellwolf> me? I was expecting magic.
2024-11-19 23:40:49 +0100 <hellwolf> but then it would warn about orphaned instances, which is probably not too bad.
2024-11-19 23:40:23 +0100 <geekosaur> ?
2024-11-19 23:40:22 +0100 <hellwolf> but I can indeed use that in a separate module, which doesn't make the module organization awkward
2024-11-19 23:40:22 +0100 <geekosaur> what were you expecting? that ghc would pull the definition out and build it separately
2024-11-19 23:39:42 +0100 <hellwolf> :(
2024-11-19 23:39:41 +0100 <hellwolf> and must be imported, not defined locally
2024-11-19 23:39:41 +0100 <hellwolf> ‘declare_all_valid_intn’ is used in a top-level splice, quasi-quote, or annotation,
2024-11-19 23:39:41 +0100 <hellwolf> GHC stage restriction:
2024-11-19 23:39:11 +0100ljdarj1(~Thunderbi@user/ljdarj) ljdarj
2024-11-19 23:36:42 +0100mange(~user@user/mange) mange
2024-11-19 23:35:05 +0100 <hellwolf> (say no more, let me try, learning something every day)
2024-11-19 23:34:12 +0100 <Leary> Non-trivial TH does, so that the functions you invoke within are already compiled.
2024-11-19 23:34:04 +0100evocatus(~evocatus@2a02:a210:20c2:d600:1496:234e:dc9f:5868) (Ping timeout: 272 seconds)
2024-11-19 23:33:51 +0100esph(~weechat@user/esph) esph
2024-11-19 23:32:24 +0100 <hellwolf> I never truly understood why TH has to be in a separate module.
2024-11-19 23:32:03 +0100 <hellwolf> oh?! was that a dogma in that I believed?
2024-11-19 23:31:09 +0100 <Leary> Oh dear. Well, in any case, TH doesn't necessarily require another module. Try `flip foldMap [1..32] \i -> [d| instance ValidINTn $(litT (numTyLit i)) |]`.
2024-11-19 23:28:31 +0100michalz(~michalz@185.246.207.193) (Remote host closed the connection)