Newest at the top
2025-07-21 22:19:09 +0200 | <haskellbridge> | <magic_rb> i just want to state, you guys have completely lost me :) but no worries, ill bother you some other when im not falling asleep |
2025-07-21 22:19:07 +0200 | Frostillicus | (~Frostilli@pool-71-174-119-69.bstnma.fios.verizon.net) |
2025-07-21 22:17:30 +0200 | <glguy> | It's often much more pleasant to use th-abstraction instead of using `reify` directly https://hackage.haskell.org/package/th-abstraction-0.7.1.0/docs/Language-Haskell-TH-Datatype.html |
2025-07-21 22:17:12 +0200 | jmcantrell | (~weechat@user/jmcantrell) jmcantrell |
2025-07-21 22:17:04 +0200 | <dminuoso> | Nevermind, we've got our wires crossed. |
2025-07-21 22:17:03 +0200 | <tomsmeding> | which is unwieldy, so caseE exists |
2025-07-21 22:16:51 +0200 | <tomsmeding> | so with CaseE, that would need to be [| val |] >>= \exp -> pure (CaseE exp ....) |
2025-07-21 22:16:35 +0200 | Frostillicus | (~Frostilli@pool-71-174-119-69.bstnma.fios.verizon.net) (Read error: Connection reset by peer) |
2025-07-21 22:16:33 +0200 | <tomsmeding> | well [| |] returns a Q Exp |
2025-07-21 22:16:28 +0200 | <tomsmeding> | ah |
2025-07-21 22:16:23 +0200 | <dminuoso> | tomsmeding: No I meant regarding quotation, I was looking at the [| val |] parts |
2025-07-21 22:16:07 +0200 | <tomsmeding> | dminuoso: you were asking about 'caseE'; there are only two occurrences of 'caseE', and they are in a splice |
2025-07-21 22:15:46 +0200 | <dminuoso> | tomsmeding: Maybe we're looking at different parts then. What are you staring at? |
2025-07-21 22:15:38 +0200 | <tomsmeding> | quotes produce monadic values too, by the way |
2025-07-21 22:15:33 +0200 | <tomsmeding> | dminuoso: quotes are [| |], splices are $( ) |
2025-07-21 22:15:30 +0200 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-07-21 22:15:24 +0200 | <tomsmeding> | then you can simplify the caseE code |
2025-07-21 22:15:23 +0200 | <dminuoso> | tomsmeding: You mean quotation, no? |
2025-07-21 22:15:18 +0200 | <haskellbridge> | <magic_rb> it works, so i guess so lmao |
2025-07-21 22:15:11 +0200 | <haskellbridge> | <magic_rb> tomsmeding idk youre the expert |
2025-07-21 22:14:59 +0200 | <haskellbridge> | <magic_rb> its hard to write these instances normally, TH makes it harder |
2025-07-21 22:14:54 +0200 | <tomsmeding> | magic_rb: wait you can use a splice in a pattern position? |
2025-07-21 22:14:33 +0200 | <dminuoso> | Im just not happy with TH at all. :( |
2025-07-21 22:14:31 +0200 | <haskellbridge> | <magic_rb> ! D: |
2025-07-21 22:14:23 +0200 | humasect | (~humasect@dyn-192-249-132-90.nexicom.net) (Quit: Leaving...) |
2025-07-21 22:14:08 +0200 | jmcantrell | (~weechat@user/jmcantrell) (Ping timeout: 272 seconds) |
2025-07-21 22:14:06 +0200 | <tomsmeding> | more TH! :D |
2025-07-21 22:13:58 +0200 | <haskellbridge> | <magic_rb> oh im missing an instance still, grr |
2025-07-21 22:13:44 +0200 | <tomsmeding> | that ^ |
2025-07-21 22:13:43 +0200 | b7r6 | (~b7r6@user/b7r6) (Quit: Client closed) |
2025-07-21 22:13:36 +0200 | <tomsmeding> | caseE is convenience |
2025-07-21 22:13:31 +0200 | <glguy> | dminuoso: The whole of the template haskell API is set up to make it possible to use it without explicit binds. Lots of the things are just trivially wrapped to reduce monad noise |
2025-07-21 22:13:25 +0200 | <tomsmeding> | so if you want to generate a case expression to splice in, you'd write $(pure (CaseE .....)) |
2025-07-21 22:13:09 +0200 | <tomsmeding> | in a splice $(x), the x needs to be of type Q Exp |
2025-07-21 22:13:00 +0200 | <tomsmeding> | no the other way round |
2025-07-21 22:12:56 +0200 | <dminuoso> | For instance |
2025-07-21 22:12:54 +0200 | <dminuoso> | There's quite a few unnecessary pure that would disappear with CaseE |
2025-07-21 22:12:45 +0200 | <dminuoso> | tomsmeding: How does caseE avoid a pure? |
2025-07-21 22:12:43 +0200 | <tomsmeding> | and they also take monadic arguments that they just execute once |
2025-07-21 22:12:27 +0200 | <tomsmeding> | yes |
2025-07-21 22:12:22 +0200 | <dminuoso> | It seems like there's a lot of monadic helper usages without any effects |
2025-07-21 22:12:21 +0200 | <tomsmeding> | dminuoso: avoid a `pure` |
2025-07-21 22:12:21 +0200 | <haskellbridge> | <magic_rb> but no because its horrible |
2025-07-21 22:12:16 +0200 | <haskellbridge> | <magic_rb> yes because its extremely powerful and the problem it solved for me is wonderful |
2025-07-21 22:12:11 +0200 | <tomsmeding> | it's not super pleasant, no |
2025-07-21 22:12:10 +0200 | <dminuoso> | I wonder, why use caseE rather than CaseE here? |
2025-07-21 22:11:56 +0200 | <tomsmeding> | :) |
2025-07-21 22:11:52 +0200 | <haskellbridge> | <magic_rb> iif youre asking whether i want to write more TH code, the answer is _yesn't_ |
2025-07-21 22:11:41 +0200 | <tomsmeding> | turns out conT already exists https://hackage.haskell.org/package/template-haskell-2.18.0.0/docs/Language-Haskell-TH-Lib-Interna… |
2025-07-21 22:11:35 +0200 | <haskellbridge> | <magic_rb> im happy it works, but uh |