Newest at the top
| 2026-02-24 19:21:40 +0100 | <EvanR> | for a one off case, this takes a lot less support |
| 2026-02-24 19:21:39 +0100 | <Milan_Vanca> | Little more verbose but one does not need another lib. |
| 2026-02-24 19:20:46 +0100 | <EvanR> | you can also write an update function f g (v1, Just x, v3) = (v1, Just (g x), v3) |
| 2026-02-24 19:18:41 +0100 | <EvanR> | that is one way |
| 2026-02-24 19:18:04 +0100 | <Milan_Vanca> | Yeah :) This is nice.. and If I wanted to modify v2 I could use lenses for that. Is that correct? |
| 2026-02-24 19:15:45 +0100 | <haskellbridge> | <loonycyborg> yep |
| 2026-02-24 19:15:28 +0100 | rainbyte_ | (~rainbyte@186.22.19.214) rainbyte |
| 2026-02-24 19:15:23 +0100 | <Milan_Vanca> | loonycyborg: Do you mean something like (v1, (Just v2), _) ? |
| 2026-02-24 19:15:19 +0100 | rainbyte | (~rainbyte@186.22.19.214) (Remote host closed the connection) |
| 2026-02-24 19:13:03 +0100 | traxex | (traxex@user/traxex) traxex |
| 2026-02-24 19:11:39 +0100 | glguy | (glguy@libera/staff/glguy) glguy |
| 2026-02-24 19:11:34 +0100 | glguy | (glguy@libera/staff/glguy) (*.net *.split) |
| 2026-02-24 19:08:45 +0100 | <haskellbridge> | <loonycyborg> Milan_Vanca: not sure if it applies to your situation but you can do deep nesting in the pattern too, so if you just want to look deeper in a nested structure you can fold nested "case" into a single case. |
| 2026-02-24 19:05:29 +0100 | lisbeths | (uid135845@id-135845.lymington.irccloud.com) lisbeths |
| 2026-02-24 19:04:02 +0100 | philopsos1 | (~caecilius@user/philopsos) (Ping timeout: 256 seconds) |
| 2026-02-24 18:58:21 +0100 | petrichor | (~jez@user/petrichor) petrichor |
| 2026-02-24 18:56:45 +0100 | cipherrot | (~jez@user/petrichor) (Quit: ZNC 1.10.1 - https://znc.in) |
| 2026-02-24 18:56:01 +0100 | tromp | (~textual@2001:1c00:3487:1b00:7955:9591:6018:7ef9) |
| 2026-02-24 18:52:51 +0100 | tromp | (~textual@2001:1c00:3487:1b00:7955:9591:6018:7ef9) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 2026-02-24 18:52:37 +0100 | wickedjargon | (~user@2605:8d80:5431:6cb2:b646:a30f:510c:87ce) wickedjargon |
| 2026-02-24 18:51:54 +0100 | wickedja` | (~user@2605:8d80:5431:6cb2:b646:a30f:510c:87ce) (Remote host closed the connection) |
| 2026-02-24 18:51:47 +0100 | wickedjargon | (~user@2605:8d80:5431:6cb2:b646:a30f:510c:87ce) (Remote host closed the connection) |
| 2026-02-24 18:48:57 +0100 | wickedja` | (~user@2605:8d80:5431:6cb2:b646:a30f:510c:87ce) |
| 2026-02-24 18:45:34 +0100 | wickedjargon | (~user@2605:8d80:5431:6cb2:b646:a30f:510c:87ce) wickedjargon |
| 2026-02-24 18:42:16 +0100 | <Milan_Vanca> | Hmm map with lookup sounds interesting too. |
| 2026-02-24 18:40:27 +0100 | <ncf> | i mean that's fine, if you have a lot of those you might want to define a list or a map like [(methodGet, counterGet), (methodPut, counterPut), ...] and then do a lookup into that |
| 2026-02-24 18:39:13 +0100 | <Milan_Vanca> | If I had only 2 then I would use an if expression which is perfect solution for that case |
| 2026-02-24 18:38:28 +0100 | <Milan_Vanca> | Like I can do it with if but it does not look like nicer solution. |
| 2026-02-24 18:37:29 +0100 | <Milan_Vanca> | What about now? https://paste.tomsmeding.com/ptnApMeq |
| 2026-02-24 18:36:23 +0100 | <ncf> | well, an if expression |
| 2026-02-24 18:36:14 +0100 | <ncf> | i don't see a reason not to use an if statement there |
| 2026-02-24 18:35:44 +0100 | ljdarj | (~Thunderbi@user/ljdarj) (Ping timeout: 245 seconds) |
| 2026-02-24 18:34:55 +0100 | weary-traveler | (~user@user/user363627) (Remote host closed the connection) |
| 2026-02-24 18:33:10 +0100 | Pozyomka | (~pyon@user/pyon) pyon |
| 2026-02-24 18:32:45 +0100 | Pozyomka | (~pyon@user/pyon) (Quit: brb) |
| 2026-02-24 18:32:27 +0100 | <Milan_Vanca> | I think I can do this https://paste.tomsmeding.com/FfemQcpX but this case of is ugly? |
| 2026-02-24 18:27:24 +0100 | petrichor | (~jez@user/petrichor) (Ping timeout: 245 seconds) |
| 2026-02-24 18:26:42 +0100 | cipherrot | (~jez@user/petrichor) petrichor |
| 2026-02-24 18:25:36 +0100 | euphores | (~SASL_euph@user/euphores) euphores |
| 2026-02-24 18:24:54 +0100 | merijn | (~merijn@77.242.116.146) (Ping timeout: 255 seconds) |
| 2026-02-24 18:23:45 +0100 | bggd_ | (~bgg@2a01:e0a:fd5:f510:ad7c:fa54:e40d:9544) (Remote host closed the connection) |
| 2026-02-24 18:21:07 +0100 | <Milan_Vanca> | I probably need whole new function for it |
| 2026-02-24 18:20:50 +0100 | petrichor | (~jez@user/petrichor) petrichor |
| 2026-02-24 18:20:48 +0100 | <Milan_Vanca> | Imagine I want to have another otherwise with under counter path. |
| 2026-02-24 18:18:56 +0100 | <Milan_Vanca> | So is there other way how to rewrite this more nicely? https://paste.tomsmeding.com/NokCDmVI |
| 2026-02-24 18:10:10 +0100 | <ncf> | if you really want a RHS equivalent of guards there is MultiWayIf https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/multiway_if.html |
| 2026-02-24 18:09:39 +0100 | <ncf> | guards don't do anything that let and case can't |
| 2026-02-24 18:05:29 +0100 | lxsameer | (~lxsameer@Serene/lxsameer) lxsameer |
| 2026-02-24 18:04:12 +0100 | <Milan_Vanca> | Hello guyz.. Stupid quesiton incoming! We can nicely nest "case of" fn a b c = case a of.. case b of... Lovely but sadly I can't pattern match and need guards. Which I don't know how to nest. I don't want to duplicate e1 && e2 && e3 when only e4 changes. |
| 2026-02-24 18:02:14 +0100 | lbseale | (~quassel@user/ep1ctetus) ep1ctetus |