Logs: liberachat/#haskell
| 2025-09-30 07:43:47 | <[exa]> | chromoblob: there should be a way to make a pattern synonym for that, will try |
| 2025-09-30 07:44:07 | <[exa]> | actually looks weird to me that no one documented this |
| 2025-09-30 07:44:20 | <[exa]> | time2try |
| 2025-09-30 07:44:51 | → | _bo joins (~bo@98.red-83-56-255.dynamicip.rima-tde.net) |
| 2025-09-30 07:45:42 | → | chele joins (~chele@user/chele) |
| 2025-09-30 07:46:54 | → | sord937 joins (~sord937@gateway/tor-sasl/sord937) |
| 2025-09-30 07:51:57 | <[exa]> | chromoblob: ok so the way 1 with viewpatterns (still there's an obnoxious extra Just): https://paste.tomsmeding.com/LQcWsMCY |
| 2025-09-30 07:52:46 | <chromoblob> | yeah, very simple |
| 2025-09-30 07:53:17 | × | ft quits (~ft@p4fc2a225.dip0.t-ipconnect.de) (Quit: leaving) |
| 2025-09-30 07:55:51 | × | img quits (~img@user/img) (Quit: ZNC 1.8.2 - https://znc.in) |
| 2025-09-30 07:56:33 | <c_wraith> | you can't pass an argument to a pattern synonym.... as a value. |
| 2025-09-30 07:57:49 | <[exa]> | c_wraith: yeah I just hit that now |
| 2025-09-30 07:58:22 | <[exa]> | chromoblob: the closest I got with the synonyms so far: https://paste.tomsmeding.com/CSv7TWl9 |
| 2025-09-30 07:58:43 | → | img joins (~img@user/img) |
| 2025-09-30 07:59:04 | <tomsmeding> | [exa]: you can give the pattern synonym a Symbol-kinded type argument as the prefix |
| 2025-09-30 07:59:17 | <c_wraith> | that's why I said "as a value" :) |
| 2025-09-30 07:59:22 | <tomsmeding> | indeed |
| 2025-09-30 07:59:50 | × | img quits (~img@user/img) (Client Quit) |
| 2025-09-30 08:01:07 | → | img joins (~img@user/img) |
| 2025-09-30 08:01:09 | <[exa]> | oh whoa, ghc panic: https://paste.tomsmeding.com/aYsg3Ma9 |
| 2025-09-30 08:01:38 | <[exa]> | I thought I'd outsmart it |
| 2025-09-30 08:01:46 | <tomsmeding> | wow |
| 2025-09-30 08:02:04 | <tomsmeding> | even 9.12 crashes on this |
| 2025-09-30 08:02:06 | <[exa]> | hm what do I need for the symbol-kinded example? datakinds? |
| 2025-09-30 08:02:14 | <tomsmeding> | [exa]: report it as a GHC bug :D |
| 2025-09-30 08:03:04 | <tomsmeding> | [exa]: https://play.haskell.org/saved/kFMlnUcJ |
| 2025-09-30 08:04:31 | <[exa]> | oh cool |
| 2025-09-30 08:04:38 | <[exa]> | chromoblob: ^ this is likely the closest we can get |
| 2025-09-30 08:04:41 | <[exa]> | thanks! |
| 2025-09-30 08:05:12 | <tomsmeding> | this is like the 4th time that I've coded up this example, 10 mins ago I was looking through the logs trying to find an earlier version of it but I couldn't so I typed it up again :p |
| 2025-09-30 08:05:30 | <[exa]> | time to throw it at the wiki? :D |
| 2025-09-30 08:05:30 | <tomsmeding> | most significant limitation is what c_wraith said: the prefix must be static, cannot be runtime-determined |
| 2025-09-30 08:06:00 | <[exa]> | I'd say that's ok |
| 2025-09-30 08:06:03 | <c_wraith> | well... Not *strictly* true. |
| 2025-09-30 08:06:41 | <tomsmeding> | I guess you can withSomeSSymbol and then withKnownSymbol to construct a KnownSymbol out of thin air |
| 2025-09-30 08:06:50 | <c_wraith> | yeah, but at that point... why? |
| 2025-09-30 08:06:57 | <tomsmeding> | but you can't just put that around an argument |
| 2025-09-30 08:06:59 | <tomsmeding> | yes |
| 2025-09-30 08:07:44 | <tomsmeding> | [exa]: your ghc-crashing example is very fragile |
| 2025-09-30 08:08:12 | <[exa]> | I kinda fail to see why, but okay |
| 2025-09-30 08:08:29 | <tomsmeding> | [exa]: https://play.haskell.org/saved/If9WqzWN |
| 2025-09-30 08:08:40 | <tomsmeding> | the presence of that p == s guard is somehow essential |
| 2025-09-30 08:09:13 | <[exa]> | lol |
| 2025-09-30 08:09:35 | <[exa]> | btw I won't be able to open the issue today so if anyone volunteered to report this it would be very welcome |
| 2025-09-30 08:10:58 | <tomsmeding> | [exa]: your code does not type check, like, at all |
| 2025-09-30 08:11:05 | <tomsmeding> | GHC is being drunk |
| 2025-09-30 08:11:15 | <[exa]> | how come it doesn't typecheck? |
| 2025-09-30 08:11:18 | <[exa]> | it worked :D |
| 2025-09-30 08:11:23 | <tomsmeding> | prefixed :: String -> String -> Maybe String |
| 2025-09-30 08:11:28 | <tomsmeding> | prefixed2 :: (String, String) -> Maybe String |
| 2025-09-30 08:11:34 | → | haritz joins (~hrtz@137.220.80.141) |
| 2025-09-30 08:11:34 | × | haritz quits (~hrtz@137.220.80.141) (Changing host) |
| 2025-09-30 08:11:34 | → | haritz joins (~hrtz@user/haritz) |
| 2025-09-30 08:11:35 | <[exa]> | check |
| 2025-09-30 08:11:35 | <tomsmeding> | so the x in Secured is a String |
| 2025-09-30 08:11:43 | <tomsmeding> | so the argument to Secured in 'secure' is a String |
| 2025-09-30 08:11:46 | <tomsmeding> | not a (String, String) |
| 2025-09-30 08:11:57 | <tomsmeding> | if I give 'prefixed' a type signature, ghc complains |
| 2025-09-30 08:12:05 | <tomsmeding> | I don't know _what_ is going on here |
| 2025-09-30 08:12:14 | <[exa]> | ooooooh I see |
| 2025-09-30 08:12:26 | <[exa]> | I put the tuple into it from the wrong side |
| 2025-09-30 08:12:29 | <tomsmeding> | yes |
| 2025-09-30 08:12:55 | <tomsmeding> | prefixed2 would need to also return the pair for the whole trick to work |
| 2025-09-30 08:13:05 | <tomsmeding> | as in, take (prefix, whole) and return (prefix, suffix) |
| 2025-09-30 08:13:14 | <[exa]> | yeah that was not the intention |
| 2025-09-30 08:13:19 | <tomsmeding> | but I have no clue why ghc is accepting the code |
| 2025-09-30 08:13:27 | <[exa]> | "accepting" :D |
| 2025-09-30 08:13:33 | <tomsmeding> | well if you remove the | p == s guard |
| 2025-09-30 08:13:57 | <tomsmeding> | ah |
| 2025-09-30 08:13:59 | <tomsmeding> | no it doesn't |
| 2025-09-30 08:14:14 | <tomsmeding> | if you leave in the Just s case of prefixed then it throws a type error as expected, even without a type signature |
| 2025-09-30 08:14:33 | <tomsmeding> | so here is code that contains a type error, but somehow ghc breaks before being able to report it |
| 2025-09-30 08:14:39 | tomsmeding | has a meeting, sorry |
| 2025-09-30 08:14:54 | <[exa]> | #metoo |
| 2025-09-30 08:15:06 | <[exa]> | ok let's see later |
| 2025-09-30 08:16:35 | → | ljdarj joins (~Thunderbi@user/ljdarj) |
| 2025-09-30 08:18:01 | trickard_ | is now known as trickard |
| 2025-09-30 08:19:53 | → | merijn joins (~merijn@77.242.116.146) |
| 2025-09-30 08:21:26 | Googulator38 | is now known as Googulator |
| 2025-09-30 08:21:35 | → | fp joins (~Thunderbi@2001:708:20:1406::10c5) |
| 2025-09-30 08:25:19 | × | merijn quits (~merijn@77.242.116.146) (Ping timeout: 240 seconds) |
| 2025-09-30 08:28:03 | → | merijn joins (~merijn@77.242.116.146) |
| 2025-09-30 08:29:16 | → | annamalai joins (~annamalai@157.32.115.168) |
| 2025-09-30 08:36:35 | × | ByronJohnson quits (~bairyn@MAIL.DIGITALKINGDOM.ORG) (Ping timeout: 245 seconds) |
| 2025-09-30 08:41:47 | × | merijn quits (~merijn@77.242.116.146) (Ping timeout: 250 seconds) |
| 2025-09-30 08:45:31 | → | ByronJohnson joins (~bairyn@MAIL.DIGITALKINGDOM.ORG) |
| 2025-09-30 08:50:17 | × | tromp quits (~textual@2001:1c00:3487:1b00:ec31:dae7:cc09:de7b) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 2025-09-30 08:54:17 | → | merijn joins (~merijn@77.242.116.146) |
| 2025-09-30 08:54:18 | × | ByronJohnson quits (~bairyn@MAIL.DIGITALKINGDOM.ORG) (Ping timeout: 248 seconds) |
| 2025-09-30 09:00:56 | × | merijn quits (~merijn@77.242.116.146) (Ping timeout: 244 seconds) |
| 2025-09-30 09:01:49 | <ski> | @index stripPrefix |
| 2025-09-30 09:01:49 | <lambdabot> | GHC.OldList, Data.List |
| 2025-09-30 09:01:50 | <ski> | @type stripPrefix |
| 2025-09-30 09:01:51 | <lambdabot> | Eq a => [a] -> [a] -> Maybe [a] |
| 2025-09-30 09:02:21 | × | fp quits (~Thunderbi@2001:708:20:1406::10c5) (Ping timeout: 252 seconds) |
| 2025-09-30 09:04:24 | → | Enrico63 joins (~Enrico63@2a0b:e541:10d0:0:9efc:e8ff:fe24:3213) |
| 2025-09-30 09:05:34 | <ski> | [exa],c_wraith : `pattern Append :: Eq a => [a] -> () => [a] -> [a]' ought to be possible, first comes input context and parameters, then output context and parameters, finally input result |
| 2025-09-30 09:05:47 | × | Enrico63 quits (~Enrico63@2a0b:e541:10d0:0:9efc:e8ff:fe24:3213) (Client Quit) |
| 2025-09-30 09:06:07 | → | merijn joins (~merijn@77.242.116.146) |
| 2025-09-30 09:07:04 | → | dhil joins (~dhil@5.151.29.138) |
All times are in UTC.