2025/07/21

Newest at the top

2025-07-21 22:29:22 +0200machinedgod(~machinedg@d75-159-126-101.abhsia.telus.net) (Ping timeout: 252 seconds)
2025-07-21 22:28:08 +0200jespada_(~jespada@2800:a4:2242:c500:50f:4d6c:d22f:958c) (Quit: My Mac has gone to sleep. ZZZzzz…)
2025-07-21 22:27:28 +0200euphores(~SASL_euph@user/euphores) (Ping timeout: 240 seconds)
2025-07-21 22:24:41 +0200ndudaev(~ndudaev@user/ndudaev) (Client Quit)
2025-07-21 22:21:18 +0200 <tomsmeding> so apparently this is allowed :p
2025-07-21 22:21:11 +0200 <tomsmeding> I used caseE before because I thought that $() splices could only appear in expression position, not in pattern position, but you're using them in pattern position in the arguments to explExists and explGet
2025-07-21 22:20:47 +0200 <tomsmeding> only difference is in the generated ExplGet instance methods, I'm using a normal case expression instead of caseE
2025-07-21 22:20:32 +0200 <tomsmeding> magic_rb: I think this should work too (but untested) https://paste.tomsmeding.com/N9x3Eopo
2025-07-21 22:20:00 +0200ndudaev(~ndudaev@user/ndudaev) ndudaev
2025-07-21 22:19:58 +0200merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds)
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 +0200Frostillicus(~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 +0200jmcantrell(~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 +0200Frostillicus(~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 +0200merijn(~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 +0200humasect(~humasect@dyn-192-249-132-90.nexicom.net) (Quit: Leaving...)
2025-07-21 22:14:08 +0200jmcantrell(~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 +0200b7r6(~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