2026/03/07

Newest at the top

2026-03-07 20:06:12 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-03-07 20:01:32 +0100Square(~Square@user/square) (Remote host closed the connection)
2026-03-07 19:59:40 +0100 <haskellbridge> <sm> wizardry!
2026-03-07 19:59:00 +0100 <c_wraith> some arcane bit of lore. (I think it's actually called the User Guide? Eh. Whatever.)
2026-03-07 19:58:17 +0100 <haskellbridge> <sm> what is this "manual" you speak of...
2026-03-07 19:57:25 +0100 <c_wraith> You still need to understand *why* you'd use it, but it still provides an incredible reference for what all the syntax does.
2026-03-07 19:56:32 +0100 <c_wraith> perhaps shockingly, the ghc user's manual is actually where I learned most of what I know about template haskell.
2026-03-07 19:55:10 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 245 seconds)
2026-03-07 19:54:30 +0100tromp(~textual@2001:1c00:3487:1b00:e975:d7be:a717:768f)
2026-03-07 19:54:19 +0100 <[exa]> yeah I'm not sure there's any actual tutorial, it's kinda materialized pre-compilation computation, IMO very good for such usecases
2026-03-07 19:50:23 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-03-07 19:49:53 +0100 <haskellbridge> <zb> (i’ll start from https://wiki.haskell.org/Template_Haskell)
2026-03-07 19:49:45 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 245 seconds)
2026-03-07 19:46:36 +0100 <haskellbridge> <zb> would you have any easy pointers to where i could read more about templatehaskell preprocessing?
2026-03-07 19:45:22 +0100 <[exa]> also perhaps generating the alternatives in the process so that you don't have O(15k) of code
2026-03-07 19:45:22 +0100 <haskellbridge> ... maximum number of iterations to n)
2026-03-07 19:45:16 +0100 <haskellbridge> <zb> for the record: it works! or i think it does! though the compiling takes a couple of minutes, which is a bit inconvenient, and the first lookup i then did in my ghci session felt a bit slow, maybe like 0.5s. but then the next lookups don’t feel slow anymore. i did get a warning when compiling/loading the module: Pattern match checker exceeded (2000000) iterations in an equation for ‘g000’. (Use -fmax-pmcheck-iterations=n to set the...
2026-03-07 19:45:06 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-03-07 19:44:55 +0100 <[exa]> zb: if you totally need some such thing to happen you might want to have some templatehaskell preprocessing step that chews the 15k alternatives into something more tangible for ghc
2026-03-07 19:34:05 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 272 seconds)
2026-03-07 19:33:05 +0100kadobanana(~mud@user/kadoban) (Ping timeout: 245 seconds)
2026-03-07 19:30:51 +0100tromp(~textual@2001:1c00:3487:1b00:e975:d7be:a717:768f) (Quit: My iMac has gone to sleep. ZZZzzz…)
2026-03-07 19:26:23 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-03-07 19:25:00 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 264 seconds)
2026-03-07 19:24:19 +0100 <monochrom> Ah yeah, that. "f 1 2 3 = 4; f 1 3 7 = 2" is likely "f x y z = case x of 1 -> {cases for y and z under x=1}". But really, the benefit is negligible until you ask "can I have a function of 15k arguments?" >:)
2026-03-07 19:23:14 +0100 <c_wraith> Though I guess that still has as many leaves as there are equations, so it's not really doing much besides eliminating redundant checks
2026-03-07 19:22:05 +0100 <c_wraith> GHC *might* make it a trie at best - collapsing all the prefixes together. I wouldn't expect anything more clever than that.
2026-03-07 19:21:08 +0100driib3180(~driib@176.57.184.141) (Client Quit)
2026-03-07 19:17:46 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-03-07 19:17:43 +0100driib3180(~driib@176.57.184.141) driib
2026-03-07 19:16:41 +0100 <haskellbridge> <zb> kind of expecting, really, since defining the (f 1)’s shouldn’t be too many lines!
2026-03-07 19:15:17 +0100 <haskellbridge> <zb> ah... i was hoping for the compiler make it into some clever hash lookups or something :D
2026-03-07 19:12:58 +0100CallipygousPepe(~reuben@user/CallipygousPepe) (Quit: Konversation terminated!)
2026-03-07 19:12:42 +0100 <monochrom> 15k lines of "f 1 2 3 = 4" is likely compiled to exhaustive search over 15k cases.
2026-03-07 19:11:10 +0100 <haskellbridge> <zb> (this would be charset conversion tables, which i guess i would want to somehow compile into the module for efficiency. the specific module would define only the one 15k equations function)
2026-03-07 19:10:49 +0100 <EvanR> the einstein equation for GR expands to like... a lot of equations
2026-03-07 19:10:32 +0100 <EvanR> worked for einstein
2026-03-07 19:06:21 +0100 <monochrom> Just for auditability you should find a better way, i.e., a way that leads to code easy to check.
2026-03-07 19:04:29 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 245 seconds)
2026-03-07 19:03:29 +0100 <haskellbridge> <zb> but it would prably be better to take an other approach?
2026-03-07 19:03:27 +0100 <monochrom> https://xkcd.com/303/ applies >:)
2026-03-07 19:03:01 +0100 <monochrom> (oh and how long you can wait :) )
2026-03-07 19:02:49 +0100 <monochrom> I think there is no preset limit apart from what GHC and your computer can handle.
2026-03-07 19:01:09 +0100 <haskellbridge> <zb> how many equations can i use to define a single function in haskell? is 15k too much? :P (they would be something like f :: Word8 -> Word8 -> Word8 -> Char)
2026-03-07 18:59:52 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-03-07 18:56:34 +0100AlexNoo_(~AlexNoo@178.34.150.243) (Ping timeout: 248 seconds)
2026-03-07 18:56:02 +0100AlexNoo(~AlexNoo@178.34.150.243) (Ping timeout: 248 seconds)
2026-03-07 18:52:21 +0100AlexNoo_(~AlexNoo@178.34.150.243)
2026-03-07 18:52:18 +0100AlexNoo__(~AlexNoo@178.34.150.243) (Ping timeout: 248 seconds)
2026-03-07 18:51:57 +0100hellwolf(~user@a38e-19d1-a5f7-21b5-0f00-4d40-07d0-2001.sta.estpak.ee) hellwolf